/* CSS Variables */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --light-bg: #f8fafc;
    --dark-bg: #1e293b;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--light-bg);
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

/* Navigation */
.navbar {
    background: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.nav-brand a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

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

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    transition: 0.3s;
}

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

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

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

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

.btn-secondary:hover {
    background: #475569;
}

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

.btn-outline {
    background: transparent;
    border: 2px solid white;
    color: white;
}

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

/* Blog card button styling */
.blog-card .btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.blog-card .btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), #3b82f6);
    color: white;
    padding: 6rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.9);
}

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

/* Features Section */
.features {
    padding: 6rem 0;
    background: white;
}

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

.feature-card {
    text-align: center;
    padding: 2rem;
    background: var(--light-bg);
    border-radius: 1rem;
    transition: transform 0.3s ease;
}

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

.feature-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Quiz Styles */
.quiz-container {
    max-width: 800px;
    margin: 2rem auto;
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.quiz-header {
    background: var(--primary-color);
    color: white;
    padding: 2rem;
    text-align: center;
}

.quiz-title {
    color: white;
    margin-bottom: 1rem;
}

.quiz-description {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
}

.quiz-info {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.quiz-questions, .quiz-difficulty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quiz-difficulty.easy { color: var(--success-color); }
.quiz-difficulty.medium { color: var(--warning-color); }
.quiz-difficulty.hard { color: var(--danger-color); }

.quiz-content {
    padding: 2rem;
}

.quiz-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    margin-right: 1rem;
    overflow: hidden;
}

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

.question-card {
    background: var(--light-bg);
    padding: 2rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
}

.question-title {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.options {
    display: grid;
    gap: 1rem;
}

.option {
    padding: 1rem;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option:hover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.option.selected {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.1);
}

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

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

.option i {
    float: right;
    margin-left: 0.5rem;
}

.option.correct i {
    color: var(--success-color);
}

.option.incorrect i {
    color: var(--danger-color);
}

.explanation {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: rgba(37, 99, 235, 0.05);
    border-left: 4px solid var(--primary-color);
    border-radius: 0.5rem;
}

.explanation-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.explanation p {
    margin: 0;
    color: var(--text-primary);
}

.feedback {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.correct-feedback {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.incorrect-feedback {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.quiz-controls {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
}

.quiz-results {
    text-align: center;
    padding: 3rem 2rem;
}

.results-header {
    margin-bottom: 2rem;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 2rem auto;
}

.score-number {
    font-size: 2rem;
    font-weight: 700;
}

.results-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 2rem 0;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Quiz Review Styles */
.quiz-review {
    margin: 2rem 0;
    text-align: left;
}

.quiz-review h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    text-align: center;
    justify-content: center;
}

.review-questions {
    display: grid;
    gap: 1.5rem;
}

.review-question {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    border-left: 4px solid var(--border-color);
    box-shadow: var(--shadow);
}

.review-question.correct {
    border-left-color: var(--success-color);
}

.review-question.incorrect {
    border-left-color: var(--danger-color);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.question-number {
    font-weight: 600;
    color: var(--text-secondary);
}

.result-icon {
    font-size: 1.25rem;
}

.review-question.correct .result-icon {
    color: var(--success-color);
}

.review-question.incorrect .result-icon {
    color: var(--danger-color);
}

.review-question h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.answer-comparison {
    margin-bottom: 1rem;
}

.user-answer, .correct-answer {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-answer {
    background: rgba(37, 99, 235, 0.05);
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.correct-answer {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.correct-badge {
    color: var(--success-color);
    font-weight: bold;
}

.incorrect-badge {
    color: var(--danger-color);
    font-weight: bold;
}

.explanation-text {
    background: rgba(64, 64, 64, 0.05);
    padding: 1rem;
    border-radius: 0.5rem;
    color: var(--text-primary);
}

/* Blog Styles */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.blog-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

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

.blog-image {
    height: 200px;
    background: var(--light-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--primary-color);
}

.blog-content {
    padding: 1.5rem;
}

.blog-meta {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.blog-title {
    margin-bottom: 1rem;
}

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

.blog-title a:hover {
    color: var(--primary-color);
}

/* Post Styles */
.post-container {
    max-width: 800px;
    margin: 2rem auto;
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.post-header {
    padding: 3rem 3rem 2rem;
    background: var(--light-bg);
}

.post-meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.post-title {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.post-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.post-image img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 0.5rem;
}

.post-content {
    padding: 3rem;
    line-height: 1.8;
}

.post-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.post-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.post-content ul, .post-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

.post-footer {
    padding: 2rem 3rem 3rem;
    border-top: 1px solid var(--border-color);
}

.post-tags {
    margin-bottom: 2rem;
}

.tag {
    display: inline-block;
    background: var(--light-bg);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.post-navigation {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.nav-prev, .nav-next {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--light-bg);
    border-radius: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    flex: 1;
}

.nav-prev:hover, .nav-next:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(-2px);
}

.nav-next {
    justify-content: flex-end;
    text-align: right;
}

.nav-next:hover {
    transform: translateX(2px);
}

/* Option Button Styles */
.options-grid {
    display: grid;
    gap: 1rem;
    margin: 1.5rem 0;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.option-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.option-btn.selected {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.1);
}

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

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

.option-btn:disabled {
    cursor: default;
}

.option-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: var(--light-bg);
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

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

.option-btn.incorrect .option-letter {
    background: var(--danger-color);
    color: white;
}

.option-text {
    flex: 1;
    line-height: 1.5;
}

/* Explanation Container */
.explanation-container {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--light-bg);
    border-radius: 0.5rem;
    border-left: 4px solid var(--primary-color);
}

.explanation-content h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.75rem 0;
    color: var(--primary-color);
    font-size: 1rem;
}

.explanation-content p {
    margin: 0;
    line-height: 1.6;
    color: var(--text-color);
}

/* Footer */
.footer {
    background: var(--dark-bg);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

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

.footer-section h3 {
    color: white;
    margin-bottom: 1rem;
}

.footer-section h4 {
    color: white;
    margin-bottom: 1rem;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.8);
}

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

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

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

/* Answer Result Styling */
.answer-result {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.answer-result.correct {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.answer-result.incorrect {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.answer-result i {
    font-size: 1.25rem;
}

.answer-result span {
    margin-left: 0.5rem;
    font-weight: normal;
}

/* Quiz Summary Styling */
.quiz-summary {
    margin: 2rem 0;
}

.quiz-summary h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.summary-item {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--border-color);
    box-shadow: var(--shadow);
}

.summary-item.correct {
    border-left-color: var(--success-color);
}

.summary-item.incorrect {
    border-left-color: var(--danger-color);
}

.summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.question-num {
    background: var(--light-bg);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-weight: 600;
    font-size: 0.875rem;
}

.summary-item.correct .question-num {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.summary-item.incorrect .question-num {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.summary-header i {
    font-size: 1.25rem;
}

.summary-item.correct .summary-header i {
    color: var(--success-color);
}

.summary-item.incorrect .summary-header i {
    color: var(--danger-color);
}

.summary-content h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
}

.summary-content p {
    margin: 0.5rem 0;
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        box-shadow: var(--shadow);
        padding: 1rem;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-toggle {
        display: flex;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .quiz-info {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .quiz-controls {
        flex-direction: column;
    }

    .results-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .post-header, .post-content, .post-footer {
        padding: 2rem 1.5rem;
    }

    .post-navigation {
        flex-direction: column;
    }

    .container {
        padding: 0 0.5rem;
    }
}

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

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }

.p-1 { padding: 1rem; }
.p-2 { padding: 2rem; }
.p-3 { padding: 3rem; }

.hidden { display: none; }
.visible { display: block; }
