/**
 * responsive.css - 반응형 스타일시트
 * 왕초보 영어배우기 (wang.soritune.com)
 *
 * Breakpoints:
 * - Mobile: < 576px
 * - Tablet: 576px - 768px
 * - Desktop Small: 768px - 992px
 * - Desktop: 992px - 1200px
 * - Desktop Large: > 1200px
 */

/* ==========================================================================
   Extra Large Screens (1400px+)
   ========================================================================== */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }

    .hero-title {
        font-size: 4rem;
    }
}

/* ==========================================================================
   Large Screens (1200px - 1399px)
   ========================================================================== */
@media (max-width: 1399px) {
    .container {
        max-width: 1140px;
    }

    .card-grid-4 {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer-grid {
        grid-template-columns: 1.5fr repeat(4, 1fr);
        gap: var(--space-xl);
    }
}

/* ==========================================================================
   Medium-Large Screens (992px - 1199px)
   ========================================================================== */
@media (max-width: 1199px) {
    :root {
        --header-height: 52px;
        --nav-height: 44px;
    }

    .container {
        max-width: 960px;
    }

    .search-bar {
        max-width: 400px;
    }

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

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

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

    .footer-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-xl);
    }

    .footer-brand {
        grid-column: 1 / -1;
        margin-bottom: var(--space-lg);
    }

    .word-bank {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .sentence-word {
        font-size: var(--font-size-2xl);
        padding: var(--space-md);
        min-width: 100px;
    }
}

/* ==========================================================================
   Tablet Landscape (768px - 991px)
   ========================================================================== */
@media (max-width: 991px) {
    :root {
        --header-height: 56px;
        --space-2xl: 2.5rem;
        --space-3xl: 3rem;
    }

    .container {
        max-width: 720px;
        padding: 0 var(--space-md);
    }

    /* Header */
    .search-bar {
        display: none;
    }

    .header-btn span {
        display: none;
    }

    .header-btn {
        width: 40px;
        height: 40px;
        padding: 0;
        justify-content: center;
    }

    .start-btn span {
        display: block;
    }

    .start-btn {
        width: auto;
        padding: var(--space-sm) var(--space-md);
    }

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

    /* Navigation */
    .main-nav {
        display: none;
    }

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

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

    .section-desc {
        font-size: var(--font-size-base);
    }

    /* Cards */
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }

    /* Page Header */
    .page-header {
        padding: var(--space-2xl) 0;
    }

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

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

    .footer-brand {
        grid-column: 1 / -1;
    }

    /* Sentence Builder */
    .sentence-builder {
        padding: var(--space-lg);
    }

    .sentence-display {
        flex-direction: column;
        gap: var(--space-md);
        padding: var(--space-lg);
    }

    .sentence-word {
        width: 100%;
        max-width: 200px;
    }

    /* Alphabet Grid */
    .alphabet-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: var(--space-sm);
    }

    .learning-card {
        padding: var(--space-lg);
    }

    .learning-card-letter {
        font-size: var(--font-size-4xl);
    }
}

/* ==========================================================================
   Tablet Portrait (576px - 767px)
   ========================================================================== */
@media (max-width: 767px) {
    :root {
        --font-size-5xl: 2.5rem;
        --font-size-4xl: 2rem;
        --font-size-3xl: 1.5rem;
        --font-size-2xl: 1.25rem;
    }

    .container {
        max-width: 540px;
    }

    /* Header */
    .logo-text {
        display: none;
    }

    .header-content {
        gap: var(--space-sm);
    }

    /* Cards */
    .card-grid,
    .card-grid-4,
    .card-grid-3,
    .card-grid-2 {
        grid-template-columns: 1fr;
    }

    .card-thumbnail {
        aspect-ratio: 16/9;
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }

    .stat-card {
        padding: var(--space-lg);
    }

    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: var(--font-size-xl);
    }

    .stat-number {
        font-size: var(--font-size-2xl);
    }

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

    .footer-social {
        justify-content: center;
    }

    .footer-bottom-content {
        flex-direction: column;
        gap: var(--space-md);
    }

    .footer-legal {
        justify-content: center;
    }

    /* Floating Elements */
    .floating-cta {
        left: var(--space-md);
        bottom: var(--space-md);
    }

    .floating-btn {
        padding: var(--space-sm) var(--space-md);
        font-size: var(--font-size-sm);
    }

    .floating-text {
        display: none;
    }

    .back-to-top {
        right: var(--space-md);
        bottom: var(--space-md);
        width: 44px;
        height: 44px;
    }

    /* Sentence Builder */
    .word-bank {
        gap: var(--space-md);
    }

    .word-category {
        padding: var(--space-md);
    }

    .word-option {
        font-size: var(--font-size-sm);
        padding: var(--space-xs) var(--space-sm);
    }

    /* Learning Cards */
    .alphabet-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .learning-card {
        padding: var(--space-md);
    }

    .learning-card-letter {
        font-size: var(--font-size-3xl);
        margin-bottom: var(--space-sm);
    }

    .learning-card-word {
        font-size: var(--font-size-base);
    }

    .learning-card-korean {
        font-size: var(--font-size-xs);
    }
}

/* ==========================================================================
   Mobile (< 576px)
   ========================================================================== */
@media (max-width: 575px) {
    :root {
        --header-height: 52px;
        --font-size-5xl: 2rem;
        --font-size-4xl: 1.75rem;
        --font-size-3xl: 1.375rem;
        --space-xl: 1.5rem;
        --space-2xl: 2rem;
        --space-3xl: 2.5rem;
    }

    html {
        font-size: 15px;
    }

    .container {
        padding: 0 var(--space-md);
    }

    /* Header */
    .header-actions {
        gap: var(--space-xs);
    }

    .start-btn {
        padding: var(--space-xs) var(--space-sm);
        font-size: var(--font-size-xs);
    }

    /* Hero */
    .hero-section {
        padding: var(--space-2xl) 0;
    }

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

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

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

    .section-header {
        margin-bottom: var(--space-lg);
    }

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

    .section-desc {
        font-size: var(--font-size-sm);
    }

    /* Cards */
    .card-body {
        padding: var(--space-sm);
    }

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

    .card-stats {
        font-size: var(--font-size-xs);
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-sm);
    }

    .stat-card {
        padding: var(--space-md);
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        margin-bottom: var(--space-sm);
    }

    .stat-number {
        font-size: var(--font-size-xl);
    }

    .stat-label {
        font-size: var(--font-size-xs);
    }

    /* Page Header */
    .page-header {
        padding: var(--space-xl) 0;
    }

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

    .page-desc {
        font-size: var(--font-size-sm);
    }

    /* Buttons */
    .btn {
        padding: var(--space-sm) var(--space-md);
        font-size: var(--font-size-sm);
    }

    .btn-lg {
        padding: var(--space-sm) var(--space-lg);
    }

    /* Footer */
    .footer-top {
        padding: var(--space-xl) 0;
    }

    .footer-title {
        font-size: var(--font-size-sm);
        margin-bottom: var(--space-md);
    }

    .footer-links a,
    .footer-contact li {
        font-size: var(--font-size-xs);
    }

    .footer-bottom {
        padding: var(--space-md) 0;
    }

    .copyright,
    .footer-legal a {
        font-size: var(--font-size-xs);
    }

    /* Sentence Builder */
    .sentence-builder {
        padding: var(--space-md);
        border-radius: var(--radius-xl);
    }

    .sentence-display {
        min-height: 80px;
        padding: var(--space-md);
        gap: var(--space-sm);
    }

    .sentence-word {
        font-size: var(--font-size-lg);
        padding: var(--space-sm) var(--space-md);
        min-width: 80px;
    }

    .word-category-title {
        font-size: var(--font-size-xs);
    }

    .word-option {
        font-size: var(--font-size-xs);
        padding: 6px 10px;
    }

    /* Alphabet Grid */
    .alphabet-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-xs);
    }

    .learning-card {
        padding: var(--space-sm);
        border-radius: var(--radius-lg);
    }

    .learning-card-letter {
        font-size: var(--font-size-2xl);
        margin-bottom: var(--space-xs);
    }

    .learning-card-word {
        font-size: var(--font-size-sm);
        margin-bottom: 2px;
    }

    .learning-card-korean {
        font-size: 10px;
    }

    /* Forms */
    .form-input,
    .form-textarea,
    .form-select {
        padding: var(--space-sm) var(--space-md);
        font-size: var(--font-size-sm);
    }

    /* Mobile Navigation */
    .mobile-nav {
        width: 100%;
    }
}

/* ==========================================================================
   Extra Small Mobile (< 375px)
   ========================================================================== */
@media (max-width: 374px) {
    :root {
        --font-size-5xl: 1.75rem;
        --font-size-4xl: 1.5rem;
    }

    html {
        font-size: 14px;
    }

    .container {
        padding: 0 var(--space-sm);
    }

    .logo-icon {
        width: 36px;
        height: 36px;
    }

    .logo-icon span {
        font-size: var(--font-size-lg);
    }

    .alphabet-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Landscape Mobile
   ========================================================================== */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        min-height: auto;
        padding: var(--space-lg) 0;
    }

    .loading-screen {
        padding: var(--space-md);
    }

    .loader-text span {
        font-size: var(--font-size-2xl);
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    .site-header,
    .main-nav,
    .mobile-nav,
    .back-to-top,
    .floating-cta,
    .antigravity-canvas,
    .loading-screen {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ==========================================================================
   High DPI Screens
   ========================================================================== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Sharper borders and shadows for retina displays */
    .card {
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    }
}

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

    html {
        scroll-behavior: auto;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }

    .antigravity-canvas {
        display: none;
    }
}

/* ==========================================================================
   Dark Mode Support (Optional)
   ========================================================================== */
@media (prefers-color-scheme: dark) {
    /* Dark mode can be enabled by adding class="dark" to body */
}

body.dark {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-card: #212121;
    --bg-hover: #2a2a2a;
    --text-primary: #f1f1f1;
    --text-secondary: #aaaaaa;
    --text-muted: #717171;
    --border-light: #303030;
}
