/* ===================================
   Responsive Styles for FIF.Registration
   Media queries to ensure responsive design
   
   MOBILE NAVBAR/HEADER IMPROVEMENTS:
   - Sticky header on mobile for easy navigation
   - Optimized logo sizes for all screen sizes
   - Responsive login area with proper touch targets
   - Vertical stacking on very small screens
   - Landscape mode optimizations
   - Smooth transitions between breakpoints
   =================================== */

/* ===== Large Tablets and Small Desktops ===== */
@media screen and (max-width: 1200px) {
    /* Header adjustments */
    .header-content .my-logo {
        max-width: 220px !important;
    }

    .header-title-link h4 {
        font-size: 1.6rem !important;
    }

    /* Login buttons */
    .login-link {
        font-size: 0.95rem;
    }

    /* Summary cards */
    .summary-card-body {
        padding: 1.25rem;
    }

    /* Program boxes */
    .program-box {
        margin-bottom: 8rem;
        padding: 1.5rem;
    }

    .program-text h2 {
        font-size: 1.8rem;
    }

    .program-info .shape {
        max-width: 350px;
    }
}

/* ===== Tablets (Portrait and Landscape) ===== */
@media screen and (max-width: 992px) {
    /* Header adjustments */
    .header-content {
        padding: 0.75rem 0 !important;
    }

        .header-content .row {
            padding-top: 0.75rem !important;
            padding-bottom: 0.75rem !important;
            align-items: center !important;
        }

    .my-logo {
        max-width: 200px !important;
    }

    .header-title-link h4 {
        font-size: 1.4rem !important;
    }

    /* Improve header layout for tablets */
    .yellow-background {
        transition: all 0.3s ease;
    }

    /* Login area - make it more compact and responsive */
    .icons {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        padding-right: 0.75rem;
    }

    .login-buttons {
        gap: 0.75rem;
        flex-wrap: wrap;
        justify-content: flex-end;
        align-items: center;
    }

    .login-link {
        font-size: 0.9rem;
        padding-bottom: 1px;
        border-bottom-width: 1px;
        transition: all 0.2s ease;
    }

        .login-link:hover {
            transform: translateY(-1px);
        }

    /* Main container */
    main {
        padding-bottom: 10rem !important;
        margin-bottom: 8rem !important;
    }

    /* Page titles */
    h1, h4.page-title, h2.page-title {
        font-size: 1.75rem;
        margin-bottom: 2rem;
    }

    main p {
        font-size: 1.1rem;
    }

    /* Summary page cards - stack vertically */
    .summary-card {
        margin-bottom: 1.5rem;
    }

    .summary-card-header {
        padding: 0.875rem 1rem;
        font-size: 1.1rem;
    }

    .summary-card-body {
        padding: 1rem;
    }

        .summary-card-body p {
            font-size: 1rem;
            margin-bottom: 0.6rem;
        }

    /* Program boxes */
    .program-box {
        margin-bottom: 6rem;
        padding: 1.5rem 1rem;
    }

    .program-text {
        padding: 1rem 1.5rem !important;
    }

        .program-text h2 {
            font-size: 2.2rem;
            font-weight: 600;
        }

        .program-text h4 {
            font-size: 2rem;
            font-weight: 700;
        }

        .program-text h6 {
            font-size: 1.7rem;
            font-weight: 700;
        }

        .program-text p {
            font-size: 1.5rem;
            font-weight: 500;
        }

    .program-info .shape {
        max-width: 320px;
    }

    /* Form elements */
    .form-group label {
        font-size: 1.1rem;
    }

    .form-control {
        font-size: 1rem;
    }

    /* Buttons */
    .btn-primary, .btn-secondary {
        padding: 0.5rem 1.5rem;
        font-size: 1rem;
    }

    .solid-btn {
        font-size: 1.3rem;
        padding: 10px;
    }

    /* Accommodation cards */
    .accommodation-card {
        min-height: 10rem;
    }

        .accommodation-card h5 {
            font-size: 1.1rem;
            margin-left: 1rem;
        }

    .accommodation-icon {
        width: 40px;
        height: 40px;
    }

    /* Form cards */
    .form-card-header {
        padding: 1.25rem;
    }

    .form-card-body {
        padding: 1.5rem;
    }

        .form-card-body label {
            font-size: 1.1rem;
        }

    .login-buttons {
        gap: 0.5rem;
    }

    footer.footer p {
        font-size: 1rem;
    }
}

/* ===== Mobile Devices (Landscape and Large Phones) ===== */
@media screen and (max-width: 768px) {
    /* Header mobile adjustments */
    .header-content {
        padding: 0.5rem 0 !important;
    }

    .header-content .row {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
        align-items: center !important;
    }

    .my-logo {
        max-width: 180px !important;
    }

    /* Hide centered title on mobile */
    .header-title-link {
        display: none;
    }

    /* Mobile navbar/header improvements */
    .yellow-background {
        position: sticky;
        top: 0;
        z-index: 1000;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    }

    /* Login area - better mobile layout */
    .icons {
        display: flex;
        justify-content: flex-end;
        align-items: center;
    }

    .login-buttons {
        gap: 0.5rem;
        font-size: 0.85rem;
        flex-wrap: nowrap;
    }

    .login-link {
        font-size: 0.85rem;
        white-space: nowrap;
        min-height: auto !important;
        display: inline-block !important;
        align-items: initial !important;
        padding-bottom: 2px;
    }
    
    .login-link.user-name {
        cursor: default;
    }

    .login-delimiter {
        font-size: 1rem;
        margin: 0 0.25rem;
    }

    /* Improve touch targets for header links */
    .header-content a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    /* Main container */
    .main-container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        padding-top: 2rem !important;
    }

    main {
        padding-bottom: 8rem !important;
        margin-bottom: 6rem !important;
    }

    /* Page titles */
    h1, h4.page-title, h2.page-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
        margin-top: 1rem;
    }

    main p {
        font-size: 1rem;
    }

    /* Summary page */
    .summary-card {
        margin-bottom: 1.25rem;
    }

    .summary-card-header {
        padding: 0.75rem 0.875rem;
        font-size: 1rem;
    }

    .summary-card-body {
        padding: 0.875rem;
    }

    .summary-card-body p {
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
    }

    .summary-card-body h5 {
        font-size: 1.1rem;
    }

    .summary-card-body h6 {
        font-size: 1rem;
        margin-top: 0.75rem;
        margin-bottom: 0.5rem;
    }

    /* Program boxes - full mobile layout matching custom.css approach */
    .program-box {
        margin-bottom: 120px;
        padding: 2rem 1rem;
    }

    #programs {
        width: max-content;
        margin: 0 auto;
    }

        #programs .container {
            width: 100%;
        }

    .program-text {
        padding: 0 15px !important;
        margin-top: 0;
    }

    .program-text h2 {
        margin-bottom: 20px;
        font-weight: 700;
        font-size: 2.2rem;
    }

    .program-text h4 {
        font-size: 2rem;
        font-weight: 700;
        margin-bottom: 0.5rem;
    }

    .program-text h6 {
        font-size: 1.8rem;
        font-weight: 700;
        margin-bottom: 0.5rem;
    }

    .program-text p {
        font-size: 1.5rem;
        font-weight: 600;
        line-height: 1.5;
    }

    .program-info {
        padding-left: 15px;
        padding-right: 15px;
    }

    .program-info .shape {
        position: relative !important;
        left: 0 !important;
        right: 0 !important;
        top: -100px !important;
        max-width: 280px;
    }

    .program-info .shape .shape-in {
        position: relative;
        max-width: 96%;
    }

    .program-info .shape img {
        max-width: 90%;
    }

    .mt-60 {
        margin-top: 40px;
    }

    /* Dev banner */
    .dev-banner {
        font-size: 0.875rem;
        padding: 0.5rem;
        max-height: 4rem;
        line-height: 1.3;
    }

    /* Forms */
    .form-group label {
        font-size: 1rem;
    }

    .form-control {
        font-size: 0.95rem;
    }

    .form-card-body label {
        font-size: 1rem;
    }

    /* Buttons - make them touch-friendly */
    .btn-primary, .btn-secondary, .btn-success {
        padding: 0.625rem 1.25rem;
        font-size: 0.95rem;
        min-height: 44px;
    }

    .solid-btn {
        font-size: 1.875rem;
        padding: 0.625rem 0.875rem;
        min-height: 44px;
        line-height: 1.4;
    }

    /* Accommodation cards */
    .accommodation-card {
        min-height: 9rem;
        margin-bottom: 1rem;
    }

        .accommodation-card h5 {
            font-size: 1rem;
            margin-left: 0.75rem;
        }

    .accommodation-icon {
        width: 36px;
        height: 36px;
    }

    /* Role cards */
    .role-card {
        min-height: 80px;
        margin-bottom: 1rem;
    }

        .role-card h5 {
            font-size: 1rem;
        }

    /* Form cards */
    .form-card-header {
        padding: 1rem;
    }

        .form-card-header h2 {
            font-size: 1.4rem !important;
        }

        .form-card-header h3 {
            font-size: 1.2rem !important;
        }

    .form-card-body {
        padding: 1rem;
    }

    /* Alerts */
    .alert {
        padding: 0.75rem;
        font-size: 0.95rem;
    }

    .alert-heading {
        font-size: 1.1rem;
    }

    /* Contact form elements */
    .contact-name, .contact-email {
        width: 100%;
    }

        .contact-name input, .contact-email input {
            font-size: 0.95rem;
        }

    .contact-message textarea {
        font-size: 0.95rem;
        height: 200px;
    }

    .send-btn {
        font-size: 0.95rem;
        padding: 0.625rem 1rem;
    }

    .yellow-background:before {
        clip-path: none;
    }

    .yellow-background {
        height: auto;
    }
}

/* ===== Small Mobile Devices ===== */
@media screen and (max-width: 576px) {
    /* Fix body overflow and width issues */
    html, body {
        overflow-x: hidden;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    body {
        position: relative;
        margin-bottom: 0px !important;
    }

    /* Header - extra compact with centered layout */
    .header-content {
        padding: 0.5rem 0 !important;
    }

    .header-content .row {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    /* Logo - centered and properly sized */
    .header-content .col-lg-4.col-md-5.col-6 {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
        text-align: center;
        margin-bottom: 0.25rem;
        margin-top: 0 !important;
    }

    .my-logo {
        max-width: 160px !important;
        height: auto;
        display: inline-block;
    }

    /* Login area - centered below logo */
    .icons {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
        padding: 0;
        margin-top: 0 !important;
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;
    }

    .login-buttons {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        line-height: 1.2;
        flex-wrap: nowrap;
    }

    .login-link {
        font-size: 0.75rem;
        padding-top: 0.2rem;
        padding-bottom: 2px;
        padding-left: 0;
        padding-right: 0;
        min-height: auto !important;
        border-bottom: 1px solid white;
        white-space: nowrap;
        display: inline-block !important;
        line-height: 1.2;
        vertical-align: baseline;
        align-items: initial !important;
    }
    
    .login-link.user-name {
        cursor: default;
    }

    .login-delimiter {
        display: inline-block;
        font-size: 0.85rem;
        margin: 0 0.2rem;
        opacity: 0.7;
    }

    /* Compact header for very small screens */
    .header-content .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .container-fluid, .container {
        overflow-x: hidden;
    }

    /* Yellow background sticky header for small screens */
    .yellow-background {
        position: sticky;
        top: 0;
        z-index: 1000;
        width: 100%;
        left: 0;
        right: 0;
        margin-left: 0;
        margin-right: 0;
        overflow-x: hidden;
    }
    
    .yellow-background .header-content .container {
        max-width: 100%;
    }

    /* Main container */
    .main-container {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    /* Page titles */
    h1, h4.page-title, h2.page-title {
        font-size: 1.3rem;
        line-height: 1.3;
    }

    main p {
        font-size: 0.95rem;
    }
    
    #programs {
        width: inherit;
    }
    /* Summary cards - ultra compact */
    .summary-card-header {
        padding: 0.625rem 0.75rem;
        font-size: 0.95rem;
    }

    .summary-card-body {
        padding: 0.75rem;
    }

        .summary-card-body p {
            font-size: 0.875rem;
        }

        .summary-card-body strong {
            font-size: 0.875rem;
        }

    /* Program boxes - compact mobile (inherits from 768px, with smaller adjustments) */
    .program-box {
        margin-bottom: 120px;
        padding: 1.5rem 0.5rem;
    }

    .program-text {
        padding: 0 10px !important;
    }

        .program-text h2 {
            font-size: 1.25rem;
            margin-bottom: 15px;
        }

        .program-text h4 {
            font-size: 1rem;
        }

        .program-text h6 {
            font-size: 0.875rem;
        }

        .program-text p {
            font-size: 0.875rem;
        }

    .program-info .shape {
        max-width: 240px;
        top: -80px !important;
    }

        .program-info .shape .shape-in {
            padding: 1.5rem 0.5rem;
        }

    .mt-60 {
        margin-top: 30px;
    }

    .yellow-background:before {
        clip-path: none !important;
        height: auto !important;
    }
    /* Dev banner */
    .dev-banner {
        font-size: 0.75rem;
        padding: 0.4rem;
    }

    /* Forms */
    .form-group label, .form-card-body label {
        font-size: 0.95rem;
    }

    .form-control {
        font-size: 0.875rem;
        padding: 0.5rem;
    }

    /* Buttons */
    .btn-primary, .btn-secondary, .btn-success {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .solid-btn {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
        margin-left: 5px;
        margin-right: 5px;
    }

    /* Accommodation cards */
    .accommodation-card {
        min-height: 8rem;
    }

        .accommodation-card h5 {
            font-size: 0.95rem;
            margin-left: 0.5rem;
        }

        .accommodation-card .fs-5 {
            font-size: 1rem !important;
        }

    .accommodation-icon {
        width: 32px;
        height: 32px;
    }

    /* Role cards */
    .role-card {
        min-height: 70px;
    }

        .role-card h5 {
            font-size: 0.95rem;
        }

    /* Form cards */
    .form-card-header {
        padding: 0.75rem;
    }

        .form-card-header h2 {
            font-size: 1.2rem !important;
        }

        .form-card-header h3 {
            font-size: 1.1rem !important;
        }

    .form-card-body {
        padding: 0.75rem;
    }

    /* Alerts */
    .alert {
        padding: 0.625rem;
        font-size: 0.875rem;
    }

    .alert-heading {
        font-size: 1rem;
    }

    /* Contact form */
    .contact-message textarea {
        height: 180px;
    }
}

/* ===== Extra Small Devices ===== */
@media screen and (max-width: 400px) {
    /* Ultra compact for very small screens */
    h1, h4.page-title, h2.page-title {
        font-size: 1.15rem;
    }

    .program-text h2 {
        font-size: 1.1rem;
    }

    .program-text h4 {
        font-size: 0.95rem;
    }

    .program-info .shape {
        max-width: 200px;
    }
}

/* ===== Landscape Orientation Adjustments ===== */
@media screen and (max-height: 600px) and (orientation: landscape) {
    /* Reduce vertical spacing for landscape mode */
    .header-content {
        padding: 0.2rem 0 !important;
    }

        .header-content .row {
            padding-top: 0.2rem !important;
            padding-bottom: 0.2rem !important;
        }

    /* Make header sticky in landscape to save space */
    .yellow-background {
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    /* Compact logo in landscape */
    .my-logo {
        max-width: 150px !important;
    }

    /* Compact login area */
    .login-buttons {
        gap: 0.35rem;
    }

    .login-link {
        font-size: 0.75rem;
        line-height: 1.2;
    }

    main {
        padding-bottom: 5rem !important;
        margin-bottom: 4rem !important;
        padding-top: 1rem !important;
    }

    .program-box {
        margin-bottom: 2rem;
        padding: 1rem;
    }

    .program-text {
        padding: 0.5rem !important;
    }

    .dev-banner {
        padding: 0.3rem;
        font-size: 0.7rem;
    }
}

/* ===== Print Styles ===== */
@media print {
    /* Hide navigation and non-essential elements */
    header, .dev-banner {
        display: none;
    }

    .main-container {
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Expand all content for printing */
    .summary-card {
        page-break-inside: avoid;
        border: 2px solid #0bd0b8 !important;
    }

    /* Ensure good contrast for printing */
    body {
        color: #000;
        background: #fff;
    }
}
