/* Day 3: JavaScript Advanced Concepts Styles */

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

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

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

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 15px 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #4a5568;
}

.nav-logo i {
    color: #e53e3e;
    font-size: 1.2em;
}

.nav-progress {
    display: flex;
    align-items: center;
    gap: 15px;
}

.progress-bar {
    width: 200px;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #48bb78, #38a169);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.9em;
    color: #4a5568;
    font-weight: 500;
}

.nav-timer {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9em;
}

/* Hero Intro */
.hero-intro {
    padding: 120px 0 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
}

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

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    margin-bottom: 20px;
    font-size: 0.9em;
    font-weight: 500;
}

.hero-intro h1 {
    font-size: 3em;
    font-weight: 700;
    margin-bottom: 15px;
    background: linear-gradient(45deg, #fff, #e2e8f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-intro h2 {
    font-size: 1.5em;
    font-weight: 400;
    margin-bottom: 20px;
    opacity: 0.9;
}

.hero-description {
    font-size: 1.1em;
    margin-bottom: 40px;
    opacity: 0.8;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 25px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.stat-item i {
    font-size: 1.2em;
    color: #fbbf24;
}

/* Warm-up Section */
.warmup-section {
    padding: 80px 0;
    background: white;
}

.warmup-section h2 {
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 20px;
    color: #2d3748;
}

.warmup-section h2 i {
    color: #e53e3e;
    margin-right: 15px;
}

.warmup-section > .container > p {
    text-align: center;
    font-size: 1.2em;
    margin-bottom: 40px;
    color: #4a5568;
}

.challenge-card {
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.challenge-card h3 {
    font-size: 1.8em;
    margin-bottom: 20px;
    color: #2d3748;
}

.challenge-card p {
    font-size: 1.1em;
    margin-bottom: 30px;
    color: #4a5568;
}

.scenario-example {
    background: #2d3748;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    text-align: left;
    font-family: 'Courier New', monospace;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

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

/* Flow Section */
.flow-section {
    padding: 80px 0;
    background: #f7fafc;
}

.flow-section h2 {
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 50px;
    color: #2d3748;
}

.flow-section h2 i {
    color: #667eea;
    margin-right: 15px;
}

.flow-timeline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.flow-item {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid transparent;
}

.flow-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

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

.flow-icon i {
    font-size: 2em;
    color: white;
}

.flow-content h3 {
    font-size: 1.3em;
    margin-bottom: 10px;
    color: #2d3748;
}

.flow-content p {
    color: #4a5568;
    margin-bottom: 20px;
}

.btn-start {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.btn-start:hover {
    transform: translateY(-2px);
}

/* Learning Sections */
.learning-section {
    padding: 80px 0;
    background: white;
}

.learning-section:nth-child(even) {
    background: #f7fafc;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 2.5em;
    margin-bottom: 20px;
    color: #2d3748;
}

.section-header h2 i {
    color: #667eea;
    margin-right: 15px;
}

.section-header p {
    font-size: 1.2em;
    color: #4a5568;
    max-width: 800px;
    margin: 0 auto;
}

/* QA Story */
.qa-story {
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 50px;
    border-left: 5px solid #667eea;
}

.qa-story h3 {
    font-size: 1.8em;
    margin-bottom: 20px;
    color: #2d3748;
}

.qa-story > p {
    font-size: 1.1em;
    margin-bottom: 30px;
    color: #4a5568;
}

.story-example {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.before-after {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.before, .after {
    padding: 20px;
    border-radius: 10px;
}

.before {
    background: #fed7d7;
    border: 2px solid #f56565;
}

.after {
    background: #c6f6d5;
    border: 2px solid #48bb78;
}

.before h4, .after h4 {
    font-size: 1.2em;
    margin-bottom: 15px;
}

.before h4 {
    color: #c53030;
}

.after h4 {
    color: #2f855a;
}

.problem-solution {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.problem, .solution {
    padding: 25px;
    border-radius: 15px;
}

.problem {
    background: #fed7d7;
    border: 2px solid #f56565;
}

.solution {
    background: #c6f6d5;
    border: 2px solid #48bb78;
}

.problem h4, .solution h4 {
    font-size: 1.2em;
    margin-bottom: 15px;
}

.problem h4 {
    color: #c53030;
}

.solution h4 {
    color: #2f855a;
}

.promise-flow {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.promise-step {
    background: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.promise-step h4 {
    font-size: 1.1em;
    margin-bottom: 15px;
    color: #2d3748;
}

.code-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.comparison-tab {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.comparison-tab h4 {
    font-size: 1.2em;
    margin-bottom: 15px;
}

.comparison-tab:first-child h4 {
    color: #c53030;
}

.comparison-tab:last-child h4 {
    color: #2f855a;
}

/* Concept Grid */
.concept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.concept-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 2px solid #e2e8f0;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.concept-card:hover {
    transform: translateY(-5px);
    border-color: #667eea;
}

.concept-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.concept-header i {
    font-size: 1.5em;
    color: #667eea;
}

.concept-header h3 {
    font-size: 1.3em;
    color: #2d3748;
}

.concept-card p {
    color: #4a5568;
    margin-bottom: 15px;
}

.qa-use-case {
    background: #ebf8ff;
    border: 1px solid #bee3f8;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.9em;
}

.concept-card pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    overflow-x: auto;
}

/* Why Async */
.why-async {
    margin-bottom: 50px;
}

.why-async h3 {
    font-size: 1.8em;
    text-align: center;
    margin-bottom: 40px;
    color: #2d3748;
}

.reasons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.reason-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 2px solid #e2e8f0;
    transition: transform 0.3s ease;
}

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

.reason-card i {
    font-size: 2.5em;
    color: #667eea;
    margin-bottom: 20px;
}

.reason-card h4 {
    font-size: 1.2em;
    margin-bottom: 15px;
    color: #2d3748;
}

.reason-card p {
    color: #4a5568;
}

/* Promise States */
.promise-states {
    margin-bottom: 50px;
}

.promise-states h3 {
    font-size: 1.8em;
    text-align: center;
    margin-bottom: 40px;
    color: #2d3748;
}

.states-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.state-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 2px solid;
    transition: transform 0.3s ease;
}

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

.state-card.pending {
    border-color: #fbbf24;
}

.state-card.fulfilled {
    border-color: #48bb78;
}

.state-card.rejected {
    border-color: #f56565;
}

.state-card i {
    font-size: 2.5em;
    margin-bottom: 20px;
}

.state-card.pending i {
    color: #fbbf24;
}

.state-card.fulfilled i {
    color: #48bb78;
}

.state-card.rejected i {
    color: #f56565;
}

.state-card h4 {
    font-size: 1.2em;
    margin-bottom: 15px;
    color: #2d3748;
}

.state-card p {
    color: #4a5568;
    margin-bottom: 15px;
}

.state-card code {
    background: #2d3748;
    color: #e2e8f0;
    padding: 8px 12px;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

/* Why Async/Await */
.why-await {
    margin-bottom: 50px;
}

.why-await h3 {
    font-size: 1.8em;
    text-align: center;
    margin-bottom: 40px;
    color: #2d3748;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.benefit-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 2px solid #e2e8f0;
    transition: transform 0.3s ease;
}

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

.benefit-card i {
    font-size: 2.5em;
    color: #667eea;
    margin-bottom: 20px;
}

.benefit-card h4 {
    font-size: 1.2em;
    margin-bottom: 15px;
    color: #2d3748;
}

.benefit-card p {
    color: #4a5568;
}

/* Interactive Demo */
.interactive-demo {
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 50px;
}

.interactive-demo h3 {
    font-size: 1.8em;
    text-align: center;
    margin-bottom: 30px;
    color: #2d3748;
}

.demo-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

.code-editor {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.code-editor h4 {
    font-size: 1.2em;
    margin-bottom: 15px;
    color: #2d3748;
}

.code-editor textarea {
    width: 100%;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    resize: vertical;
    margin-bottom: 15px;
}

.btn-run {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.btn-run:hover {
    transform: translateY(-2px);
}

.output-panel {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.output-panel h4 {
    font-size: 1.2em;
    margin-bottom: 15px;
    color: #2d3748;
}

.output-content {
    background: #2d3748;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    min-height: 150px;
    overflow-y: auto;
}

.demo-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.btn-demo {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.btn-demo:hover {
    transform: translateY(-2px);
}

.demo-output {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.demo-output h4 {
    font-size: 1.2em;
    margin-bottom: 15px;
    color: #2d3748;
}

.promise-chain {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chain-step {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.chain-step h4 {
    font-size: 1.1em;
    margin-bottom: 15px;
    color: #2d3748;
}

.btn-step {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.btn-step:hover {
    transform: translateY(-2px);
}

.chain-output {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.chain-output h4 {
    font-size: 1.2em;
    margin-bottom: 15px;
    color: #2d3748;
}

.demo-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

/* Interactive Questions */
.interactive-question {
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 50px;
}

.interactive-question h3 {
    font-size: 1.8em;
    text-align: center;
    margin-bottom: 20px;
    color: #2d3748;
}

.interactive-question > p {
    text-align: center;
    font-size: 1.1em;
    margin-bottom: 30px;
    color: #4a5568;
}

.question-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 600px;
    margin: 0 auto;
}

.option-btn {
    background: white;
    border: 2px solid #e2e8f0;
    padding: 20px;
    border-radius: 15px;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1em;
    color: #4a5568;
}

.option-btn:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.option-btn.correct {
    background: #c6f6d5;
    border-color: #48bb78;
    color: #2f855a;
}

.option-btn.incorrect {
    background: #fed7d7;
    border-color: #f56565;
    color: #c53030;
}

.answer-feedback {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    font-weight: 600;
    display: none;
}

.answer-feedback.correct {
    background: #c6f6d5;
    color: #2f855a;
    border: 2px solid #48bb78;
}

.answer-feedback.incorrect {
    background: #fed7d7;
    color: #c53030;
    border: 2px solid #f56565;
}

/* Mini Assignment */
.mini-assignment, .final-assignment {
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 50px;
}

.mini-assignment h3, .final-assignment h3 {
    font-size: 1.8em;
    text-align: center;
    margin-bottom: 20px;
    color: #2d3748;
}

.mini-assignment > p, .final-assignment > p {
    text-align: center;
    font-size: 1.1em;
    margin-bottom: 30px;
    color: #4a5568;
}

.assignment-input {
    max-width: 800px;
    margin: 0 auto;
}

.assignment-input textarea {
    width: 100%;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    resize: vertical;
    margin-bottom: 20px;
    min-height: 200px;
}

.btn-check {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
    display: block;
    margin: 0 auto;
}

.btn-check:hover {
    transform: translateY(-2px);
}

.assignment-result {
    margin-top: 20px;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    display: none;
}

.assignment-result.success {
    background: #c6f6d5;
    color: #2f855a;
    border: 2px solid #48bb78;
}

.assignment-result.error {
    background: #fed7d7;
    color: #c53030;
    border: 2px solid #f56565;
}

/* Footer */
.footer {
    background: #2d3748;
    color: white;
    padding: 60px 0 30px;
}

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

.footer-section h3 {
    font-size: 1.3em;
    margin-bottom: 20px;
    color: #e2e8f0;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
    color: #a0aec0;
}

.footer-section ul li a {
    color: #a0aec0;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: #667eea;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #4a5568;
    color: #a0aec0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-progress {
        order: 3;
    }
    
    .hero-intro h1 {
        font-size: 2em;
    }
    
    .hero-stats {
        flex-direction: column;
        align-items: center;
    }
    
    .before-after, .problem-solution, .code-comparison {
        grid-template-columns: 1fr;
    }
    
    .demo-container {
        grid-template-columns: 1fr;
    }
    
    .promise-flow {
        grid-template-columns: 1fr;
    }
    
    .concept-grid, .reasons-grid, .states-grid, .benefits-grid {
        grid-template-columns: 1fr;
    }
    
    .flow-timeline {
        grid-template-columns: 1fr;
    }
    
    .demo-buttons, .demo-controls {
        flex-direction: column;
    }
}

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

.learning-section {
    animation: fadeInUp 0.6s ease-out;
}

/* Scroll Animations */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.scroll-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

