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

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.8;
    color: #2d3436;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #7e8ba3 100%);
    min-height: 100vh;
    padding: 40px 20px;
}

header {
    text-align: center;
    color: white;
    padding: 60px 20px 40px;
    margin-bottom: 50px;
}

header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3.5em;
    margin-bottom: 15px;
    font-weight: 700;
    letter-spacing: 2px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

header p {
    font-family: 'Poppins', sans-serif;
    font-size: 1.15em;
    opacity: 0.95;
    font-weight: 300;
    letter-spacing: 0.5px;
    max-width: 600px;
    margin: 0 auto;
}

/* Tab Navigation */
.tab-navigation {
    max-width: 1100px;
    margin: 0 auto 40px;
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 0 20px;
}

.tab-button {
    font-family: 'Poppins', sans-serif;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 40px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    color: white;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.tab-button:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.tab-button.active {
    background: rgba(255, 255, 255, 0.95);
    color: #1e3c72;
    border-color: white;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    transform: translateY(-3px);
}

.tab-icon {
    font-size: 1.3em;
    display: flex;
    align-items: center;
}

.tab-text {
    display: flex;
    align-items: center;
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

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

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

main {
    max-width: 1100px;
    margin: 0 auto;
}

.concept-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    padding: 45px;
    margin-bottom: 35px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25), 0 5px 15px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.concept-card h2 {
    font-family: 'Playfair Display', serif;
    color: #1e3c72;
    margin-bottom: 30px;
    font-size: 2.4em;
    border-bottom: none;
    padding-bottom: 0;
    font-weight: 700;
    letter-spacing: 1px;
    position: relative;
    padding-bottom: 15px;
}

.concept-card h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #1e3c72, #2a5298);
    border-radius: 2px;
}

.concept-card h3 {
    font-family: 'Poppins', sans-serif;
    color: #2a5298;
    margin-top: 25px;
    margin-bottom: 12px;
    font-size: 1.35em;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.concept-card p {
    color: #4a5568;
    font-size: 1.02em;
    line-height: 1.8;
}

.concept-card ul {
    margin-left: 25px;
    margin-top: 15px;
    margin-bottom: 20px;
}

.concept-card li {
    margin-bottom: 12px;
    color: #4a5568;
    line-height: 1.7;
}

/* pH Scale - Sophisticated Design */
.ph-scale-container {
    margin: 40px 0;
    padding: 35px;
    background: linear-gradient(145deg, #f8fafc 0%, #e8eef5 100%);
    border-radius: 20px;
    box-shadow: inset 0 2px 20px rgba(30, 60, 114, 0.08);
    border: 1px solid rgba(30, 60, 114, 0.1);
}

.ph-scale-visual {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    background: linear-gradient(to right,
        #e74c3c 0%,
        #ec7063 15%,
        #f39c12 30%,
        #f8c471 42%,
        #27ae60 50%,
        #5dade2 58%,
        #5499c7 70%,
        #8e44ad 85%,
        #6c3483 100%);
    border-radius: 16px;
    padding: 20px 12px;
    margin-bottom: 30px;
    position: relative;
    height: 200px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2), 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.ph-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.ph-marker:hover {
    transform: translateY(-8px);
}

.ph-number {
    font-family: 'Space Mono', monospace;
    font-size: 1.4em;
    font-weight: 700;
    color: white;
    background: rgba(30, 60, 114, 0.75);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    border: 2.5px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.ph-marker:hover .ph-number {
    transform: scale(1.15);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.ph-marker.neutral .ph-number {
    background: rgba(255, 255, 255, 0.95);
    color: #27ae60;
    border-color: #27ae60;
    border-width: 3px;
    font-size: 1.7em;
    width: 52px;
    height: 52px;
    box-shadow: 0 6px 25px rgba(39, 174, 96, 0.4), 0 3px 10px rgba(39, 174, 96, 0.2);
}

.ph-example {
    font-family: 'Poppins', sans-serif;
    font-size: 0.72em;
    color: white;
    background: rgba(30, 60, 114, 0.85);
    padding: 5px 10px;
    border-radius: 8px;
    white-space: nowrap;
    margin-top: 6px;
    font-weight: 500;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    letter-spacing: 0.3px;
}

.ph-icon {
    font-size: 1.4em;
    margin-top: 4px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.ph-scale-labels {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.ph-label {
    flex: 1;
    text-align: center;
    padding: 20px;
    border-radius: 14px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ph-label:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.acidic-label {
    background: linear-gradient(135deg, #e74c3c, #ec7063);
}

.neutral-label {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
}

.alkaline-label {
    background: linear-gradient(135deg, #5499c7, #8e44ad);
}

.label-title {
    font-family: 'Space Mono', monospace;
    display: block;
    color: white;
    font-weight: 700;
    font-size: 1.15em;
    letter-spacing: 3px;
    margin-bottom: 6px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.label-range {
    font-family: 'Poppins', sans-serif;
    display: block;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.95em;
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* Agents Grid */
.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.agent {
    padding: 28px;
    border-radius: 16px;
    border: 2px solid;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.agent:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.agent.acidic {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
    border-color: #e74c3c;
}

.agent.neutral {
    background: linear-gradient(135deg, #f0f8f5 0%, #e5f5ed 100%);
    border-color: #27ae60;
}

.agent.alkaline {
    background: linear-gradient(135deg, #f0f5ff 0%, #e5edff 100%);
    border-color: #5499c7;
}

.agent h3 {
    font-family: 'Poppins', sans-serif;
    margin-top: 0;
    font-size: 1.4em;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.ph-level {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 1.15em;
    margin-bottom: 18px;
    letter-spacing: 1.5px;
    opacity: 0.9;
}

.agent.acidic .ph-level {
    color: #c0392b;
}

.agent.neutral .ph-level {
    color: #229954;
}

.agent.alkaline .ph-level {
    color: #2874a6;
}

.agent ul {
    font-family: 'Poppins', sans-serif;
    margin: 15px 0 20px 22px;
}

.agent li {
    color: #4a5568;
    margin-bottom: 10px;
}

.use {
    font-family: 'Poppins', sans-serif;
    margin-top: 18px;
    padding: 14px;
    background: rgba(30, 60, 114, 0.06);
    border-radius: 10px;
    font-size: 0.96em;
    border-left: 3px solid currentColor;
}

/* Concepts */
.concept {
    margin-bottom: 30px;
    padding: 22px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-left: 4px solid #2a5298;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.concept:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateX(5px);
}

.concept h3 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: #1e3c72;
}

.concept p {
    font-family: 'Poppins', sans-serif;
    margin-bottom: 10px;
    color: #4a5568;
}

.example {
    font-family: 'Poppins', sans-serif;
    color: #718096;
    font-style: italic;
    margin-top: 10px;
    font-size: 0.96em;
}

.tip {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    padding: 14px;
    border-radius: 10px;
    border-left: 4px solid #f59e0b;
    margin-top: 12px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.1);
}

/* Warning Box */
.warning-box {
    background: linear-gradient(135deg, #fff5f0 0%, #ffe8e0 100%);
    border: 3px solid #e74c3c;
    border-radius: 16px;
    padding: 28px;
    margin-top: 25px;
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.15);
}

.warning-box h3 {
    font-family: 'Space Mono', monospace;
    color: #c0392b;
    margin-top: 0;
    font-size: 1.35em;
    font-weight: 700;
    letter-spacing: 1.5px;
}

.warning-box ul {
    font-family: 'Poppins', sans-serif;
    margin: 20px 0 20px 28px;
}

.warning-box li {
    margin-bottom: 14px;
    font-size: 1.04em;
    color: #4a5568;
    line-height: 1.7;
}

.safety-tip {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    padding: 15px 18px;
    border-radius: 10px;
    font-weight: 600;
    margin-top: 18px;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Decision Tree */
.decision-tree {
    margin-top: 30px;
}

.question {
    font-family: 'Playfair Display', serif;
    font-size: 1.65em;
    font-weight: 700;
    color: #1e3c72;
    margin-bottom: 25px;
    letter-spacing: 0.5px;
}

.options {
    display: grid;
    gap: 18px;
}

.option {
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border-left: 5px solid #2a5298;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.option:hover {
    transform: translateX(8px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.option strong {
    font-family: 'Poppins', sans-serif;
    display: block;
    color: #2d3436;
    margin-bottom: 8px;
    font-size: 1.08em;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.option p {
    font-family: 'Space Mono', monospace;
    color: #2a5298;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.8px;
    font-size: 0.95em;
}

/* Quiz Section */
.quiz-section {
    margin-top: 40px;
}

.quiz-intro {
    font-size: 1.08em;
    color: #4a5568;
    margin-bottom: 30px;
    text-align: center;
}

#quiz-container {
    margin-bottom: 40px;
}

.quiz-question {
    margin-bottom: 35px;
    padding: 25px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    border-left: 5px solid #2a5298;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.quiz-question:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.quiz-question h3 {
    font-family: 'Poppins', sans-serif;
    color: #1e3c72;
    font-size: 1.25em;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 20px;
    letter-spacing: 0.3px;
}

.quiz-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
}

.quiz-option {
    font-family: 'Poppins', sans-serif;
    padding: 15px 20px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    color: #2d3436;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.quiz-option:hover:not(:disabled) {
    background: linear-gradient(135deg, #e8eef5 0%, #d6e1f0 100%);
    border-color: #2a5298;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(42, 82, 152, 0.2);
}

.quiz-option:active:not(:disabled) {
    transform: translateY(0);
}

.quiz-option.correct {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-color: #28a745;
    color: #155724;
    font-weight: 600;
    animation: correctAnswer 0.5s ease;
}

.quiz-option.wrong {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-color: #dc3545;
    color: #721c24;
    font-weight: 600;
    animation: wrongAnswer 0.5s ease;
}

@keyframes correctAnswer {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes wrongAnswer {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.quiz-feedback {
    margin-top: 15px;
    padding: 0;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s ease;
}

.quiz-feedback.show {
    opacity: 1;
    max-height: 100px;
    padding: 12px 15px;
}

.feedback-correct {
    font-family: 'Poppins', sans-serif;
    color: #28a745;
    font-weight: 600;
    font-size: 1.05em;
    margin: 0;
}

.feedback-wrong {
    font-family: 'Poppins', sans-serif;
    color: #dc3545;
    font-weight: 600;
    font-size: 1.05em;
    margin: 0;
}

/* Quiz Results */
.quiz-results {
    padding: 35px;
    background: linear-gradient(135deg, #f8fafc 0%, #e8eef5 100%);
    border-radius: 20px;
    border: 2px solid #2a5298;
    box-shadow: 0 8px 30px rgba(30, 60, 114, 0.15);
    text-align: center;
    margin-top: 40px;
    animation: slideIn 0.6s ease;
}

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

.score-display {
    margin-bottom: 30px;
}

.score-text {
    font-family: 'Space Mono', monospace;
    font-size: 1.8em;
    font-weight: 700;
    color: #1e3c72;
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.score-text span {
    color: #2a5298;
}

.score-bar {
    width: 100%;
    height: 40px;
    background: #e2e8f0;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, #27ae60, #2ecc71);
    border-radius: 20px;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(39, 174, 96, 0.4);
    width: 0;
}

.score-message {
    font-family: 'Poppins', sans-serif;
    font-size: 1.2em;
    font-weight: 600;
    margin: 20px 0;
    padding: 15px;
    border-radius: 12px;
}

.score-message.excellent {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 2px solid #28a745;
}

.score-message.good {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
    border: 2px solid #17a2b8;
}

.score-message.okay {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border: 2px solid #ffc107;
}

.score-message.needs-improvement {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 2px solid #dc3545;
}

.reset-quiz {
    font-family: 'Poppins', sans-serif;
    padding: 15px 40px;
    background: linear-gradient(135deg, #2a5298, #1e3c72);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(30, 60, 114, 0.3);
    letter-spacing: 0.5px;
}

.reset-quiz:hover {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(30, 60, 114, 0.4);
}

.reset-quiz:active {
    transform: translateY(-1px);
}

/* Footer */
footer {
    font-family: 'Poppins', sans-serif;
    text-align: center;
    color: rgba(255, 255, 255, 0.95);
    padding: 40px 20px;
    margin-top: 50px;
    font-size: 1.08em;
    font-weight: 300;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 20px 15px;
    }

    header {
        padding: 40px 15px 30px;
        margin-bottom: 25px;
    }

    header h1 {
        font-size: 2.4em;
    }

    header p {
        font-size: 1.05em;
    }

    .tab-navigation {
        flex-direction: column;
        gap: 12px;
        padding: 0 15px;
        margin-bottom: 30px;
    }

    .tab-button {
        padding: 15px 25px;
        font-size: 1em;
        justify-content: center;
    }

    .concept-card {
        padding: 28px 22px;
        margin-bottom: 25px;
    }

    .concept-card h2 {
        font-size: 1.9em;
    }

    .agents-grid {
        grid-template-columns: 1fr;
    }

    .ph-scale-container {
        padding: 22px;
    }

    .ph-scale-visual {
        height: auto;
        flex-wrap: wrap;
        padding: 12px 8px;
    }

    .ph-marker {
        margin: 6px;
    }

    .ph-number {
        width: 36px;
        height: 36px;
        font-size: 1.2em;
    }

    .ph-marker.neutral .ph-number {
        width: 44px;
        height: 44px;
        font-size: 1.5em;
    }

    .ph-example {
        font-size: 0.68em;
        padding: 4px 7px;
    }

    .ph-scale-labels {
        flex-direction: column;
        gap: 12px;
    }

    .quiz-options {
        grid-template-columns: 1fr;
    }

    .quiz-question {
        padding: 20px;
    }

    .quiz-results {
        padding: 25px;
    }

    .score-text {
        font-size: 1.5em;
    }
}