/* Global Styles */
:root {
    --primary-color: #8a2be2; /* Purple */
    --primary-dark: #9932cc; /* Darker purple */
    --background-color: #121212; /* Very Dark Gray (Almost Black) */
    --container-bg: #1e1e1e; /* Dark Gray (Background) */
    --text-color: #f0f0f0; /* Off-White Text */
    --highlight-color: #4169e1; /* Royal Blue */
    --error-color: #ff5252; /* Red for errors */
    --secondary-color: #4169e1; /* Royal Blue */
    --accent-color: #9370db; /* Medium Purple */
    --dark-color: #121212; /* Very Dark Gray (Almost Black) */
    --dark-secondary: #1e1e1e; /* Dark Gray (Background) */
    --text-secondary: #c0c0c0; /* Light Gray Secondary Text */
    --shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    --border-radius: 12px;
    --timer-length: 90s;
    --timer-warning: 15s;
    --correct-color: #4CAF50;
    --incorrect-color: #f44336;
}

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

body {
    font-family: 'Arial Rounded MT Bold', 'Helvetica Rounded', Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

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

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 25px 20px;
    background-color: var(--dark-secondary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--primary-color);
    position: relative; /* For absolute positioning of credits */
    animation: scaleIn 0.7s ease-out;
    transition: all 0.4s ease;
}

header:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

header h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(138, 43, 226, 0.5);
    animation: fadeIn 1s ease-in-out;
    transition: all 0.3s ease;
}

header h1:hover {
    text-shadow: 0 0 15px rgba(138, 43, 226, 0.8);
    letter-spacing: 1px;
}

.subtitle {
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: subtitle-glow 1.5s ease-in-out infinite alternate;
    text-shadow: 0 0 5px rgba(138, 43, 226, 0.5);
}

/* Glowing subtitle when timer is running low */
.timer-warning-glow {
    animation: subtitle-glow 0.8s infinite alternate;
    text-shadow: 0 0 10px var(--primary-color), 0 0 20px var(--accent-color);
}

@keyframes subtitle-glow {
    from {
        text-shadow: 0 0 5px rgba(138, 43, 226, 0.7), 0 0 10px rgba(138, 43, 226, 0.5), 0 0 15px rgba(138, 43, 226, 0.3);
    }
    to {
        text-shadow: 0 0 10px rgba(138, 43, 226, 0.9), 0 0 20px rgba(138, 43, 226, 0.7), 0 0 30px rgba(138, 43, 226, 0.5);
    }
}

/* Credits display in top right */
.credits-display {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: rgba(65, 105, 225, 0.15);
    border: 1px solid var(--secondary-color);
    border-radius: 12px;
    padding: 10px;
    min-width: 80px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease-out;
    animation-delay: 0.3s;
    animation-fill-mode: backwards;
}

.credits-display:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
}

.credits-amount {
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-bottom: 5px;
    text-align: center;
}

.credits-store-link {
    font-size: 0.8rem;
    color: var(--accent-color);
    text-decoration: none;
    background-color: rgba(138, 43, 226, 0.2);
    padding: 3px 8px;
    border-radius: 10px;
    transition: all 0.2s ease;
    margin-top: 5px;
}

.credits-store-link:hover {
    background-color: rgba(138, 43, 226, 0.4);
    color: var(--text-color);
}

/* Section Styles */
section {
    background-color: var(--dark-secondary);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    text-align: center;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    animation: scaleIn 0.5s ease-out;
}

section h2 {
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-size: 1.8rem;
    animation: fadeInUp 0.5s ease-out;
    transition: all 0.3s ease;
}

.info {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.4;
    text-align: center;
}

/* File Upload Styles */
.file-input-container {
    margin-bottom: 20px;
}

input[type="file"] {
    display: none;
}

label[for="document-upload"] {
    display: inline-block;
    padding: 12px 20px;
    background-color: var(--accent-color);
    color: var(--text-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.3s;
}

label[for="document-upload"]:hover {
    background-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

/* Button Styles */
button {
    padding: 12px 25px;
    background-color: var(--primary-color);
    color: var(--text-color);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
}

button:hover::after {
    transform: translateX(100%);
    transition: 0.5s;
}

#submit-quiz {
    background-color: var(--secondary-color);
    margin-top: 20px;
}

#submit-quiz:hover {
    background-color: #3457c5; /* Darker blue */
}

#new-quiz-btn {
    background-color: var(--accent-color);
}

#new-quiz-btn:hover {
    background-color: var(--primary-color);
}

/* Quiz Question Styles */
.question-container {
    background-color: rgba(65, 105, 225, 0.1);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: left;
    animation: fadeInUp 0.5s ease-out;
    transition: all 0.4s ease;
}

.question-container:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.question-text {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--accent-color);
}

.options {
    margin-left: 20px;
}

.option {
    margin-bottom: 8px;
}

/* Customize radio buttons */
input[type="radio"] {
    accent-color: var(--primary-color);
}

/* Loader Styles */
.loader {
    margin: 10px auto 20px;
    border: 5px solid var(--dark-secondary);
    border-top: 5px solid var(--primary-color);
    border-right: 5px solid var(--secondary-color);
    border-bottom: 5px solid var(--accent-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Result Styles */
#score-display {
    font-size: 1.4rem;
    margin-bottom: 20px;
    text-align: center;
}

#reward-message {
    text-align: center;
    padding: 15px;
    margin: 20px 0;
    border-radius: var(--border-radius);
    font-weight: bold;
}

.success-message {
    background-color: rgba(65, 105, 225, 0.2);
    color: var(--secondary-color);
    border: 1px solid var(--secondary-color);
}

.failure-message {
    background-color: rgba(138, 43, 226, 0.2);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

/* Utility Classes */
.hidden {
    display: none !important;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

/* Footer Styles */
footer {
    text-align: center;
    margin-top: 40px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* New demo section styles */
.demo-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed #ccc;
    text-align: center;
}

#demo-btn {
    background-color: var(--accent-color);
    color: var(--dark-color);
    margin-top: 5px;
}

#demo-btn:hover {
    background-color: #ffd43b;
}

/* Error message styles */
.error-message {
    background-color: rgba(244, 67, 54, 0.1);
    border-left: 4px solid var(--error-color);
    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
    color: #f8d7da;
    font-size: 16px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.error-button-container {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.retry-button {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.retry-button:hover {
    background-color: #5a7de9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Incorrect Answers Styles */
#incorrect-answers {
    margin: 20px 0;
    padding: 15px;
    border-radius: var(--border-radius);
    background-color: var(--dark-secondary);
    border: 1px solid var(--accent-color);
}

#incorrect-answers h3 {
    color: var(--accent-color);
    font-size: 1.4rem;
    margin-bottom: 15px;
    text-align: center;
}

.incorrect-answer {
    margin-bottom: 25px;
    padding: 15px;
    border-left: 4px solid var(--primary-color);
    background-color: rgba(138, 43, 226, 0.1);
    border-radius: 8px;
}

.incorrect-answer .question-text {
    color: var(--text-color);
    margin-bottom: 10px;
}

.incorrect-answer .user-answer {
    color: var(--primary-color);
    margin-bottom: 5px;
    padding-left: 15px;
    text-decoration: line-through;
    opacity: 0.8;
}

.incorrect-answer .no-answer {
    color: var(--primary-color);
    font-style: italic;
}

.incorrect-answer .correct-answer {
    color: var(--secondary-color);
    margin-bottom: 10px;
    padding-left: 15px;
    font-weight: bold;
}

.incorrect-answer .explanation {
    color: var(--text-secondary);
    background-color: rgba(65, 105, 225, 0.1);
    padding: 10px;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.perfect-score {
    color: var(--secondary-color);
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    background-color: rgba(65, 105, 225, 0.1);
    padding: 15px;
    border-radius: 8px;
    border: 1px dashed var(--secondary-color);
}

/* Results buttons styles */
.results-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.results-buttons button {
    flex: 1;
    max-width: 220px;
}

#new-quiz-same-doc-btn {
    background-color: var(--secondary-color);
}

#new-quiz-same-doc-btn:hover {
    background-color: #3457c5; /* Darker blue */
}

.results-note {
    text-align: center;
    margin-top: 10px;
    font-style: italic;
}

/* Tab switch message */
.tab-switch-message {
    background-color: rgba(138, 43, 226, 0.2);
    color: var(--text-color);
    border: 2px solid var(--primary-color);
    padding: 15px;
    border-radius: var(--border-radius);
    text-align: center;
    margin: 20px 0;
    font-size: 1.1rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(138, 43, 226, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(138, 43, 226, 0); }
    100% { box-shadow: 0 0 0 0 rgba(138, 43, 226, 0); }
}

/* Tab switch warning */
.tab-switch-warning {
    background-color: rgba(65, 105, 225, 0.2);
    border: 1px solid var(--secondary-color);
    border-radius: var(--border-radius);
    padding: 10px 15px;
    margin: 0 0 20px 0;
}

.tab-switch-warning p {
    color: var(--text-color);
    text-align: center;
    font-size: 0.95rem;
    margin: 0;
}

.tab-switch-warning strong {
    color: var(--secondary-color);
}

/* Topic Section Styles */
.topic-description {
    background-color: rgba(138, 43, 226, 0.1);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    border-left: 4px solid var(--accent-color);
    text-align: center;
}

.topic-description h3 {
    color: var(--accent-color);
    margin-bottom: 10px;
    font-size: 1.3rem;
}

#generate-btn {
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 0 auto 20px;
    padding: 15px 25px;
    font-size: 1.1rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

#generate-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

#generate-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: 0.5s;
}

#generate-btn:hover::after {
    transform: translateX(100%);
}

/* Results Button Update */
#new-quiz-same-topic-btn {
    background-color: var(--secondary-color);
}

#new-quiz-same-topic-btn:hover {
    background-color: #3457c5; /* Darker blue */
}

/* Greeting Styles */
.greeting {
    font-size: 1.2rem;
    color: var(--accent-color);
    font-weight: bold;
    margin-top: 5px;
    animation: fadeIn 1s ease-in-out;
}

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

/* Updated Balance Animation */
.balance-animation {
    position: absolute;
    top: -10px;
    right: 0;
    opacity: 0;
    transition: all 0.5s ease-out;
}

.balance-animation.show {
    opacity: 1;
    transform: translateY(-20px);
}

.balance-animation.hidden {
    display: block;
    opacity: 0;
}

.amount-change {
    font-weight: bold;
    font-size: 1.2rem;
}

.amount-change.positive {
    color: var(--secondary-color);
}

.amount-change.negative {
    color: var(--primary-color);
}

/* Question Display */
#current-question {
    min-height: 200px;
    margin-bottom: 20px;
    animation: fadeIn 0.5s ease-in-out;
}

/* Question Feedback */
#question-feedback {
    margin: 20px 0;
    transition: all 0.3s ease-in-out;
}

.feedback-message {
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 15px;
    transition: all 0.3s ease-in-out;
}

#correct-feedback {
    background-color: rgba(65, 105, 225, 0.2);
    border: 1px solid var(--secondary-color);
    animation: slideInRight 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

#incorrect-feedback {
    background-color: rgba(138, 43, 226, 0.2);
    border: 1px solid var(--primary-color);
    animation: slideInRight 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.correct-answer-text {
    color: var(--highlight-color);
    font-weight: bold;
    font-size: 1.1rem;
    text-align: center;
}

.incorrect-answer-text {
    color: var(--error-color);
    font-weight: bold;
    font-size: 1.1rem;
    text-align: center;
}

/* Question Navigation */
.question-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.action-button {
    width: 150px;
    padding: 12px 10px;
}

#submit-answer {
    background-color: var(--primary-color);
}

#submit-answer:hover {
    background-color: var(--primary-dark);
}

#next-question {
    background-color: var(--secondary-color);
}

#next-question:hover {
    background-color: #3457c5;
}

/* Progress Bar */
.progress-container {
    margin: 30px 0 10px;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background-color: rgba(52, 152, 219, 0.2);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 10px;
}

#progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.5s ease-in-out;
}

.progress-stats {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

#correct-count {
    color: var(--secondary-color);
    font-weight: bold;
}

#incorrect-count {
    color: var(--primary-color);
    font-weight: bold;
}

/* Animation for balance changes */
@keyframes pulsate {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

#balance {
    display: inline-block;
    transition: color 0.3s ease;
}

#balance.highlight-positive {
    color: var(--secondary-color);
    animation: pulsate 0.5s ease;
}

#balance.highlight-negative {
    color: var(--primary-color);
    animation: pulsate 0.5s ease;
}

/* Make sure hidden is properly defined */
.hidden {
    display: none !important;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

/* Store Section */
#store-section {
    text-align: center;
}

.store-item {
    background-color: var(--container-bg);
    border-radius: var(--border-radius);
    padding: 25px;
    margin: 20px 0;
    border: 1px solid var(--secondary-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.store-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.store-item-details {
    margin-bottom: 20px;
    text-align: center;
}

.store-item-details h3 {
    color: var(--accent-color);
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.redeem-button {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 15px 30px;
    font-size: 1.1rem;
}

.redeem-button:hover {
    background: linear-gradient(135deg, var(--primary-color) 20%, var(--secondary-color) 80%);
}

.redeem-button:disabled {
    background: gray;
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
}

.secondary-button {
    background-color: var(--highlight-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    cursor: pointer;
    margin-top: 10px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.secondary-button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

#redemption-message {
    padding: 15px;
    border-radius: var(--border-radius);
    margin: 20px 0;
    font-weight: bold;
    animation: fadeIn 0.5s ease-in-out;
}

#redemption-message.success {
    background-color: rgba(76, 175, 80, 0.1);
    border: 1px solid var(--highlight-color);
    color: var(--highlight-color);
}

#redemption-message.error {
    background-color: rgba(231, 76, 60, 0.1);
    border: 1px solid var(--error-color);
    color: var(--error-color);
}

/* Updated Balance Animation Styling */
.amount-change.positive::before {
    content: '+';
}

.amount-change.negative::before {
    content: '-';
}

/* Loading Progress Bar */
.loading-progress-container {
    margin: 20px 0;
    width: 100%;
}

.loading-progress-bar {
    height: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

#loading-progress-fill {
    background: linear-gradient(90deg, 
        var(--primary-color), 
        var(--secondary-color), 
        var(--accent-color), 
        var(--secondary-color), 
        var(--primary-color));
    background-size: 300% 100%;
    animation: gradientShift 3s ease infinite;
    transition: width 0.3s ease;
    border-radius: 20px;
    box-shadow: 0 0 10px rgba(138, 43, 226, 0.5);
}

.loading-status {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    min-height: 20px;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Loading Styles */
#loading {
    position: relative;
    z-index: 100;
    background-color: var(--dark-secondary);
    border-radius: var(--border-radius);
    padding: 25px;
    margin: 20px 0;
    text-align: center;
    border: 1px solid var(--accent-color);
    box-shadow: var(--shadow);
    animation: fadeIn 0.3s ease-in-out;
}

#loading p {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 20px;
    font-weight: bold;
}

/* Store Page Styles */
#store-content {
    margin-bottom: 40px;
}

.store-intro {
    background-color: rgba(65, 105, 225, 0.1);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 30px;
    text-align: center;
    border-left: 5px solid var(--secondary-color);
    font-size: 1.1rem;
}

.store-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Redemption History */
#redemption-history {
    margin-top: 40px;
}

#redemption-history h2 {
    color: var(--accent-color);
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 1px solid var(--accent-color);
    padding-bottom: 10px;
}

.history-item {
    background-color: rgba(65, 105, 225, 0.1);
    border-radius: var(--border-radius);
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s ease;
}

.history-item:hover {
    transform: translateX(5px);
}

.history-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.history-reward {
    color: var(--secondary-color);
    font-weight: bold;
}

.no-history {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 20px;
}

/* Timer Styles */
.timer-container {
    margin: 15px 0;
    text-align: center;
}

.timer-bar {
    height: 10px;
    background-color: rgba(52, 152, 219, 0.2);
    border-radius: 5px;
    margin-bottom: 5px;
    overflow: hidden;
    border: 1px solid var(--secondary-color);
}

#timer-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(to right, var(--accent-color), var(--secondary-color));
    transition: width 1s linear;
}

.timer-text {
    font-size: 0.9rem;
    color: var(--text-color);
    font-weight: bold;
}

#timer-display {
    font-family: monospace;
}

/* Timer Low Warning Animation */
@keyframes pulse-warning {
    0% { background-color: #ff3860; }
    50% { background-color: #ff7e9d; }
    100% { background-color: #ff3860; }
}

.timer-warning #timer-fill {
    background: #ff3860;
    animation: pulse-warning 1s infinite;
}

.timer-warning .timer-text {
    color: #ff3860;
}

/* Streak Counter Styles */
.streak-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 15px;
    gap: 10px;
    padding: 10px;
    background-color: rgba(138, 43, 226, 0.1);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.streak-label {
    font-size: 0.9rem;
    color: var(--text-color);
}

.streak-count {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent-color);
    display: flex;
    align-items: center;
}

#streak-count {
    margin-right: 5px;
}

/* Streak Counter Animation */
@keyframes streak-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.streak-highlight {
    animation: streak-pulse 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Mode Selector Styles */
.mode-selector {
    background-color: var(--dark-secondary);
    border-radius: var(--border-radius);
    padding: 20px;
    margin: 20px 0;
    text-align: center;
    border: 1px solid var(--accent-color);
}

.mode-selector h3 {
    color: var(--accent-color);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.mode-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.mode-button {
    background-color: var(--container-bg);
    color: var(--text-color);
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    padding: 10px 20px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-button:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

.mode-button.selected {
    background-color: var(--primary-color);
    color: white;
}

.mode-details {
    background-color: rgba(65, 105, 225, 0.1);
    border-radius: var(--border-radius);
    padding: 15px;
    max-width: 400px;
    margin: 0 auto;
}

.mode-details h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.mode-description {
    color: var(--text-color);
    text-align: center;
    line-height: 1.6;
    margin-top: 5px;
}

/* Themes Button */
.themes-button-container {
    position: absolute;
    top: 20px;
    left: 20px;
}

.themes-button {
    display: inline-block;
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.themes-button:hover {
    background-color: var(--primary-dark);
}

/* Themes Page */
#themes-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.themes-intro {
    text-align: center;
    margin-bottom: 30px;
}

.themes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.theme-item {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.theme-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.theme-item.selected {
    border-color: #4CAF50;
}

.theme-preview {
    height: 150px;
    width: 100%;
    position: relative;
}

.preview-header {
    height: 30%;
    width: 100%;
}

.preview-content {
    height: 70%;
    width: 100%;
}

/* Theme Preview Styles - updating to match actual themes */
.default-theme .preview-header {
    background-color: #8a2be2; /* Purple */
}

.default-theme .preview-content {
    background-color: #1e1e1e; /* Dark Gray */
}

.light-theme .preview-header {
    background-color: #3498db; /* Blue */
}

.light-theme .preview-content {
    background-color: #f5f5f5; /* Light Gray */
}

.dark-theme .preview-header {
    background-color: #2c3e50;
}

.dark-theme .preview-content {
    background-color: #34495e;
}

.ocean-theme .preview-header {
    background-color: #1abc9c;
}

.ocean-theme .preview-content {
    background-color: #e0f7fa;
}

.forest-theme .preview-header {
    background-color: #27ae60;
}

.forest-theme .preview-content {
    background-color: #e8f5e9;
}

.royal-theme .preview-header {
    background-color: #8e44ad;
}

.royal-theme .preview-content {
    background-color: #f3e5f5;
}

.sunset-theme .preview-header {
    background-color: #e74c3c;
}

.sunset-theme .preview-content {
    background-color: #fff8e1;
}

.theme-details {
    padding: 15px;
    background-color: white;
}

.theme-details h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

.theme-details p {
    margin: 5px 0;
    color: #666;
}

.theme-status {
    color: #4CAF50;
    font-weight: bold;
}

.theme-price {
    color: #e74c3c;
    font-weight: bold;
}

.theme-select-btn, .theme-unlock-btn {
    width: 100%;
    padding: 10px;
    border: none;
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.theme-select-btn:hover, .theme-unlock-btn:hover {
    background-color: var(--primary-dark);
}

.theme-select-btn:disabled {
    background-color: var(--highlight-color);
    cursor: default;
}

#theme-message {
    text-align: center;
    padding: 15px;
    margin-top: 20px;
    border-radius: 4px;
}

#theme-message.success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

#theme-message.error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

/* Theme CSS Variables - Will be applied dynamically */
:root {
    --primary-color: #8a2be2; /* Purple */
    --primary-dark: #9932cc; /* Darker purple */
    --background-color: #121212; /* Very Dark Gray (Almost Black) */
    --container-bg: #1e1e1e; /* Dark Gray (Background) */
    --text-color: #f0f0f0; /* Off-White Text */
    --highlight-color: #4169e1; /* Royal Blue */
    --error-color: #ff5252; /* Red for errors */
}

/* Screenshot message styling */
.screenshot-message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--container-bg);
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    padding: 15px;
    box-shadow: var(--shadow);
    z-index: 1000;
    max-width: 300px;
    color: var(--text-color);
}

.screenshot-message h3 {
    color: var(--primary-color);
    margin-top: 0;
}

/* Table styles for quiz questions */
.question-container table,
.explanation table,
.message-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 0.9em;
    background-color: rgba(30, 30, 30, 0.8);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    text-align: left; /* Ensure all table content is left-aligned by default */
}

.question-container th,
.explanation th,
.message-content th {
    background-color: var(--primary-color);
    color: var(--text-color);
    font-weight: bold;
    text-align: left; /* Explicitly set headers to left-align */
    padding: 12px 15px;
}

.question-container td,
.explanation td,
.message-content td {
    padding: 10px 15px;
    border-bottom: 1px solid rgba(150, 150, 150, 0.2);
    text-align: left; /* Explicitly set cells to left-align */
}

.question-container tr:last-child td,
.explanation tr:last-child td,
.message-content tr:last-child td {
    border-bottom: none;
}

.question-container tr:nth-child(even),
.explanation tr:nth-child(even),
.message-content tr:nth-child(even) {
    background-color: rgba(60, 60, 60, 0.3);
}

.question-container tr:hover,
.explanation tr:hover,
.message-content tr:hover {
    background-color: rgba(80, 80, 80, 0.4);
}

/* Make tables responsive for smaller screens */
@media (max-width: 768px) {
    .question-container table,
    .explanation table,
    .message-content table {
        font-size: 0.85em;
    }
    
    .question-container th,
    .explanation th,
    .message-content th,
    .question-container td,
    .explanation td,
    .message-content td {
        padding: 8px 10px;
    }
}

/* Custom topic input section styles */
.topic-input-container {
    margin: 20px 0;
}

#custom-topic-input {
    width: 100%;
    min-height: 100px;
    padding: 15px;
    border-radius: var(--border-radius);
    background-color: rgba(30, 30, 30, 0.6);
    border: 1px solid var(--primary-color);
    color: var(--text-color);
    font-size: 16px;
    resize: vertical;
    font-family: inherit;
}

#custom-topic-input:focus {
    outline: none;
    border-color: var(--highlight-color);
    box-shadow: 0 0 8px rgba(65, 105, 225, 0.5);
}

.input-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.input-actions button {
    min-width: 150px;
}

/* Theme-specific overrides */
.theme-default button, 
.theme-dark button {
    background: linear-gradient(to bottom right, var(--primary-color), var(--primary-dark));
}

.theme-ocean button,
.theme-forest button,
.theme-royal button,
.theme-sunset button,
.theme-light button {
    background: var(--primary-color);
    color: #fff;
    border: none;
}

/* Input styling */
.theme-default input[type="radio"] + label,
.theme-dark input[type="radio"] + label {
    background-color: rgba(30, 30, 40, 0.7);
}

.theme-ocean input[type="radio"] + label,
.theme-forest input[type="radio"] + label,
.theme-royal input[type="radio"] + label,
.theme-sunset input[type="radio"] + label,
.theme-light input[type="radio"] + label {
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Progress bar styling */
.theme-default .progress-bar, .theme-dark .progress-bar {
    background-color: rgba(40, 40, 40, 0.6);
}

.theme-ocean .progress-bar, .theme-forest .progress-bar, 
.theme-royal .progress-bar, .theme-sunset .progress-bar,
.theme-light .progress-bar {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Question container styling */
.theme-default .question-container, .theme-dark .question-container {
    background-color: rgba(40, 40, 40, 0.6);
}

.theme-ocean .question-container, .theme-forest .question-container,
.theme-royal .question-container, .theme-sunset .question-container,
.theme-light .question-container {
    background-color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Quiz section styling */
.theme-default #quiz-section h2, .theme-dark #quiz-section h2 {
    color: var(--text-color);
}

.theme-ocean #quiz-section h2, .theme-forest #quiz-section h2,
.theme-royal #quiz-section h2, .theme-sunset #quiz-section h2,
.theme-light #quiz-section h2 {
    color: var(--primary-dark);
}

/* Feedback message styling */
.theme-default .feedback-message, .theme-dark .feedback-message {
    background-color: rgba(30, 30, 40, 0.9);
    border: 1px solid var(--primary-color);
}

.theme-ocean .feedback-message, .theme-forest .feedback-message,
.theme-royal .feedback-message, .theme-sunset .feedback-message,
.theme-light .feedback-message {
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--primary-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Mode selector styling */
.theme-default .mode-selector, .theme-dark .mode-selector {
    background-color: rgba(40, 40, 40, 0.6);
}

.theme-ocean .mode-selector, .theme-forest .mode-selector,
.theme-royal .mode-selector, .theme-sunset .mode-selector,
.theme-light .mode-selector {
    background-color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Mode details styling */
.theme-default .mode-details, .theme-dark .mode-details {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-ocean .mode-details, .theme-forest .mode-details,
.theme-royal .mode-details, .theme-sunset .mode-details,
.theme-light .mode-details {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Topic description styling */
.theme-default .topic-description, .theme-dark .topic-description {
    background-color: rgba(40, 40, 40, 0.6);
}

.theme-ocean .topic-description, .theme-forest .topic-description,
.theme-royal .topic-description, .theme-sunset .topic-description,
.theme-light .topic-description {
    background-color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Custom topic input field styling */
.theme-default #custom-topic-input, .theme-dark #custom-topic-input {
    background-color: rgba(30, 30, 40, 0.7);
    border: 1px solid var(--primary-color);
}

.theme-ocean #custom-topic-input, .theme-forest #custom-topic-input,
.theme-royal #custom-topic-input, .theme-sunset #custom-topic-input,
.theme-light #custom-topic-input {
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--primary-color);
}

/* Header styling */
.theme-default header, .theme-dark header {
    background-color: rgba(40, 40, 40, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-ocean header, .theme-forest header,
.theme-royal header, .theme-sunset header,
.theme-light header {
    background-color: var(--primary-color);
    border-bottom: none;
}

/* Header text styling */
.theme-ocean header h1, .theme-forest header h1,
.theme-royal header h1, .theme-sunset header h1,
.theme-light header h1,
.theme-ocean .subtitle, .theme-forest .subtitle,
.theme-royal .subtitle, .theme-sunset .subtitle,
.theme-light .subtitle {
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Credits display */
.theme-ocean .credits-amount, .theme-forest .credits-amount,
.theme-royal .credits-amount, .theme-sunset .credits-amount,
.theme-light .credits-amount {
    background-color: rgba(255, 255, 255, 0.25);
    color: white;
}

.theme-ocean .credits-store-link, .theme-forest .credits-store-link,
.theme-royal .credits-store-link, .theme-sunset .credits-store-link,
.theme-light .credits-store-link {
    color: white;
    background-color: rgba(0, 0, 0, 0.2);
}

/* Results section */
.theme-default #results-section, .theme-dark #results-section {
    background-color: var(--container-bg);
}

.theme-ocean #results-section, .theme-forest #results-section,
.theme-royal #results-section, .theme-sunset #results-section,
.theme-light #results-section {
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Footer styling */
.theme-default footer, .theme-dark footer {
    background-color: rgba(20, 20, 20, 0.8);
}

.theme-ocean footer, .theme-forest footer,
.theme-royal footer, .theme-sunset footer,
.theme-light footer {
    background-color: var(--primary-dark);
    color: white;
}

/* Class Selection Styles */
#class-selection-section {
    text-align: center;
    padding: 2rem;
    background-color: var(--container-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    animation: fadeIn 0.8s ease-out;
}

#class-selection-section h2 {
    color: var(--primary-color);
    font-size: 2.2rem;
    margin-bottom: 1rem;
    text-shadow: 0 0 15px rgba(138, 43, 226, 0.6);
    animation: fadeInUp 0.5s ease-out;
    transition: all 0.3s ease;
}

#class-selection-section h2:hover {
    text-shadow: 0 0 20px rgba(138, 43, 226, 0.8);
}

.class-cards {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.class-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.8), rgba(40, 40, 40, 0.9));
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

.class-card:hover {
    transform: translateY(-15px) rotateY(5deg) scale(1.03);
}

.class-icon {
    font-size: 3.5rem;
    transition: all 0.5s ease;
    text-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.class-card:hover .class-icon {
    transform: translateZ(20px);
    text-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

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

.class-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    flex-grow: 1;
    font-size: 0.95rem;
    line-height: 1.5;
}

.select-class-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: auto;
    position: relative;
    overflow: hidden;
}

.select-class-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.select-class-btn::after {
    content: '';
    position: absolute;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    width: 100%;
    height: 100%;
    top: 0;
    left: -100%;
    transition: all 0.5s ease;
}

.select-class-btn:hover::after {
    left: 100%;
}

#back-to-classes-btn {
    margin-top: 1rem;
    background-color: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
}

#back-to-classes-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Chatbot Interface Styles */
#chatbot-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeIn 0.5s ease-out;
}

.chatbot-header {
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.85), rgba(40, 40, 40, 0.95));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.chatbot-header h2 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 10px rgba(138, 43, 226, 0.5);
}

.chatbot-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 1.5rem;
    font-size: 1.2rem;
    transform: perspective(800px) rotateX(0deg);
    transition: all 0.5s ease;
}

.chatbot-score, .chatbot-streak {
    padding: 0.5rem 1.5rem;
    background-color: rgba(20, 20, 20, 0.5);
    border-radius: 50px;
    font-weight: 500;
}

.chat-container {
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.8), rgba(40, 40, 40, 0.9));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    min-height: 400px;
    max-height: 600px;
    display: flex;
    flex-direction: column;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    animation: scaleIn 0.5s ease-out;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 300px;
}

.message {
    max-width: 85%;
    padding: 0.8rem 1.2rem;
    border-radius: 18px;
    animation: fadeInUp 0.3s cubic-bezier(0.215, 0.61, 0.355, 1);
    line-height: 1.5;
}

.user-message {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--primary-color) 0%, rgba(147, 73, 240, 0.9) 100%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    color: white;
    border-bottom-right-radius: 5px;
    transform-origin: bottom right;
}

.bot-message {
    align-self: flex-start;
    background: rgba(40, 40, 40, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    color: var(--text-color);
    border-bottom-left-radius: 5px;
    transform-origin: bottom left;
}

.system-message {
    align-self: center;
    background: rgba(65, 105, 225, 0.15);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(65, 105, 225, 0.2);
    color: var(--text-secondary);
    border-radius: 10px;
    font-style: italic;
    text-align: center;
    max-width: 90%;
    animation: scaleIn 0.4s ease-out;
}

.correct-message {
    border-left: 4px solid var(--correct-color);
}

.incorrect-message {
    border-left: 4px solid var(--incorrect-color);
}

.message-content {
    word-wrap: break-word;
}

.chat-input-container {
    padding: 5px 10px;
    margin: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(20, 20, 20, 0.3);
    border-radius: 25px;
    z-index: 5;
}

#chat-input {
    flex: 1;
    background-color: rgba(20, 20, 20, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-color);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: all 0.3s ease;
}

#chat-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(138, 43, 226, 0.25);
}

.chat-send-btn {
    border-radius: 50%;
    width: 45px;
    height: 45px;
    min-width: 45px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.chat-send-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.chat-send-btn:active {
    transform: translateY(0) scale(0.95);
}

.chat-send-btn svg {
    transition: all 0.3s ease;
    color: white;
}

.chat-send-btn:hover svg {
    transform: translateX(2px);
}

/* Add chat interaction styling back */
.chat-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.chat-controls button {
    min-width: 150px;
}

/* Typing indicator styling */
.typing-indicator {
    padding: 8px 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.typing-indicator span {
    display: block;
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    opacity: 0.4;
    transform-origin: center;
}

.typing-indicator span:nth-child(1) {
    animation: typing-dot 1.2s infinite ease-in-out -0.4s;
}

.typing-indicator span:nth-child(2) {
    animation: typing-dot 1.2s infinite ease-in-out -0.2s;
}

.typing-indicator span:nth-child(3) {
    animation: typing-dot 1.2s infinite ease-in-out;
}

@keyframes typing-dot {
    0%, 60%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-5px) scale(1.2);
        opacity: 1;
    }
}

/* Make tables responsive */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
}

/* Math and chemistry formatting styles */
.math-expr {
    font-family: 'Times New Roman', Times, serif;
    font-style: italic;
    white-space: normal;
    display: inline-block;
    line-height: 1.4;
    margin: 0 2px;
}

.chemical-notation {
    font-family: 'Times New Roman', Times, serif;
    font-style: normal;
    display: inline-block;
    line-height: 1.2;
    margin: 0 2px;
    white-space: nowrap;
    padding: 1px 0;
}

.chemical-subscript {
    display: inline-block;
    font-size: 75%;
    line-height: 0;
    position: relative;
    bottom: -0.3em;
    margin-left: 1px;
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes glowPulse {
    0% {
        box-shadow: 0 0 5px rgba(138, 43, 226, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(138, 43, 226, 0.8), 0 0 30px rgba(65, 105, 225, 0.5);
    }
    100% {
        box-shadow: 0 0 5px rgba(138, 43, 226, 0.5);
    }
}
