/* ============================================
    GRADUATE TRACER - MOBILE RESPONSIVE STYLES
============================================
    This file contains all mobile-first responsive
    CSS optimizations for devices with screens
    <= 768px width (tablets and phones)

    Breakpoints:
    - 768px: Tablets and smaller screens
    - 576px: Mobile phones
    - 420px: Small phones (iPhone SE, etc.)

    Import this file AFTER graduatetracer.css
============================================ */

/* ============================================
    BODY & BASE LAYOUT (Mobile)
============================================ */

@media (max-width: 768px) {
    body {
        font-size: 16px; /* Prevent iOS zoom on input focus */
        line-height: 1.7;
    }
    
    /* Better viewport handling */
    html, body {
        width: 100%;
        overflow-x: hidden;
    }
    
    /* Ensure proper spacing */
    main {
        margin-top: 4rem !important;
        padding-top: 1rem !important;
    }
    
    .section.register {
        margin-top: 1rem;
        padding: 1.5rem 0.75rem;
    }
}

@media (max-width: 576px) {
    .section.register {
        padding: 1.75rem 1rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 0.75rem;
    }
}

@media (max-width: 768px) {
    .section {
        padding: 1.5rem 0;
        margin-top: 1.5rem;
    }
}

/* ============================================
    TYPOGRAPHY (Mobile)
============================================ */

@media (max-width: 576px) {
    body {
        line-height: 1.75;
    }

    h1 {
        font-size: 1.4rem;
        margin-bottom: 15px;
    }

    h2 {
        font-size: 1.2rem;
    }

    p {
        font-size: 1rem;
        line-height: 1.75;
    }
}

/* ============================================
    NOTICES & INFO BOXES (Mobile)
============================================ */

@media (max-width: 576px) {
    #notice,
    #notice-2 {
        padding: 15px 0;
        font-size: 1.2rem;
    }

    .notice-text {
        font-size: 0.95rem;
        line-height: 1.7;
        margin-bottom: 1rem;
    }

    .d-flex.p-3.border-start.border-4.border-warning.rounded {
        padding: 1rem !important;
        margin-bottom: 1rem;
        border-left-width: 4px !important;
    }
}

/* ============================================
    CONSENT SECTION (Mobile)
============================================ */

@media (max-width: 576px) {
    #consent-section input[type="checkbox"] {
        width: 1.3em;
        height: 1.3em;
        margin-right: 0.5rem;
    }

    #consent-section label {
        font-size: 0.95rem;
        line-height: 1.6;
    }
}

/* ============================================
    FORM CONTROLS (Mobile)
============================================ */

@media (max-width: 576px) {
    .form-control, .form-select {
        padding: 0.875rem 1rem !important;
        min-height: 48px;
        border-radius: 6px;
        margin-bottom: 0.75rem;
    }

    .form-group {
        margin-bottom: 1.5rem;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    label {
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
    }

    .text-wrap {
        hyphens: auto;
    }
}

@media (max-width: 768px) {
    .btn {
        min-height: 48px;
        font-size: 1.05rem;
        padding: 0.875rem 1.25rem;
    }
}

/* ============================================
    BUTTONS (Mobile)
============================================ */

@media (max-width: 576px) {
    .btn {
        width: 100%;
        min-height: 52px;
        font-size: 1.1rem;
        padding: 1rem;
        border-radius: 8px;
        margin-bottom: 0.75rem;
    }

    .btn-add-program {
        width: 100%;
        min-height: 56px;
        font-size: 1.1rem;
    }

    .btn-success {
        width: 100%;
        min-height: 56px;
        font-size: 1.1rem;
    }

    .btn-warning {
        width: auto;
    }
}

/* ============================================
    CARDS (Mobile)
============================================ */

@media (max-width: 576px) {
    .card {
        margin-bottom: 1.25rem;
        border-radius: 6px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    }
    
    .card-body {
        padding: 1.5rem !important;
    }

    .row.justify-content-center.card {
        padding: 1.5rem !important;
        margin: 1rem auto;
    }
}

/* ============================================
    AUTOCOMPLETE DROPDOWN (Mobile)
============================================ */

@media (max-width: 576px) {
    .company-autocomplete-wrapper {
        margin-bottom: 0.5rem;
    }

    .autocomplete-dropdown,
    .company-suggestions-dropdown {
        max-height: 200px;
        font-size: 1rem;
        border: 2px solid #0056b3;
    }

    .autocomplete-item,
    .company-suggestion-item {
        padding: 1rem;
        font-size: 1.05rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* ============================================
    SELECT DROPDOWNS (Mobile)
============================================ */

@media (max-width: 576px) {
    select,
    .form-select {
        font-size: 16px !important; /* Prevent iOS zoom */
        padding: 0.875rem 2.5rem 0.875rem 1rem;
        min-height: 48px;
        width: 100%;
    }
}

/* ============================================
    INPUT FIELDS (Mobile)
============================================ */

@media (max-width: 576px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="date"],
    input[type="number"],
    textarea,
    .form-control {
        font-size: 16px !important;
        padding: 1rem 0.875rem;
        min-height: 48px;
    }
    
    textarea {
        min-height: 120px;
    }

    label,
    .form-label,
    .form-group label {
        font-size: 1.05rem;
        font-weight: 600;
        margin-bottom: 0.75rem;
        color: #333;
    }

    .form-text,
    .invalid-feedback,
    .valid-feedback {
        font-size: 0.95rem;
    }
}

/* ============================================
    PROGRAM LIST ITEMS (Mobile)
============================================ */

@media (max-width: 576px) {
    .program-item,
    .program-list-item {
        padding: 1rem;
        font-size: 1rem;
    }
    
    .program-item button,
    .program-list-item button {
        min-height: 40px;
        padding: 0.5rem 0.75rem;
    }
}

/* ============================================
    CONTAINER & GRID (Mobile)
============================================ */

@media (max-width: 576px) {
    .container,
    .container-fluid {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
    
    .row {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }
    
    .col,
    [class*="col-"] {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* ============================================
    ALERT BOXES (Mobile)
============================================ */

@media (max-width: 576px) {
    .alert {
        padding: 1rem;
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .alert-danger {
        font-size: 1rem;
        border-left: 4px solid #dc3545;
    }
    
    .alert strong {
        display: block;
        margin-bottom: 0.5rem;
    }
}

/* ============================================
    BADGE (Mobile)
============================================ */

@media (max-width: 576px) {
    .badge {
        padding: 0.6rem 0.85rem;
        font-size: 1rem;
    }
    
    .badge.bg-primary {
        background-color: #0056b3 !important;
    }
}

/* ============================================
    DROPDOWN MENU (Mobile)
============================================ */

@media (max-width: 576px) {
    .dropdown-menu {
        width: 100vw;
        max-width: calc(100vw - 2rem);
        left: 1rem !important;
    }
}

/* ============================================
    SPACING UTILITIES (Mobile)
============================================ */

@media (max-width: 576px) {
    .mt-1, .my-1 { margin-top: 0.5rem !important; }
    .mt-2, .my-2 { margin-top: 0.75rem !important; }
    .mt-3, .my-3 { margin-top: 1rem !important; }
    .mt-4, .my-4 { margin-top: 1.25rem !important; }
    .mt-5, .my-5 { margin-top: 1.5rem !important; }
    
    .mb-1 { margin-bottom: 0.5rem !important; }
    .mb-2 { margin-bottom: 0.75rem !important; }
    .mb-3 { margin-bottom: 1rem !important; }
    .mb-4 { margin-bottom: 1.25rem !important; }
    .mb-5 { margin-bottom: 1.5rem !important; }
    
    .p-1 { padding: 0.5rem !important; }
    .p-2 { padding: 0.75rem !important; }
    .p-3 { padding: 1rem !important; }
    .p-4 { padding: 1.25rem !important; }
    .p-5 { padding: 1.5rem !important; }
}

/* ============================================
    TOUCH FEEDBACK & INTERACTION (Mobile)
============================================ */

@media (max-width: 576px) {
    /* Improve touch feedback on all interactive elements */
    button,
    .btn,
    a[href],
    input[type="button"],
    input[type="submit"],
    input[type="reset"] {
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Ensure tap areas are large enough */
    a, button, input[type="button"], input[type="submit"] {
        min-height: 44px;
    }
}

/* ============================================
    SMALL PHONES (420px and below)
============================================ */

@media (max-width: 420px) {
    body {
        font-size: 14px;
    }

    h1 {
        font-size: 1.3rem;
    }
    h2 {
        font-size: 1.1rem;
    }

    .btn {
        min-height: 48px;
        padding: 0.875rem;
    }

    .btn-add-program {
        min-height: 52px;
    }

    #scroll-container {
        padding: 1rem;
        max-height: 300px;
    }

    .row.justify-content-center.card {
        padding: 1rem !important;
        margin: 0.75rem auto;
    }

    .floating-help {
        padding: 10px 14px;
        font-size: 0.9rem;
        bottom: 12px;
        right: 12px;
    }
}

/* ============================================
    TABLET ADJUSTMENTS (768px and below)
============================================ */

@media (max-width: 768px) {
    .btn-add-program {
        min-height: 64px !important;
        font-size: 1.1rem !important;
        padding: 1rem !important;
    }
    
    .alert-danger {
        font-size: 0.95rem;
    }
}

/* ============================================
    PRINT STYLES
============================================ */

@media print {
    body {
        background: white;
    }

    .btn,
    button,
    [role="button"] {
        display: none;
    }

    .alert {
        page-break-inside: avoid;
    }
}
