/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'Courier New', monospace;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

body {
    font-family: var(--font-sans);
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Header */
.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: var(--spacing-md) 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.logo svg {
    width: 32px;
    height: 32px;
}

.nav {
    display: flex;
    gap: var(--spacing-lg);
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--primary);
}

/* Hero Section */
.hero {
    padding: var(--spacing-xl) 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
}

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

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: var(--spacing-md);
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-lg);
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    margin-bottom: var(--spacing-xl);
}

.hero-stats {
    display: flex;
    gap: var(--spacing-xl);
    justify-content: center;
    margin-top: var(--spacing-xl);
}

.stat {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-weight: 600;
}

.stat svg {
    width: 24px;
    height: 24px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    font-size: 1rem;
}

.btn svg {
    width: 20px;
    height: 20px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
}

.btn-icon {
    padding: 0.5rem;
    border-radius: var(--radius-sm);
}

/* Sections */
.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: var(--spacing-xl);
}

/* Features Section */
.features {
    padding: var(--spacing-xl) 0;
}

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

.feature-card {
    background: var(--surface);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.feature-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-md);
}

.feature-icon svg {
    width: 32px;
    height: 32px;
    color: white;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
}

/* How It Works */
.how-it-works {
    padding: var(--spacing-xl) 0;
    background: var(--surface);
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-xl);
    margin-top: var(--spacing-xl);
}

.step {
    text-align: center;
    position: relative;
}

.step-number {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
}

.step-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-md);
}

.step-icon svg {
    width: 48px;
    height: 48px;
    color: white;
}

.step h3 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
}

.step p {
    color: var(--text-secondary);
}

/* Demo Section */
.demo {
    padding: var(--spacing-xl) 0;
}

.api-setup {
    max-width: 600px;
    margin: 0 auto var(--spacing-xl);
}

.api-card {
    background: var(--surface);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.api-card svg {
    width: 64px;
    height: 64px;
    color: var(--primary);
    margin-bottom: var(--spacing-md);
}

.api-card h3 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
}

.api-card p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.input-group {
    display: flex;
    gap: var(--spacing-sm);
    margin: var(--spacing-md) 0;
}

.input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color 0.3s;
}

.input:focus {
    outline: none;
    border-color: var(--primary);
}

.help-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: var(--spacing-sm);
}

.help-text a {
    color: var(--primary);
    text-decoration: none;
}

/* App Container */
.app-container {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-lg);
}

/* Upload Section */
.upload-tabs {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--border);
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.3s;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-btn svg {
    width: 20px;
    height: 20px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.upload-zone {
    border: 3px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.upload-zone:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.upload-zone svg {
    width: 64px;
    height: 64px;
    color: var(--primary);
    margin-bottom: var(--spacing-md);
}

.upload-zone h3 {
    margin-bottom: var(--spacing-sm);
}

.upload-zone p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.text-input {
    width: 100%;
    min-height: 300px;
    padding: var(--spacing-md);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 1rem;
    resize: vertical;
    margin-bottom: var(--spacing-md);
}

.text-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Processing Indicator */
.processing {
    text-align: center;
    padding: var(--spacing-xl);
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--spacing-md);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Results Section */
.results-section {
    margin-top: var(--spacing-lg);
}

.feature-selector {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    overflow-x: auto;
    padding-bottom: var(--spacing-sm);
}

.feature-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.3s;
    white-space: nowrap;
}

.feature-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.feature-btn svg {
    width: 20px;
    height: 20px;
}

.feature-content {
    display: none;
}

.feature-content.active {
    display: block;
}

.feature-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.feature-header h3 {
    font-size: 1.5rem;
}

.level-selector {
    display: flex;
    gap: var(--spacing-xs);
}

.level-btn {
    padding: 0.5rem 1rem;
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.level-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.content-box {
    background: var(--background);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    min-height: 300px;
}

.placeholder {
    color: var(--text-secondary);
    text-align: center;
    padding: var(--spacing-xl);
}

/* Flashcards */
.flashcard-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.flashcard-container {
    perspective: 1000px;
    margin-bottom: var(--spacing-md);
}

.flashcard {
    width: 100%;
    height: 400px;
    cursor: pointer;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flashcard.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    background: var(--background);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.flashcard-back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.flashcard-front p,
.flashcard-back p {
    font-size: 1.25rem;
    text-align: center;
}

/* Quiz */
.quiz-container {
    min-height: 400px;
}

.quiz-question {
    background: var(--background);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
}

.quiz-question h4 {
    margin-bottom: var(--spacing-md);
    font-size: 1.125rem;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.quiz-option {
    padding: var(--spacing-md);
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s;
}

.quiz-option:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.quiz-option.correct {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.quiz-option.incorrect {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.quiz-score {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--primary);
}

/* Mind Map */
.mindmap-container {
    min-height: 500px;
    background: var(--background);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
}

.mindmap-node {
    background: var(--surface);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    margin: var(--spacing-sm);
    border-left: 4px solid var(--primary);
}

.mindmap-node.level-1 {
    border-left-color: var(--primary);
    font-weight: 700;
    font-size: 1.25rem;
}

.mindmap-node.level-2 {
    border-left-color: var(--secondary);
    margin-left: var(--spacing-lg);
}

.mindmap-node.level-3 {
    border-left-color: var(--success);
    margin-left: calc(var(--spacing-lg) * 2);
    font-size: 0.875rem;
}

/* Q&A */
.qa-container {
    min-height: 400px;
}

.qa-history {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: var(--spacing-md);
}

.qa-message {
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
}

.qa-message.question {
    background: rgba(99, 102, 241, 0.1);
    border-left: 4px solid var(--primary);
}

.qa-message.answer {
    background: var(--background);
    border-left: 4px solid var(--success);
}

.qa-input-group {
    display: flex;
    gap: var(--spacing-sm);
}

/* Schedule */
.schedule-container {
    min-height: 400px;
}

.schedule-item {
    background: var(--background);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-sm);
    border-left: 4px solid var(--primary);
}

.schedule-item h4 {
    margin-bottom: var(--spacing-xs);
}

.schedule-item p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Footer */
.footer {
    background: var(--text-primary);
    color: white;
    padding: var(--spacing-xl) 0 var(--spacing-md);
    margin-top: var(--spacing-xl);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.footer-section h4 {
    margin-bottom: var(--spacing-sm);
}

.footer-section a {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    margin-bottom: var(--spacing-xs);
    transition: color 0.3s;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .nav {
        display: none;
    }
    
    .feature-selector {
        flex-wrap: nowrap;
    }
    
    .input-group {
        flex-direction: column;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feature-card,
.step,
.quiz-question {
    animation: fadeIn 0.5s ease-out;
}