/* style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --dark: #1f2937;
    --gray: #6b7280;
    --light: #f3f4f6;
    --white: #ffffff;
    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.07);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: linear-gradient(to bottom, #f9fafb, #f3f4f6);
    min-height: 100vh;
}

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

/* Header */
.header {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
}

.built-with {
    color: var(--gray);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.built-with:hover {
    color: var(--primary);
    background: var(--light);
}

/* Main Content */
.main {
    padding-top: 80px;
}

.section {
    display: none;
    padding: 3rem 0;
    animation: fadeIn 0.5s ease;
}

.section.active {
    display: block;
}

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

/* Welcome Section */
.hero {
    text-align: center;
    padding: 4rem 0;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--gray);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.device-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.device-selector label {
    font-weight: 500;
    color: var(--dark);
}

.toggle-group {
    display: flex;
    background: var(--light);
    border-radius: 8px;
    padding: 4px;
}

.toggle-btn {
    padding: 0.5rem 1.5rem;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

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

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.feature-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    text-align: center;
}

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

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 0.75rem;
    color: var(--dark);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

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

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

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

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* Module Headers */
.module-header {
    margin-bottom: 3rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--light);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--gradient);
    transition: width 0.5s ease;
}

.module-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark);
}

/* Lesson Content */
.lesson-content {
    margin-bottom: 2rem;
}

.lesson-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

.lesson-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--dark);
}

/* Exposure Triangle */
.exposure-triangle {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.triangle-item {
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    color: var(--white);
    transition: transform 0.3s ease;
}

.triangle-item:hover {
    transform: translateY(-5px);
}

.aperture {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.shutter {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.iso {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.triangle-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.triangle-item h4 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.triangle-item p {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.triangle-item span {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Example Grid */
.example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.example-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.example-img {
    width: 100%;
    height: 150px;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.underexposed {
    background: linear-gradient(to bottom, #1a1a1a, #333);
}

.proper {
    background: linear-gradient(to bottom, #e0e0e0, #f5f5f5);
}

.overexposed {
    background: linear-gradient(to bottom, #fff, #f0f0f0);
}

.example-label {
    font-weight: 600;
    color: var(--dark);
    display: block;
    margin-bottom: 0.5rem;
}

/* AI Assistant */
.ai-assistant {
    background: var(--white);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    margin-top: 2rem;
}

.ai-assistant h3 {
    margin-bottom: 1.5rem;
    color: var(--dark);
}

.chat-container {
    border: 1px solid var(--light);
    border-radius: 12px;
    overflow: hidden;
}

.chat-messages {
    height: 300px;
    overflow-y: auto;
    padding: 1rem;
    background: #fafafa;
}

.message {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    max-width: 80%;
}

.user-message {
    background: var(--primary);
    color: var(--white);
    margin-left: auto;
}

.ai-message {
    background: var(--white);
    border: 1px solid var(--light);
}

.chat-input {
    display: flex;
    padding: 1rem;
    background: var(--white);
    border-top: 1px solid var(--light);
}

.chat-input input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--light);
    border-radius: 8px;
    margin-right: 0.5rem;
    font-size: 1rem;
}

.chat-input button {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.chat-input button:hover {
    background: var(--primary-dark);
}

/* Composition Rules */
.composition-rules {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.rule-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.rule-visual {
    width: 100%;
    height: 150px;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.thirds {
    background: #f0f0f0;
    position: relative;
    overflow: hidden;
}

.thirds::before,
.thirds::after {
    content: '';
    position: absolute;
    background: rgba(99, 102, 241, 0.3);
    width: 1px;
    height: 100%;
}

.thirds::before {
    left: 33.33%;
}

.thirds::after {
    right: 33.33%;
}

.leading {
    background: linear-gradient(45deg, #e0e0e0 25%, transparent 25%, transparent 75%, #e0e0e0 75%, #e0e0e0),
                linear-gradient(45deg, #e0e0e0 25%, transparent 25%, transparent 75%, #e0e0e0 75%, #e0e0e0);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
}

.framing {
    background: #333;
    position: relative;
}

.framing::after {
    content: '';
    position: absolute;
    inset: 20px;
    background: var(--white);
    border-radius: 4px;
}

.symmetry {
    background: linear-gradient(90deg, #e0e0e0 50%, #d0d0d0 50%);
}

/* Practice Section */
.practice-section {
    background: var(--white);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    margin-top: 2rem;
}

.practice-section h3 {
    margin-bottom: 1rem;
    color: var(--dark);
}

.scenario-img {
    width: 100%;
    height: 200px;
    background: url('https://picsum.photos/seed/photography/600/400.jpg') center/cover;
    border-radius: 8px;
    margin: 1rem 0;
}

.options {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.option-btn {
    padding: 0.75rem 1.5rem;
    background: var(--light);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-btn:hover {
    border-color: var(--primary);
}

.option-btn.correct {
    background: var(--success);
    color: var(--white);
}

.option-btn.wrong {
    background: var(--error);
    color: var(--white);
}

/* Light Types */
.light-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.light-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: transform 0.3s ease;
}

.light-card:hover {
    transform: translateY(-5px);
}

.light-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.golden {
    border-top: 4px solid #f59e0b;
}

.harsh {
    border-top: 4px solid #ef4444;
}

.overcast {
    border-top: 4px solid #6b7280;
}

.blue {
    border-top: 4px solid #3b82f6;
}

.light-card h3 {
    margin-bottom: 0.75rem;
    color: var(--dark);
}

.light-card ul {
    list-style: none;
    text-align: left;
}

.light-card li {
    padding: 0.25rem 0;
    font-size: 0.875rem;
    color: var(--gray);
}

.light-card li::before {
    content: "• ";
    color: var(--primary);
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.setting-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.setting-card h3 {
    margin-bottom: 1.5rem;
    color: var(--dark);
}

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.setting-item {
    padding: 1rem;
    background: var(--light);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.setting-item strong {
    color: var(--dark);
}

.setting-item span {
    color: var(--gray);
}

/* Module Actions */
.module-actions {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Quiz Section */
.quiz-header {
    text-align: center;
    margin-bottom: 3rem;
}

.quiz-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.quiz-progress {
    max-width: 500px;
    margin: 0 auto;
}

#question-counter {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--gray);
}

.quiz-progress-bar {
    width: 100%;
    height: 10px;
    background: var(--light);
    border-radius: 5px;
    overflow: hidden;
}

.quiz-progress-fill {
    height: 100%;
    background: var(--gradient);
    transition: width 0.3s ease;
}

.quiz-content {
    max-width: 700px;
    margin: 0 auto;
}

.question h3 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--dark);
}

.answers {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.answer-btn {
    padding: 1rem 1.5rem;
    background: var(--white);
    border: 2px solid var(--light);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-size: 1rem;
}

.answer-btn:hover {
    border-color: var(--primary);
    background: var(--light);
}

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

.quiz-actions {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

/* Loading */
.loading {
    text-align: center;
    padding: 3rem;
}

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

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

/* Results */
.results-container {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.score-display {
    margin-bottom: 3rem;
}

.score-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    position: relative;
}

.score-circle::before {
    content: '';
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    background: var(--white);
}

.score-circle span {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary);
    z-index: 1;
}

#result-message {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

#result-description {
    font-size: 1.125rem;
    color: var(--gray);
}

.results-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 3rem;
}

.stat {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.stat span:first-child {
    display: block;
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.stat span:last-child {
    font-size: 0.875rem;
    color: var(--gray);
}

.certificate {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: var(--white);
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
}

.certificate h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.results-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Footer */
.footer {
    background: var(--white);
    padding: 2rem 0;
    text-align: center;
    color: var(--gray);
    margin-top: 4rem;
}

/* Notifications */
.notification {
    position: fixed;
    top: 100px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: var(--white);
    font-weight: 500;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.notification.success {
    background: var(--success);
}

.notification.error {
    background: var(--error);
}

.notification.info {
    background: var(--info);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
    
    .exposure-triangle {
        grid-template-columns: 1fr;
    }
    
    .composition-rules,
    .light-types,
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .module-actions {
        flex-direction: column;
    }
    
    .results-stats {
        grid-template-columns: 1fr;
    }
    
    .quiz-actions {
        flex-direction: column;
    }
    
    .results-actions {
        flex-direction: column;
    }
    
    .options {
        flex-direction: column;
    }
    
    .chat-messages {
        height: 200px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .module-header h2,
    .quiz-header h2 {
        font-size: 1.875rem;
    }
    
    .score-circle {
        width: 150px;
        height: 150px;
    }
    
    .score-circle span {
        font-size: 2.5rem;
    }
}