/* Mobile First Responsive Design */

/* Extra small devices (phones, 600px and down) */
@media only screen and (max-width: 600px) {
    .hero h2 {
        font-size: 1.8rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .btn-primary, .btn-secondary {
        display: block;
        width: 100%;
        margin: 10px 0;
        text-align: center;
    }
    
    .filter-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .application-info {
        margin-top: 2rem;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
    }
}

/* Small devices (portrait tablets and large phones, 600px and up) */
@media only screen and (min-width: 600px) {
    .department-grid,
    .courses-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Medium devices (landscape tablets, 768px and up) */
@media only screen and (min-width: 768px) {
    .nav-menu {
        display: flex !important;
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding: 0;
        flex-direction: row;
    }
    
    .nav-toggle {
        display: none;
    }
    
    .department-grid,
    .courses-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Large devices (laptops/desktops, 992px and up) */
@media only screen and (min-width: 992px) {
    .department-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .courses-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .application-container {
        grid-template-columns: 2fr 1fr;
    }
    
    .dashboard-container {
        grid-template-columns: 250px 1fr;
    }
}

/* Extra large devices (large laptops and desktops, 1200px and up) */
@media only screen and (min-width: 1200px) {
    .container {
        max-width: 1200px;
    }
    
    .courses-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Print Styles */
@media print {
    .navbar,
    .footer,
    .btn-primary,
    .btn-secondary {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    .container {
        width: 100%;
        max-width: 100%;
        padding: 0;
    }
    
    .application-form {
        width: 100%;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #000000;
        --secondary-color: #0000ff;
        --accent-color: #ff0000;
    }
    
    .btn-primary,
    .btn-secondary {
        border: 2px solid currentColor;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --light-color: #2c3e50;
        --dark-color: #ecf0f1;
        --primary-color: #34495e;
    }
    
    body {
        background-color: #1a1a1a;
        color: #ffffff;
    }
    
    .navbar,
    .department-card,
    .course-card,
    .application-info,
    .dashboard-content,
    .dashboard-sidebar {
        background-color: #2c3e50;
        color: #ffffff;
    }
    
    input,
    select,
    textarea {
        background-color: #34495e;
        color: #ffffff;
        border-color: #4a6572;
    }
    
    input::placeholder {
        color: #bdc3c7;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn-primary,
    .btn-secondary,
    .filter-btn,
    .dashboard-sidebar a {
        padding: 1rem 1.5rem;
        min-height: 44px; /* Minimum touch target size */
    }
    
    .form-group input,
    .form-group select {
        padding: 1rem;
        font-size: 16px; /* Prevents iOS zoom on focus */
    }
}

/* Landscape orientation on mobile */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        padding: 80px 0 40px;
    }
    
    .dashboard {
        padding: 80px 0 40px;
    }
    
    .application {
        padding: 80px 0 40px;
    }
}