/* Responsive CSS - Mobile and tablet optimizations */

/* Extra small devices (phones, less than 576px) */
@media (max-width: 575.98px) {
    /* Navigation */
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 0;
        border-bottom: 1px solid #f8f9fa;
    }
    
    .navbar-nav .nav-link:last-child {
        border-bottom: none;
    }
    
    /* Hero Section */
    .hero-section .display-4 {
        font-size: 2rem;
        line-height: 1.3;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
    
    .hero-section .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    /* Partner Universities */
    .partner-universities .col-6 {
        margin-bottom: 1rem;
    }
    
    .university-logo {
        max-height: 60px;
        max-width: 120px;
    }
    
    /* Sample Questions */
    .sample-questions .card {
        min-height: auto;
    }
    
    .sample-questions .row {
        flex-direction: column;
    }
    
    .question-options .option-item {
        font-size: 0.9rem;
        padding: 0.75rem;
    }
    
    /* Test Dates */
    .test-dates .col-md-6 {
        margin-bottom: 1rem;
    }
    
    /* FAQ */
    .accordion .btn-link {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }
    
    /* Registration Form */
    .registration-section .card-header {
        padding: 1rem;
    }
    
    .registration-section .card-body {
        padding: 1rem;
    }
    
    .form-section {
        margin-bottom: 1.5rem;
    }
    
    .section-title {
        font-size: 1.1rem;
    }
    
    /* Form controls */
    .form-control {
        padding: 0.75rem;
        font-size: 1rem;
    }
    
    .form-check-label {
        font-size: 0.9rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    /* Spacing adjustments */
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    .mb-5 {
        margin-bottom: 2rem !important;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    /* Hero Section */
    .hero-section .display-4 {
        font-size: 2.5rem;
    }
    
    /* Registration Form */
    .registration-section .card-body {
        padding: 1.5rem;
    }
    
    /* University logos */
    .university-logo {
        max-height: 70px;
        max-width: 140px;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* Hero Section */
    .hero-section .display-4 {
        font-size: 3rem;
    }
    
    /* Sample Questions */
    .sample-questions .card {
        min-height: 450px;
    }
    
    /* Test Dates Grid */
    .test-dates .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    /* University logos */
    .university-logo {
        max-height: 75px;
        max-width: 145px;
    }
    
    /* Registration Form */
    .registration-section .col-lg-8 {
        flex: 0 0 90%;
        max-width: 90%;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    /* Hero Section */
    .hero-section .display-4 {
        font-size: 3.5rem;
    }
    
    /* Test Dates Grid */
    .test-dates .col-lg-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    /* Container max-widths */
    .container {
        max-width: 1140px;
    }
    
    /* Hero Section */
    .hero-section .display-4 {
        font-size: 4rem;
    }
    
    /* Registration Form */
    .registration-section .col-lg-8 {
        flex: 0 0 66.666667%;
        max-width: 66.666667%;
    }
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 600px) {
    .hero-section {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    
    .hero-section .display-4 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .hero-section .lead {
        margin-bottom: 1.5rem;
    }
}

/* Print styles */
@media print {
    .navbar,
    .carousel-control-prev,
    .carousel-control-next,
    .btn,
    footer {
        display: none !important;
    }
    
    .container {
        max-width: none;
        width: 100%;
        padding: 0;
    }
    
    .card {
        border: 1px solid #ddd;
        box-shadow: none;
        page-break-inside: avoid;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
    
    .hero-section {
        background: white !important;
        color: black !important;
    }
    
    .bg-primary {
        background: white !important;
        color: black !important;
    }
}

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

/* Accessibility - Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .carousel {
        transition: none;
    }
    
    .carousel-item {
        transition: none;
    }
    
    .card:hover {
        transform: none;
    }
    
    .university-logo:hover {
        transform: none;
    }
    
    #submitBtn:hover {
        transform: none;
    }
}

/* Dark mode support (if needed in future) */
@media (prefers-color-scheme: dark) {
    /* This can be uncommented if dark mode is needed */
    /*
    body {
        background-color: #1a1a1a;
        color: #f8f9fa;
    }
    
    .card {
        background-color: #2d2d2d;
        border-color: #444;
    }
    
    .form-control {
        background-color: #2d2d2d;
        border-color: #444;
        color: #f8f9fa;
    }
    */
}

/* Touch device optimizations */
@media (pointer: coarse) {
    /* Larger touch targets */
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .form-check-input {
        width: 1.25rem;
        height: 1.25rem;
    }
    
    .navbar-toggler {
        padding: 0.5rem;
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Larger form controls for easier touch */
    .form-control {
        min-height: 44px;
        padding: 0.75rem;
    }
    
    /* Better spacing for touch */
    .form-check {
        margin-bottom: 1.25rem;
    }
    
    .question-options .option-item {
        min-height: 44px;
        padding: 0.75rem;
    }
}

/* Focus visible for keyboard navigation */
@supports selector(:focus-visible) {
    .btn:focus:not(:focus-visible),
    .form-control:focus:not(:focus-visible),
    .form-check-input:focus:not(:focus-visible) {
        box-shadow: none;
    }
    
    .btn:focus-visible,
    .form-control:focus-visible,
    .form-check-input:focus-visible {
        box-shadow: 0 0 0 0.2rem rgba(158, 30, 32, 0.25);
    }
}