/*
===========================================
BLACKBIRD TRAINING - MOBILE OPTIMIZATIONS
===========================================
Mobile-First Responsive Enhancements
Author: Development Team
Last Updated: November 3, 2025
===========================================
*/

/* ===== GENERAL MOBILE IMPROVEMENTS ===== */

/* Better tap targets for mobile - minimum 44x44px */
@media (max-width: 768px) {
    /* Links and Buttons */
    a, button, .btn {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 12px 20px !important;
    }

    /* Better touch feedback */
    a, button, .btn, .card {
        -webkit-tap-highlight-color: rgba(189, 158, 52, 0.2);
        tap-highlight-color: rgba(189, 158, 52, 0.2);
    }

    /* Smooth scrolling */
    html {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }

    /* Better font sizing for readability */
    body {
        font-size: 16px !important;
        line-height: 1.6;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    h1 {
        font-size: 1.75rem !important;
        line-height: 1.3;
    }

    h2 {
        font-size: 1.5rem !important;
        line-height: 1.3;
    }

    h3 {
        font-size: 1.25rem !important;
        line-height: 1.4;
    }

    h4, h5, h6 {
        font-size: 1.1rem !important;
        line-height: 1.4;
    }

    /* Better spacing for mobile */
    section {
        padding: 2rem 0 !important;
    }

    .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}

/* ===== PROGRAM PAGE MOBILE OPTIMIZATION ===== */
@media (max-width: 768px) {
    /* Fix program boxes to stack properly */
    .programBox {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 15px 0 !important;
        padding: 0 !important;
    }

    .programBox .card-body {
        padding: 15px !important;
    }

    .programBox .card-title {
        font-size: 16px !important;
        height: auto !important;
        min-height: 40px;
        margin-bottom: 15px !important;
    }

    /* Better table display for events */
    .programBox table {
        font-size: 11px !important;
    }

    .programBox table td {
        padding: 5px 2px !important;
        white-space: nowrap;
    }

    /* Improve "More dates" button */
    .moreButun {
        padding: 12px 20px !important;
        font-size: 14px !important;
        width: 100%;
        display: block;
        text-align: center;
    }

    /* Course images */
    .programBox img {
        width: 100%;
        height: auto;
        max-height: 200px;
        object-fit: cover;
    }
}

/* ===== NAVIGATION MOBILE IMPROVEMENTS ===== */
@media (max-width: 992px) {
    /* Better navbar spacing */
    .navbar {
        padding: 10px 15px !important;
    }

    .navbar-brand img {
        max-height: 40px !important;
    }

    /* Hamburger menu improvements */
    .navbar-toggler {
        padding: 10px !important;
        font-size: 1.5rem;
        border: none;
        outline: none;
    }

    .navbar-toggler:focus {
        box-shadow: none;
        outline: 2px solid #bd9e34;
    }

    /* Mobile menu */
    .navbar-collapse {
        background: #fff;
        padding: 15px;
        margin-top: 10px;
        border-radius: 8px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    }

    .navbar-nav .nav-link {
        padding: 12px 15px !important;
        font-size: 16px !important;
        border-bottom: 1px solid #f0f0f0;
    }

    .navbar-nav .nav-link:last-child {
        border-bottom: none;
    }

    /* Dropdown improvements */
    .dropdown-menu {
        border: none;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        margin-top: 5px !important;
    }

    .dropdown-item {
        padding: 12px 20px !important;
        font-size: 15px !important;
    }
}

/* ===== FORMS MOBILE OPTIMIZATION ===== */
@media (max-width: 768px) {
    /* Better form inputs */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="password"],
    textarea,
    select {
        font-size: 16px !important; /* Prevents zoom on iOS */
        padding: 12px 15px !important;
        min-height: 48px;
        border-radius: 8px;
        width: 100%;
    }

    textarea {
        min-height: 120px;
    }

    /* Form labels */
    label {
        font-size: 14px;
        font-weight: 600;
        margin-bottom: 8px;
        display: block;
    }

    /* Submit buttons */
    button[type="submit"],
    input[type="submit"],
    .btn-primary {
        width: 100%;
        padding: 14px 20px !important;
        font-size: 16px !important;
        font-weight: 600;
        min-height: 50px;
        margin-top: 10px;
    }
}

/* ===== CARDS & CONTENT MOBILE ===== */
@media (max-width: 768px) {
    /* Card improvements */
    .card {
        margin-bottom: 15px;
        border-radius: 8px;
    }

    .card-body {
        padding: 15px !important;
    }

    .card-title {
        font-size: 1.1rem !important;
        margin-bottom: 10px;
    }

    .card-text {
        font-size: 0.95rem;
        line-height: 1.5;
    }

    /* Images in cards */
    .card img {
        width: 100%;
        height: auto;
        border-radius: 8px 8px 0 0;
    }
}

/* ===== TABLES MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    /* Make tables scrollable */
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        font-size: 14px !important;
    }

    table th,
    table td {
        padding: 8px !important;
        white-space: nowrap;
    }

    /* Stack table on very small screens */
    .table-mobile-stack {
        display: block;
    }

    .table-mobile-stack thead {
        display: none;
    }

    .table-mobile-stack tbody,
    .table-mobile-stack tr,
    .table-mobile-stack td {
        display: block;
        width: 100%;
    }

    .table-mobile-stack tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 10px;
    }

    .table-mobile-stack td {
        text-align: right;
        padding: 8px 10px !important;
        border-bottom: 1px solid #f0f0f0;
    }

    .table-mobile-stack td:before {
        content: attr(data-label);
        float: left;
        font-weight: bold;
        color: #bd9e34;
    }
}

/* ===== BREADCRUMBS MOBILE ===== */
@media (max-width: 768px) {
    .breadcrumb {
        padding: 10px 15px !important;
        font-size: 13px !important;
        flex-wrap: wrap;
    }

    .breadcrumb-item {
        padding: 3px 0;
    }

    .breadcrumb-item + .breadcrumb-item::before {
        padding: 0 8px;
    }
}

/* ===== MODALS MOBILE ===== */
@media (max-width: 768px) {
    .modal-dialog {
        margin: 10px !important;
        max-width: calc(100% - 20px) !important;
    }

    .modal-content {
        border-radius: 12px;
    }

    .modal-header {
        padding: 15px !important;
    }

    .modal-body {
        padding: 20px 15px !important;
    }

    .modal-footer {
        padding: 15px !important;
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
        margin: 5px 0 !important;
    }
}

/* ===== HERO SECTIONS MOBILE ===== */
@media (max-width: 768px) {
    /* Hero sections */
    .hero,
    .banner,
    .page-header {
        padding: 40px 20px !important;
        min-height: auto !important;
    }

    .hero h1,
    .banner h1 {
        font-size: 1.75rem !important;
        margin-bottom: 15px;
    }

    .hero p,
    .banner p {
        font-size: 1rem !important;
        margin-bottom: 20px;
    }

    /* Hero images */
    .hero img {
        max-height: 250px !important;
        width: 100%;
        object-fit: cover;
    }
}

/* ===== GRID & COLUMNS MOBILE ===== */
@media (max-width: 768px) {
    /* Force single column on mobile */
    .row.mobile-stack > [class*="col-"] {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    /* Better spacing between stacked columns */
    .row.mobile-stack > [class*="col-"] + [class*="col-"] {
        margin-top: 20px;
    }
}

/* ===== IMAGES MOBILE OPTIMIZATION ===== */
@media (max-width: 768px) {
    /* Responsive images */
    img {
        max-width: 100%;
        height: auto;
    }

    /* Better image loading */
    img[loading="lazy"] {
        background: #f5f5f5;
    }

    /* Prevent layout shift */
    .img-container {
        position: relative;
        width: 100%;
        overflow: hidden;
    }
}

/* ===== FOOTER MOBILE ===== */
@media (max-width: 768px) {
    footer {
        padding: 30px 15px !important;
    }

    footer h4, footer h5 {
        font-size: 1.1rem !important;
        margin-bottom: 15px;
    }

    footer ul li {
        padding: 8px 0;
    }

    footer .social-links a {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

/* ===== SEARCH BAR MOBILE ===== */
@media (max-width: 768px) {
    .search-form {
        width: 100% !important;
    }

    .search-input {
        font-size: 16px !important;
        padding: 12px 15px !important;
    }

    .search-btn {
        padding: 12px 20px !important;
    }
}

/* ===== PAGINATION MOBILE ===== */
@media (max-width: 768px) {
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }

    .pagination .page-item {
        margin: 2px;
    }

    .pagination .page-link {
        padding: 8px 12px !important;
        font-size: 14px !important;
        min-width: 40px;
        min-height: 40px;
    }

    /* Hide some page numbers on mobile */
    .pagination .page-item:not(.active):not(:first-child):not(:last-child) {
        display: none;
    }

    .pagination .page-item.active,
    .pagination .page-item:first-child,
    .pagination .page-item:last-child,
    .pagination .page-item.active + .page-item,
    .pagination .page-item.active + .page-item + .page-item {
        display: flex;
    }
}

/* ===== COURSE & EVENT PAGES MOBILE ===== */
@media (max-width: 768px) {
    /* Course hero */
    .course-hero,
    .event-hero {
        padding: 40px 20px !important;
    }

    .course-hero-title,
    .event-hero-title {
        font-size: 1.5rem !important;
    }

    /* Course meta bar */
    .course-meta-bar,
    .event-meta-bar {
        padding: 15px !important;
    }

    .course-meta-item {
        padding: 10px !important;
        border-right: none !important;
        border-bottom: 1px solid rgba(200, 170, 99, 0.3);
        justify-content: flex-start;
        width: 100%;
    }

    .course-meta-item:last-child {
        border-bottom: none;
    }

    /* Events grid */
    .events-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    /* Event card */
    .event-card {
        padding: 15px !important;
    }

    /* Action buttons */
    .course-action-btn,
    .event-action-btn {
        font-size: 14px !important;
        padding: 12px 20px !important;
    }
}

/* ===== ACCORDION / FAQ MOBILE ===== */
@media (max-width: 768px) {
    .accordion-button {
        font-size: 15px !important;
        padding: 12px 15px !important;
    }

    .accordion-body {
        padding: 15px !important;
        font-size: 14px;
    }
}

/* ===== UTILITIES MOBILE ===== */
@media (max-width: 768px) {
    /* Hide on mobile */
    .hide-mobile {
        display: none !important;
    }

    /* Show only on mobile */
    .show-mobile {
        display: block !important;
    }

    /* Text alignment */
    .text-mobile-center {
        text-align: center !important;
    }

    /* Spacing utilities */
    .mt-mobile-0 { margin-top: 0 !important; }
    .mt-mobile-1 { margin-top: 0.5rem !important; }
    .mt-mobile-2 { margin-top: 1rem !important; }
    .mt-mobile-3 { margin-top: 1.5rem !important; }
    
    .mb-mobile-0 { margin-bottom: 0 !important; }
    .mb-mobile-1 { margin-bottom: 0.5rem !important; }
    .mb-mobile-2 { margin-bottom: 1rem !important; }
    .mb-mobile-3 { margin-bottom: 1.5rem !important; }
    
    .p-mobile-0 { padding: 0 !important; }
    .p-mobile-1 { padding: 0.5rem !important; }
    .p-mobile-2 { padding: 1rem !important; }
    .p-mobile-3 { padding: 1.5rem !important; }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
@media (max-width: 768px) {
    /* Reduce animations on mobile for performance */
    * {
        animation-duration: 0.3s !important;
        transition-duration: 0.3s !important;
    }

    /* Optimize hover effects for touch devices */
    @media (hover: none) {
        .card:hover,
        .btn:hover,
        a:hover {
            transform: none !important;
        }
    }
}

/* ===== LANDSCAPE ORIENTATION ===== */
@media (max-width: 768px) and (orientation: landscape) {
    /* Reduce vertical spacing in landscape */
    section {
        padding: 1.5rem 0 !important;
    }

    .hero,
    .banner {
        min-height: 300px !important;
    }
}

/* ===== VERY SMALL SCREENS (< 375px) ===== */
@media (max-width: 375px) {
    body {
        font-size: 14px !important;
    }

    h1 {
        font-size: 1.5rem !important;
    }

    h2 {
        font-size: 1.3rem !important;
    }

    h3 {
        font-size: 1.15rem !important;
    }

    .btn, button, a {
        font-size: 14px !important;
        padding: 10px 15px !important;
    }

    .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
}

/* ===== ACCESSIBILITY FOR MOBILE ===== */
@media (max-width: 768px) {
    /* Better focus states */
    a:focus,
    button:focus,
    input:focus,
    select:focus,
    textarea:focus {
        outline: 3px solid #bd9e34 !important;
        outline-offset: 2px;
    }

    /* Skip to content link */
    .skip-to-content {
        position: absolute;
        top: -40px;
        left: 0;
        background: #bd9e34;
        color: #000;
        padding: 8px 15px;
        text-decoration: none;
        z-index: 100;
    }

    .skip-to-content:focus {
        top: 0;
    }
}

/* ===== PRINT STYLES FOR MOBILE ===== */
@media print {
    /* Hide unnecessary elements when printing */
    nav,
    .navbar,
    .breadcrumb,
    .pagination,
    button,
    .btn,
    .hide-print {
        display: none !important;
    }

    /* Optimize for printing */
    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
}

/*
===========================================
END OF MOBILE OPTIMIZATIONS
===========================================
*/

