/* Apple-inspired Design System 2024 - Updated */

/* Global Transform Override - Remove all hover lift effects */
button:hover,
.btn:hover,
.primary-button:hover,
.secondary-button:hover,
.alert-button:hover,
a:hover {
    transform: none !important;
}

/* CSS Reset & Custom Properties */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Apple System Colors */
    --color-black: #000000;
    --color-white: #ffffff;
    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-400: #9ca3af;
    --color-gray-500: #6b7280;
    --color-gray-600: #4b5563;
    --color-gray-700: #374151;
    --color-gray-800: #1f2937;
    --color-gray-900: #111827;

    /* Apple Blue */
    --color-blue-50: #eff6ff;
    --color-blue-100: #dbeafe;
    --color-blue-500: #3b82f6;
    --color-blue-600: #2563eb;
    --color-blue-700: #1d4ed8;

    /* Semantic colors */
    --color-primary: #007aff;
    --color-primary-hover: #0051d0;
    --color-secondary: #8e8e93;
    --color-background: #ffffff;
    --color-surface: #f2f2f7;
    --color-text: #1d1d1f;
    --color-text-secondary: #86868b;
    --color-border: #d2d2d7;

    /* Typography - SF Pro inspired */
    --font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-size-xs: 0.75rem;     /* 12px */
    --font-size-sm: 0.875rem;    /* 14px */
    --font-size-base: 1rem;      /* 16px */
    --font-size-lg: 1.125rem;    /* 18px */
    --font-size-xl: 1.25rem;     /* 20px */
    --font-size-2xl: 1.5rem;     /* 24px */
    --font-size-3xl: 1.875rem;   /* 30px */
    --font-size-4xl: 2.25rem;    /* 36px */
    --font-size-5xl: 3rem;       /* 48px */
    --font-size-6xl: 3.75rem;    /* 60px */
    --font-size-7xl: 4.5rem;     /* 72px */

    /* Line Heights */
    --line-height-tight: 1.25;
    --line-height-snug: 1.375;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.625;

    /* Font Weights */
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-black: 900;

    /* Spacing - Apple's 8pt grid system */
    --space-1: 0.25rem;   /* 4px */
    --space-2: 0.5rem;    /* 8px */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-5: 1.25rem;   /* 20px */
    --space-6: 1.5rem;    /* 24px */
    --space-8: 2rem;      /* 32px */
    --space-10: 2.5rem;   /* 40px */
    --space-12: 3rem;     /* 48px */
    --space-16: 4rem;     /* 64px */
    --space-20: 5rem;     /* 80px */
    --space-24: 6rem;     /* 96px */
    --space-32: 8rem;     /* 128px */

    /* Border Radius */
    --radius-sm: 0.375rem;   /* 6px */
    --radius-md: 0.5rem;     /* 8px */
    --radius-lg: 0.75rem;    /* 12px */
    --radius-xl: 1rem;       /* 16px */
    --radius-2xl: 1.5rem;    /* 24px */
    --radius-full: 9999px;

    /* Shadows - Apple's signature depth */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-base: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Transitions */
    --transition-quick: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Apple-style blur effects */
    --blur-sm: blur(8px);
    --blur-md: blur(16px);
    --blur-lg: blur(24px);
}

/* Base Styles */
html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background-color: var(--color-background);
    color: var(--color-text);
    line-height: var(--line-height-normal);
    font-weight: var(--font-weight-normal);
    overflow-x: hidden;
}

/* Page Structure */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Main Page GNB Overrides */
.gnb {
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.gnb-logo {
    margin-left: 6px;
    margin-top: 2px;
}

.logo-image {
    height: 28px;
    width: auto;
}

/* Navigation */
.navigation {
    position: sticky;
    top: 56px; /* GNB height */
    z-index: 99;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: var(--blur-md);
    border-bottom: 1px solid var(--color-border);
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-6);
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.logo-icon {
    font-size: var(--font-size-2xl);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.logo-text {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    letter-spacing: -0.01em;
}

/* Hero Section */
.hero-section {
    padding: var(--space-20) 0 var(--space-32);
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.hero-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-6);
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: var(--font-size-6xl);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--color-text);
    margin-bottom: var(--space-6);
    letter-spacing: -0.025em;
}

.hero-highlight {
    background: linear-gradient(135deg, var(--color-primary), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: var(--font-size-xl);
    color: var(--color-text-secondary);
    line-height: var(--line-height-relaxed);
    margin-bottom: var(--space-16);
    font-weight: var(--font-weight-normal);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: var(--space-16) 0;
    background: var(--color-background);
}

.content-container {
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.content-section {
    max-width: 800px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-16);
}

.section-title {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
    margin-bottom: var(--space-4);
    letter-spacing: -0.02em;
}

.section-description {
    font-size: var(--font-size-lg);
    color: var(--color-text-secondary);
    line-height: var(--line-height-relaxed);
    max-width: 600px;
    margin: 0 auto;
}

/* Form Styles */
.learning-form {
    background: var(--color-white);
    border-radius: var(--radius-2xl);
    padding: var(--space-12);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
}

.form-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-10);
}

/* Input Section */
.input-section {
    margin-bottom: var(--space-8);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.input-label {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.input-wrapper {
    position: relative;
}

.topic-input {
    width: 100%;
    padding: var(--space-4) var(--space-5);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    background: var(--color-white);
    color: var(--color-text);
    resize: vertical;
    min-height: 120px;
    transition: all var(--transition-quick);
}

.topic-input::placeholder {
    color: var(--color-text-secondary);
}

.topic-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
    background: var(--color-white);
}

/* Options Grid */
.options-grid {
    display: grid;
    gap: var(--space-8);
}

.option-card {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    border: 1px solid var(--color-border);
    transition: all var(--transition-base);
}

.option-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-header {
    margin-bottom: var(--space-5);
}

.card-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    margin: 0;
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

/* Option Buttons */
.option-buttons {
    display: flex;
    gap: var(--space-3);
    flex-direction: column;
}

.option-buttons.horizontal {
    flex-direction: row;
}

.option-buttons.toggle {
    flex-direction: row;
}

.option-buttons input[type="radio"] {
    display: none;
}

.option-button {
    flex: 1;
    cursor: pointer;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    background: var(--color-white);
    transition: all var(--transition-quick);
    display: block;
}

.option-button:hover:not(.disabled) {
    border-color: var(--color-primary);
    background: rgba(0, 122, 255, 0.02);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.option-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--color-gray-50);
}

.option-buttons input[type="radio"]:checked + .option-button {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: var(--color-white);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.option-buttons input[type="radio"]:checked + .option-button .button-title,
.option-buttons input[type="radio"]:checked + .option-button .button-subtitle {
    color: var(--color-white);
}

.button-content {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.button-icon {
    font-size: var(--font-size-xl);
    flex-shrink: 0;
}

.button-text {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    flex: 1;
    text-align: left;
}

.button-title {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    transition: color var(--transition-quick);
}

.button-subtitle {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    transition: color var(--transition-quick);
}

/* Primary Button */
.action-section {
    margin-top: var(--space-8);
    display: flex;
    justify-content: center;
}

.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-8);
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
    border-radius: var(--radius-full);
    font-family: var(--font-family);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all var(--transition-quick);
    position: relative;
    overflow: hidden;
    min-width: 200px;
}

.primary-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--transition-slow);
}

.primary-button:hover {
    background: var(--color-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 122, 255, 0.3);
}

.primary-button:hover::before {
    left: 100%;
}

.primary-button:active {
    transform: translateY(-1px);
}

.button-arrow {
    font-size: var(--font-size-lg);
    transition: transform var(--transition-quick);
}

.primary-button:hover .button-arrow {
    transform: translateX(4px);
}

/* Teacher Section */
.teacher-section {
    padding: 60px 0;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 100%);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.teacher-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.teacher-header {
    text-align: center;
    margin-bottom: 48px;
}

.teacher-title {
    font-size: 36px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 16px;
    line-height: 1.2;
}

.teacher-subtitle {
    font-size: 18px;
    color: #666;
    line-height: 1.6;
}

.teacher-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 32px;
    max-width: 1000px;
    margin: 0 auto;
}

.teacher-card {
    background: white;
    border-radius: 16px;
    padding: 32px;
    border: 2px solid #f0f0f0;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.teacher-card:hover {
    border-color: #667eea;
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.15);
}

.teacher-icon {
    font-size: 48px;
    margin-bottom: 24px;
    display: block;
}

.teacher-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.teacher-option-title {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.teacher-option-description {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
    margin: 0;
}

.teacher-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.teacher-button.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.teacher-button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.teacher-button.secondary {
    background: #f8f9fa;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.teacher-button.secondary:hover {
    background: #e5e7eb;
    transform: translateY(-2px);
}

/* Features Section */
.features-section {
    padding: var(--space-32) 0;
    background: linear-gradient(180deg, var(--color-white) 0%, var(--color-surface) 100%);
}

.features-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.features-header {
    text-align: center;
    margin-bottom: var(--space-20);
}

.features-title {
    font-size: var(--font-size-5xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
    margin-bottom: var(--space-4);
    letter-spacing: -0.02em;
}

.features-subtitle {
    font-size: var(--font-size-xl);
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-normal);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-12);
}

.feature-card {
    background: var(--color-white);
    border-radius: var(--radius-2xl);
    padding: var(--space-10);
    text-align: center;
    box-shadow: var(--shadow-base);
    border: 1px solid var(--color-border);
    transition: all var(--transition-base);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.feature-icon {
    font-size: var(--font-size-5xl);
    margin-bottom: var(--space-6);
    display: block;
}

.feature-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.feature-title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    margin: 0;
}

.feature-description {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
    line-height: var(--line-height-relaxed);
    margin: 0;
}

/* Student Page Footer Overrides - Only for student pages that use main.css only */
.page-wrapper .footer {
    height: 134px; /* 98px logo height + 36px padding */
}

.page-wrapper .footer-container {
    align-items: flex-end;
    height: 100%;
    position: relative;
}

.page-wrapper .footer-logo {
    align-items: flex-end;
    height: 100%;
    padding-bottom: 0;
    margin-right: 36px;
    margin-bottom: -1px;
}

.page-wrapper .footer-logo-img {
    width: 164px;
    height: 98px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.05)) grayscale(0.2) brightness(1.1) contrast(0.8);
    display: block;
}

.page-wrapper .footer-content {
    flex: 1;
    padding: 24px;
}

.page-wrapper .footer-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.page-wrapper .footer-company,
.page-wrapper .footer-copyright {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #363636;
    text-align: left;
}

.page-wrapper .footer-link {
    display: inline-block;
    margin-top: 12px;
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #3578d9;
    border-bottom: 1px solid transparent;
    font-weight: 500;
}

.page-wrapper .footer-link:hover {
    color: #2563eb;
    border-bottom-color: #3578d9;
}

/* Main Page Loading Override */
.loading-overlay {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: var(--blur-md);
}

.loading-content {
    color: var(--color-white);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid var(--color-white);
    margin: 0 auto var(--space-4);
}

.loading-text {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    margin: 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero-title {
        font-size: var(--font-size-5xl);
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

    .options-grid {
        gap: var(--space-6);
    }
}

@media (max-width: 767px) {
    .gnb-container {
        padding-left: 32px;
        padding-right: 32px;
        height: 56px;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0 var(--space-4);
    }

    .hero-section {
        padding: var(--space-16) 0 var(--space-20);
    }

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

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

    .content-container,
    .features-container {
        padding: 0 var(--space-4);
    }

    .learning-form {
        padding: var(--space-8);
    }

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

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

    .option-buttons.horizontal {
        flex-direction: column;
    }

    .option-buttons.toggle {
        flex-direction: column;
    }

    .features-grid {
        gap: var(--space-6);
    }

    .feature-card {
        padding: var(--space-8);
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: var(--font-size-3xl);
    }

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

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

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

    .learning-form {
        padding: var(--space-6);
    }

    .primary-button {
        width: 100%;
        padding: var(--space-4) var(--space-6);
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.primary-button:focus,
.option-button:focus,
.topic-input:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

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