/* ================================================
   BTRC - Bamenda Technological Research Center
   Responsive Stylesheet
   ================================================ */

/* ================================================
   LARGE DESKTOP (1400px+)
   ================================================ */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .hero h1 {
        font-size: 3.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ================================================
   DESKTOP (1200px - 1399px)
   ================================================ */
@media (max-width: 1199px) {
    :root {
        --spacing-3xl: 5rem;
    }
    
    .hero .container {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-xl);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .about-grid,
    .founder-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
    
    .about-image,
    .founder-image {
        max-width: 500px;
        margin: 0 auto;
    }
    
    .project-slide-inner {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .project-slide-image {
        order: -1;
    }
}

/* ================================================
   TABLET (992px - 1199px)
   ================================================ */
@media (max-width: 991px) {
    :root {
        --spacing-3xl: 4rem;
        --spacing-2xl: 3rem;
    }
    
    /* Navigation */
    .navbar-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--secondary);
        flex-direction: column;
        justify-content: flex-start;
        padding: var(--spacing-2xl) var(--spacing-lg);
        box-shadow: var(--shadow-xl);
        transition: right 0.3s ease;
        z-index: 1001;
    }
    
    .navbar-menu.active {
        right: 0;
    }
    
    .navbar-menu a {
        font-size: 1rem;
        padding: var(--spacing-sm) 0;
    }
    
    .navbar-toggle {
        display: flex;
        z-index: 1002;
    }
    
    .navbar-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .navbar-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .navbar-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
    
    /* Hero */
    .hero {
        min-height: auto;
        padding: calc(80px + var(--spacing-3xl)) 0 var(--spacing-2xl);
    }
    
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-content {
        order: 2;
    }
    
    .hero-image {
        order: 1;
        max-width: 500px;
        margin: 0 auto;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Research Grid */
    .research-grid,
    .research-category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Programs Grid */
    .programs-grid,
    .programs-detail-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* News Grid */
    .news-grid,
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-xl);
    }
    
    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
    
    /* Dashboard */
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Progress Grid */
    .progress-grid {
        grid-template-columns: 1fr;
    }
    
    /* Timeline */
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item {
        width: 100%;
        padding-left: 50px !important;
        padding-right: 0 !important;
        text-align: left !important;
        margin-left: 0 !important;
    }
    
    .timeline-dot {
        left: 12px !important;
        right: auto !important;
    }
}

/* ================================================
   MOBILE (768px - 991px)
   ================================================ */
@media (max-width: 767px) {
    :root {
        --spacing-3xl: 3.5rem;
        --spacing-2xl: 2.5rem;
        --spacing-xl: 2rem;
    }
    
    /* Typography */
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    /* Hero */
    .hero-subtitle {
        font-size: 0.8rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero-tagline {
        font-size: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-md);
    }
    
    .stat-item {
        padding: var(--spacing-sm);
    }
    
    .stat-number {
        font-size: 1.75rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    /* Research Grid */
    .research-grid,
    .research-category-grid {
        grid-template-columns: 1fr;
    }
    
    /* Programs Grid */
    .programs-grid,
    .programs-detail-grid {
        grid-template-columns: 1fr;
    }
    
    /* News Grid */
    .news-grid,
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    /* Projects Grid */
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    /* Filter Buttons */
    .filter-buttons {
        gap: var(--spacing-xs);
    }
    
    .filter-btn {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.8rem;
    }
    
    /* Dashboard */
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-md);
    }
    
    .dashboard-card {
        padding: var(--spacing-md);
    }
    
    .dashboard-card h3 {
        font-size: 1.5rem;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-brand {
        max-width: 100%;
    }
    
    .footer-logo {
        justify-content: center;
    }
    
    .footer-social {
        justify-content: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    
    /* About Page */
    .mv-grid {
        grid-template-columns: 1fr;
    }
    
    /* Founder */
    .founder-qualifications {
        justify-content: center;
    }
    
    /* Section Headers */
    .section-header p {
        font-size: 1rem;
    }
    
    /* Pagination */
    .pagination {
        flex-wrap: wrap;
    }
    
    /* Forms */
    .newsletter-form {
        flex-direction: column;
    }
    
    .newsletter-form button {
        width: 100%;
    }
    
    /* Map */
    .map-placeholder {
        min-height: 250px;
    }
}

/* ================================================
   SMALL MOBILE (576px - 767px)
   ================================================ */
@media (max-width: 575px) {
    :root {
        --container-padding: 1rem;
        --spacing-3xl: 3rem;
        --spacing-2xl: 2rem;
    }
    
    /* Typography */
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    /* Container */
    .container {
        padding: 0 var(--container-padding);
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
    
    /* Buttons */
    .btn {
        padding: var(--spacing-xs) var(--spacing-md);
        font-size: 0.9rem;
    }
    
    /* Cards */
    .research-card,
    .program-card,
    .news-card,
    .project-card,
    .post-card {
        padding: var(--spacing-md);
    }
    
    /* Dashboard */
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    /* Footer */
    .footer {
        padding: var(--spacing-2xl) 0 var(--spacing-md);
    }
    
    /* Contact */
    .contact-info,
    .contact-form-wrapper {
        padding: var(--spacing-lg);
    }
    
    /* Form */
    .form-group input,
    .form-group textarea {
        padding: var(--spacing-xs) var(--spacing-sm);
    }
    
    /* Slider */
    .slider-arrow {
        width: 40px;
        height: 40px;
    }
    
    .slider-arrow.prev {
        left: var(--spacing-xs);
    }
    
    .slider-arrow.next {
        right: var(--spacing-xs);
    }
    
    /* Breadcrumb */
    .breadcrumb {
        font-size: 0.8rem;
        flex-wrap: wrap;
    }
}

/* ================================================
   EXTRA SMALL MOBILE (320px - 479px)
   ================================================ */
@media (max-width: 479px) {
    :root {
        --spacing-3xl: 2.5rem;
        --spacing-2xl: 2rem;
        --spacing-xl: 1.5rem;
    }
    
    /* Typography */
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    /* Hero */
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .hero-tagline {
        font-size: 0.9rem;
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    /* Dashboard */
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    /* Section Header */
    .section-header h2::after {
        width: 40px;
        height: 2px;
    }
    
    /* Buttons */
    .hero-buttons {
        gap: var(--spacing-xs);
    }
    
    /* Cards */
    .research-card,
    .program-card,
    .news-card,
    .project-card,
    .post-card,
    .program-detail-card {
        padding: var(--spacing-sm);
    }
    
    /* Program Features */
    .program-features li {
        font-size: 0.85rem;
    }
    
    /* Contact Details */
    .contact-item {
        flex-direction: column;
        text-align: center;
    }
    
    .contact-icon {
        margin: 0 auto;
    }
    
    /* Pagination */
    .pagination-btn {
        width: 35px;
        height: 35px;
        font-size: 0.85rem;
    }
    
    /* Form Success */
    .form-success {
        padding: var(--spacing-sm);
        font-size: 0.9rem;
    }
}

/* ================================================
   LANDSCAPE ORIENTATION ADJUSTMENTS
   ================================================ */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: calc(60px + var(--spacing-xl)) 0 var(--spacing-lg);
    }
    
    .hero .container {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-lg);
    }
    
    .hero-image {
        max-width: 300px;
    }
}

/* ================================================
   HIGH RESOLUTION DISPLAYS
   ================================================ */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Increase border weights forRetina displays */
    .btn {
        border-width: 1px;
    }
    
    .filter-btn {
        border-width: 1px;
    }
    
    .form-group input,
    .form-group textarea {
        border-width: 1px;
    }
}

/* ================================================
   PRINT STYLES
   ================================================ */
@media print {
    .navbar,
    .hero-buttons,
    .slider-nav,
    .pagination,
    .footer-social,
    .newsletter-form {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .section {
        padding: 1rem 0;
    }
    
    a {
        text-decoration: underline;
    }
    
    .card-hover:hover {
        transform: none;
        box-shadow: none;
    }
}

/* ================================================
   ACCESSIBILITY - FOCUS STYLES
   ================================================ */
@media (focus: visible) {
    a:focus,
    button:focus,
    input:focus,
    textarea:focus,
    .filter-btn:focus {
        outline: 2px solid var(--accent);
        outline-offset: 2px;
    }
}

/* ================================================
   PREFERS COLOR SCHEME
   ================================================ */
@media (prefers-color-scheme: dark) {
    :root {
        /* Dark mode colors (optional - can be enabled if needed) */
    }
}
