/* Responsive Design - Mobile First Approach */

/* Base styles are already mobile-friendly in main.css */

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
    .container {
        padding: 0 var(--spacing-lg);
    }

    .hero-title {
        font-size: var(--font-size-4xl);
    }

    .hero-subtitle {
        font-size: var(--font-size-lg);
    }

    .hero-actions {
        flex-direction: row;
    }

    .subscription-form .form-group {
        flex-direction: row;
        align-items: stretch;
    }

    .subscription-form input {
        border-radius: var(--border-radius) 0 0 var(--border-radius);
    }

    .subscription-form button {
        border-radius: 0 var(--border-radius) var(--border-radius) 0;
        border-left: none;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    /* Navigation */
    .mobile-menu-toggle {
        display: none;
    }

    .nav-menu {
        display: flex;
    }

    /* Hero section */
    .hero-title {
        font-size: var(--font-size-5xl);
    }

    .hero-subtitle {
        font-size: var(--font-size-xl);
    }

    /* Grid layouts */
    .events-grid,
    .courses-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Subscription section */
    .subscription-content {
        grid-template-columns: 1fr 1fr;
        align-items: center;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Cards */
    .card-content {
        padding: var(--spacing-xl);
    }

    /* Blog filters */
    .blog-filters {
        justify-content: center;
    }

    /* Form improvements */
    .form-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-lg);
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    /* Container */
    .container {
        padding: 0 var(--spacing-xl);
    }

    /* Navigation */
    .navbar .container {
        padding: var(--spacing-lg) var(--spacing-xl);
    }

    /* Grid layouts */
    .events-grid,
    .courses-grid,
    .blog-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Footer */
    .footer-content {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Hero section */
    .hero-content {
        padding: var(--spacing-3xl) 0;
    }

    /* Sections */
    .section {
        padding: 5rem 0;
    }

    /* Cards hover effects */
    .card:hover {
        transform: translateY(-8px);
    }

    /* Enhanced spacing */
    .section-header {
        margin-bottom: 4rem;
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    /* Hero section */
    .hero-title {
        font-size: 4rem;
    }

    .hero-subtitle {
        font-size: 1.5rem;
    }

    /* Grid layouts - 4 columns for larger screens */
    .blog-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Enhanced card spacing */
    .events-grid,
    .courses-grid,
    .blog-grid {
        gap: var(--spacing-2xl);
    }
}

/* Mobile-specific styles (max-width: 767px) */
@media (max-width: 767px) {
    /* Navigation */
    .nav-menu {
        display: none;
        position: fixed;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--bg-dark);
        border-top: 1px solid var(--border-color);
        flex-direction: column;
        padding: var(--spacing-lg);
        gap: var(--spacing-md);
        z-index: 999;
        transform: translateY(-100%);
        transition: transform 0.3s ease;
    }

    .nav-menu.show {
        display: flex;
        transform: translateY(0);
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    /* Hero section */
    .hero-section {
        min-height: 100vh;
        align-items: center;
        padding: var(--spacing-xl) 0;
    }

    .hero-content {
        padding: var(--spacing-xl) 0;
        margin-bottom: 0;
        max-width: 100%;
    }

    .hero-title {
        font-size: var(--font-size-2xl);
        line-height: 1.2;
        margin-bottom: var(--spacing-md);
    }

    .hero-subtitle {
        font-size: var(--font-size-base);
        white-space: normal;
        margin-bottom: var(--spacing-xl);
        line-height: 1.4;
    }

    .hero-actions {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .hero-actions .btn {
        width: 100%;
        justify-content: center;
        padding: var(--spacing-md) var(--spacing-lg);
        font-size: var(--font-size-base);
    }

    /* Sections */
    .section {
        padding: var(--spacing-2xl) 0;
    }

    .section-header {
        margin-bottom: var(--spacing-2xl);
        text-align: center;
    }

    .section-title {
        font-size: var(--font-size-2xl);
    }

    /* Grid layouts */
    .events-grid,
    .courses-grid,
    .blog-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    /* About section - Stack content vertically on mobile */
    .about-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
        min-height: auto;
    }

    /* Ensure text comes first, then image */
    .about-text {
        order: 1;
    }

    .about-image {
        order: 2;
    }

    /* Cards */
    .card {
        margin-bottom: var(--spacing-lg);
    }

    /* Subscription */
    .subscription-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
        text-align: center;
    }

    .subscription-form .form-group {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .subscription-form input,
    .subscription-form button {
        width: 100%;
        border-radius: var(--border-radius);
    }

    /* Blog filters */
    .blog-filters {
        flex-wrap: wrap;
        gap: var(--spacing-sm);
    }

    .filter-btn {
        flex: 1;
        min-width: calc(50% - var(--spacing-sm) / 2);
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
        text-align: center;
    }

    /* Typography adjustments */
    h1 { font-size: var(--font-size-3xl); }
    h2 { font-size: var(--font-size-2xl); }
    h3 { font-size: var(--font-size-xl); }
    h4 { font-size: var(--font-size-lg); }

    /* Form adjustments */
    .form-row {
        grid-template-columns: 1fr;
    }

    /* Button adjustments */
    .btn {
        padding: var(--spacing-md) var(--spacing-lg);
        font-size: var(--font-size-base);
    }
}

/* Small mobile devices (max-width: 480px) */
@media (max-width: 480px) {
    /* Container */
    .container {
        padding: 0 var(--spacing-sm);
    }

    /* Navigation */
    .navbar .container {
        padding: var(--spacing-sm);
    }

    .brand-text {
        font-size: var(--font-size-lg);
    }

    .logo {
        height: 32px;
    }

    /* Hero section */
    .hero-section {
        min-height: 100vh;
        padding: var(--spacing-lg) 0;
    }

    .hero-content {
        padding: var(--spacing-lg) 0;
        margin-bottom: 0;
    }

    .hero-title {
        font-size: var(--font-size-xl);
        line-height: 1.2;
        margin-bottom: var(--spacing-sm);
    }

    .hero-subtitle {
        font-size: var(--font-size-sm);
        line-height: 1.3;
        margin-bottom: var(--spacing-lg);
    }

    .hero-actions {
        gap: var(--spacing-sm);
    }

    .hero-actions .btn {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: var(--font-size-sm);
    }

    /* Sections */
    .section {
        padding: var(--spacing-xl) 0;
    }

    .section-title {
        font-size: var(--font-size-xl);
    }

    /* Cards */
    .card-content {
        padding: var(--spacing-md);
    }

    .card-title {
        font-size: var(--font-size-lg);
    }

    /* Blog filters */
    .filter-btn {
        min-width: 100%;
        margin-bottom: var(--spacing-xs);
    }

    /* Footer */
    .footer {
        padding: var(--spacing-2xl) 0 var(--spacing-md);
    }

    /* Typography */
    .section-subtitle {
        font-size: var(--font-size-base);
    }
}

/* Landscape orientation adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        min-height: 100vh;
        padding: var(--spacing-lg) 0;
    }

    .hero-content {
        padding: var(--spacing-lg) 0;
    }

    .hero-title {
        font-size: var(--font-size-2xl);
        margin-bottom: var(--spacing-sm);
    }

    .hero-subtitle {
        font-size: var(--font-size-base);
        margin-bottom: var(--spacing-lg);
    }

    .hero-actions {
        gap: var(--spacing-sm);
    }
}

/* Print styles */
@media print {
    .navbar,
    .hero-actions,
    .blog-filters,
    .subscription-form,
    .footer,
    .btn {
        display: none !important;
    }

    .hero-section {
        min-height: auto;
        padding: var(--spacing-lg) 0;
    }

    .section {
        padding: var(--spacing-lg) 0;
        break-inside: avoid;
    }

    .card {
        break-inside: avoid;
        margin-bottom: var(--spacing-lg);
    }

    body {
        font-size: 12pt;
        line-height: 1.4;
    }

    h1, h2, h3, h4, h5, h6 {
        break-after: avoid;
    }

    .container {
        max-width: none;
        padding: 0;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #000000;
        --secondary-color: #000000;
        --text-primary: #000000;
        --text-secondary: #000000;
        --bg-primary: #ffffff;
        --bg-secondary: #ffffff;
        --border-color: #000000;
    }

    .btn-primary {
        background-color: #000000;
        border-color: #000000;
        color: #ffffff;
    }

    .btn-secondary {
        background-color: #ffffff;
        border-color: #000000;
        color: #000000;
    }

    .card {
        border: 2px solid #000000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .hero-title,
    .hero-subtitle,
    .hero-actions {
        animation: none;
    }
}

/* Dark mode support (if implemented) */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #4a90e2;
        --secondary-color: #f39c12;
        --text-primary: #ffffff;
        --text-secondary: #b0b0b0;
        --text-light: #888888;
        --bg-primary: #1a1a1a;
        --bg-secondary: #2a2a2a;
        --bg-dark: #000000;
        --border-color: #404040;
        --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.3);
        --shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.4);
        --shadow-heavy: 0 8px 30px rgba(0, 0, 0, 0.5);
    }

    .navbar {
        background-color: rgba(26, 26, 26, 0.95);
    }

    .card {
        background-color: var(--bg-secondary);
    }

    .hero-overlay {
        background: linear-gradient(135deg, rgba(26, 26, 26, 0.8), rgba(42, 42, 42, 0.6));
    }
}

/* Focus styles for accessibility */
@media (any-hover: none) {
    .btn:hover {
        transform: none;
        box-shadow: var(--shadow-light);
    }

    .card:hover {
        transform: none;
        box-shadow: var(--shadow-light);
    }

    .nav-link:hover::after {
        width: 0;
    }
}

/* Touch device optimizations */
@media (any-pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }

    .nav-link {
        padding: var(--spacing-md) var(--spacing-sm);
    }

    .filter-btn {
        min-height: 44px;
    }

    .lang-toggle {
        min-height: 44px;
        min-width: 44px;
    }

    .mobile-menu-toggle {
        min-height: 44px;
        min-width: 44px;
    }
} 