/**
 * Responsive Styles for Mobile Devices
 */

/* Mobile First Approach */
@media (max-width: 767px) {
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }

    .container {
        padding: 10px;
    }

    .notice-marquee {
        padding: 8px 0;
    }

    .notice-marquee marquee {
        font-size: 14px;
    }

    .card {
        margin-bottom: 15px;
    }

    .card-header h4 {
        font-size: 1.1rem;
    }

    .nav-tabs {
        flex-wrap: wrap;
    }

    .nav-tabs .nav-link {
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    #formTabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    #formTabs .nav-item {
        flex: 0 0 auto;
    }

    .table {
        font-size: 12px;
    }

    .table thead th,
    .table tbody td {
        padding: 8px 4px;
    }

    .btn {
        padding: 8px 16px;
        font-size: 0.9rem;
        white-space: normal;
    }

    .btn-lg {
        padding: 10px 20px;
        font-size: 1rem;
    }

    .upload-area {
        padding: 20px;
        min-height: 150px;
    }

    .portal-footer {
        font-size: 12px;
        padding: 10px 0;
    }

    .portal-footer .row > div {
        text-align: center !important;
        margin-bottom: 5px;
    }

    .form-control,
    .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Stack form elements */
    .row > [class*="col-"] {
        margin-bottom: 15px;
    }

    .card-header h2,
    .card-header h3,
    .card-header h4,
    .card-header h5,
    .card-header h6 {
        word-break: break-word;
    }

    .form-top-actions .btn {
        width: 100%;
    }

    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }

    /* Hide less important elements on mobile */
    .text-muted.small {
        font-size: 0.75rem;
    }
}

/* Tablet Styles */
@media (min-width: 768px) and (max-width: 1199px) {
    .container {
        max-width: 95%;
    }

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

    .nav-tabs .nav-link {
        padding: 10px 16px;
        font-size: 0.95rem;
    }

    .table {
        font-size: 13px;
    }

    .form-top-actions .btn {
        white-space: nowrap;
    }
}

/* Desktop Styles */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* Touch-friendly buttons on mobile */
@media (max-width: 767px) {
    .btn {
        min-height: 44px;
    }

    .form-check-input {
        width: 1.15em;
        height: 1.15em;
        min-height: auto;
        min-width: auto;
    }

    .form-check-label {
        padding-left: 10px;
        line-height: 1.5;
    }

    /* Help page tabs — scroll on small screens */
    #helpTabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #helpTabs .nav-link {
        font-size: 0.82rem;
        padding: 0.5rem 0.65rem;
        white-space: nowrap;
    }

    /* Form sidebar hidden on mobile (top tabs used instead) */
    .sidebar-nav {
        display: none;
    }

    #sendOTP,
    #verifyOTP {
        width: 100%;
    }

    #otp_input {
        margin-top: 0.35rem;
    }
}

/* Landscape mobile orientation */
@media (max-width: 767px) and (orientation: landscape) {
    .portal-header {
        padding: 5px 0;
    }

    .header-image {
        height: 40px;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .header-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Registration DOB — always DD/MM/YYYY display */
#dob_display {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.03em;
}

#dob_display::placeholder {
    color: #6c757d;
    opacity: 1;
}
