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

body {
    font-family: 'Zain', sans-serif;
    background: #8A6BF8;
    min-height: 100vh;
    color: #333;
}

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

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 1s ease-out;
}

.logo-link {
    text-decoration: none;
    display: inline-block;
    transition: transform 0.3s ease;
    margin-bottom: 20px;
}

.logo-link:hover {
    transform: scale(1.05);
}

.logo {
    max-width: 300px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

/* Keep the old title styles for fallback if needed */
.title {
    font-family: 'Zain', sans-serif;
    font-size: 3.5em;
    color: #fff;
    text-shadow: 3px 3px 0px #ff6b6b, 6px 6px 0px #4ecdc4;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.3em;
    color: #fff;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    margin-bottom: 20px;
}

.header-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.header-btn {
    background: linear-gradient(45deg, #ffd89b, #19547b);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    opacity: 1;
    transform: scale(1);
}

.header-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

/* Smooth transitions for authentication-based visibility */
.header-btn[style*="display: none"] {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

.header-btn[style*="display: inline-block"] {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

/* Section Styles */
.section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: fadeInUp 1s ease-out;
}

/* Sign In Prompt Styles */
.sign-in-prompt-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    padding: 40px 20px;
}

.sign-in-prompt-icon {
    font-size: 4em;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

.sign-in-prompt-content h2 {
    font-family: 'Zain', sans-serif;
    font-size: 2.5em;
    color: #5a67d8;
    margin-bottom: 20px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.sign-in-prompt-description {
    font-size: 1.2em;
    color: #666;
    line-height: 1.6;
    margin-bottom: 30px;
}

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

.feature-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(90, 103, 216, 0.1);
    border-radius: 15px;
    border: 2px solid rgba(90, 103, 216, 0.2);
    transition: all 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(90, 103, 216, 0.2);
    border-color: rgba(90, 103, 216, 0.4);
}

.feature-icon {
    font-size: 1.5em;
    min-width: 30px;
}

.feature-item span:last-child {
    font-weight: 600;
    color: #5a67d8;
}

.sign-in-actions {
    margin-top: 30px;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Parent Verification Modal Styles */
.verification-content {
    text-align: center;
    padding: 20px 0;
}

.verification-description {
    font-size: 1.1em;
    color: #666;
    margin-bottom: 25px;
    line-height: 1.5;
}

.math-problem {
    background: rgba(90, 103, 216, 0.1);
    border: 2px solid rgba(90, 103, 216, 0.3);
    border-radius: 15px;
    padding: 25px;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

#math-question {
    font-size: 1.5em;
    font-weight: 600;
    color: #5a67d8;
    margin-bottom: 10px;
}

#math-answer {
    font-size: 1.2em;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 10px;
    text-align: center;
    width: 120px;
    transition: border-color 0.3s ease;
}

#math-answer:focus {
    outline: none;
    border-color: #5a67d8;
    box-shadow: 0 0 0 3px rgba(90, 103, 216, 0.1);
}

.verification-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

.verification-feedback {
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    font-weight: 600;
}

.verification-feedback.success {
    background: rgba(34, 197, 94, 0.1);
    border: 2px solid rgba(34, 197, 94, 0.3);
    color: #16a34a;
}

.verification-feedback.error {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid rgba(239, 68, 68, 0.3);
    color: #dc2626;
}

@media (max-width: 768px) {
    .verification-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .math-problem {
        padding: 20px;
    }
    
    #math-question {
        font-size: 1.3em;
    }
}

.hidden {
    display: none !important;
}

/* Tab Navigation Styles */
.tab-navigation {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    gap: 10px;
}

.tab-btn {
    background: linear-gradient(45deg, #e2e8f0, #cbd5e0);
    color: #5a67d8;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.tab-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

.tab-btn.active {
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
}

/* Tab Content Styles */
.tab-content {
    margin-bottom: 30px;
}

.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Word Selection Styles */
.word-cloud-container h2,
.type-words-container h2 {
    font-family: 'Zain', sans-serif;
    color: #5a67d8;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.5em;
}

/* Word Cloud */
.word-cloud-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.word-cloud-header h2 {
    margin-bottom: 0;
    flex: 1;
    min-width: 200px;
}

.refresh-btn {
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    white-space: nowrap;
}

.refresh-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
    background: linear-gradient(45deg, #44a08d, #4ecdc4);
}

.refresh-btn:active {
    transform: translateY(0) scale(0.98);
}

.word-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    max-width: 400px;
    margin: 0 auto;
}

.word-bubble {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.9em;
    user-select: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.word-bubble:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

.word-bubble.selected {
    background: linear-gradient(45deg, #ffd89b, #19547b);
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 215, 155, 0.6);
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Zain', sans-serif;
    font-size: 1.2em;
    color: #5a67d8;
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    width: 2px;
    height: 60px;
    background: linear-gradient(to bottom, transparent, #5a67d8, transparent);
    position: absolute;
}

.divider::before {
    top: -80px;
}

.divider::after {
    bottom: -80px;
}

/* Word Inputs */
.word-inputs {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 300px;
    margin: 0 auto;
}

/* Safety Notice */
.safety-notice {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 2px solid #fdcb6e;
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.safety-notice p {
    margin: 0;
    font-size: 0.95em;
    color: #856404;
    font-weight: 500;
}

/* Word Guidance */
.word-guidance {
    background: linear-gradient(135deg, #d1ecf1, #bee5eb);
    border: 2px solid #17a2b8;
    border-radius: 15px;
    padding: 15px;
    margin-top: 20px;
    text-align: center;
}

.word-guidance p {
    margin: 0;
    font-size: 0.95em;
    color: #0c5460;
    font-weight: 500;
}

/* Subscription Status */
.subscription-status {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 15px;
    padding: 15px;
    margin: 20px 0;
    text-align: center;
    color: white;
}

.subscription-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

#subscription-type {
    font-weight: 600;
    font-size: 1.1em;
}

#credits-remaining {
    font-size: 0.95em;
    opacity: 0.9;
}

#upgrade-subscription-btn {
    background: linear-gradient(45deg, #ffd89b, #19547b);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
}

#upgrade-subscription-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Subscription Modal */
.subscription-plans {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.plan-card {
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.plan-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.plan-card.premium {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: #4c51bf;
    color: white;
}

.plan-card h3 {
    margin: 0 0 10px 0;
    font-size: 1.3em;
    font-weight: 600;
}

.plan-price {
    font-size: 1.5em;
    font-weight: 700;
    margin: 10px 0;
    color: #4c51bf;
}

.plan-card.premium .plan-price {
    color: #ffd89b;
}

.plan-card ul {
    list-style: none;
    padding: 0;
    margin: 15px 0;
    text-align: left;
}

.plan-card li {
    padding: 5px 0;
    position: relative;
    padding-left: 20px;
}

.plan-card li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #48bb78;
    font-weight: bold;
}

.plan-card.premium li:before {
    color: #ffd89b;
}

@media (max-width: 768px) {
    .subscription-plans {
        grid-template-columns: 1fr;
    }
    
    .subscription-info {
        flex-direction: column;
        gap: 10px;
    }
}

.word-inputs input {
    padding: 12px 20px;
    border: 3px solid #e2e8f0;
    border-radius: 15px;
    font-size: 1.1em;
    text-align: center;
    transition: all 0.3s ease;
    font-family: 'Zain', sans-serif;
}

.word-inputs input:focus {
    outline: none;
    border-color: #4ecdc4;
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.3);
    transform: scale(1.02);
}

/* Selected Words Display */
.selected-words {
    text-align: center;
    margin-bottom: 30px;
}

.selected-words h3 {
    font-family: 'Zain', sans-serif;
    color: #5a67d8;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.chosen-words-display {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.chosen-word {
    background: linear-gradient(45deg, #a8edea, #fed6e3);
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
    min-width: 80px;
    display: inline-block;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.chosen-word.filled {
    background: linear-gradient(45deg, #ffd89b, #19547b);
    color: white;
    transform: scale(1.05);
}

/* Story Options */
.story-options {
    text-align: center;
    margin-bottom: 30px;
}

.story-options h3 {
    font-family: 'Zain', sans-serif;
    color: #5a67d8;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.length-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.length-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px 15px;
    border-radius: 15px;
    background: linear-gradient(45deg, #f7fafc, #edf2f7);
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
    min-width: 140px;
}

.length-option:hover {
    border-color: #4ecdc4;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.length-option input[type="radio"] {
    margin-right: 8px;
    transform: scale(1.2);
}

.length-option input[type="radio"]:checked + .option-label {
    color: #4ecdc4;
    font-weight: 600;
}

.option-label {
    font-size: 0.9em;
    color: #4a5568;
    transition: color 0.3s ease;
}

/* Generate Button */
.generate-btn {
    display: block;
    margin: 0 auto;
    padding: 15px 40px;
    font-size: 1.3em;
    font-family: 'Zain', sans-serif;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.generate-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Story Section */
.story-header {
    text-align: center;
    margin-bottom: 30px;
}

.story-header h2 {
    font-family: 'Zain', sans-serif;
    color: #5a67d8;
    font-size: 2em;
    margin-bottom: 20px;
}

.story-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.nav-btn {
    padding: 10px 20px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.nav-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.nav-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.page-counter {
    font-weight: 600;
    color: #5a67d8;
    font-size: 1.1em;
}

/* Story Content */
.story-page {
    background: linear-gradient(135deg, #ffecd2, #fcb69f);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 4px 8px rgba(0,0,0,0.1);
}

.story-content {
    text-align: center;
    font-size: 1.8em;
    line-height: 1.6;
    color: #333;
    font-weight: 600;
    max-width: 600px;
}

/* Quiz Word Highlighting */
.quiz-word-highlight {
    background: linear-gradient(120deg, #ffd89b 0%, #19547b 100%);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 600;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    cursor: help;
    position: relative;
}

.quiz-word-highlight:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    animation-play-state: paused;
}

.quiz-word-highlight::after {
    content: "📝";
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 0.8em;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.quiz-word-highlight:hover::after {
    opacity: 1;
}

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

/* Story Actions */
.story-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 12px 25px;
    font-size: 1.1em;
    font-weight: 600;
    background: linear-gradient(45deg, #a8edea, #fed6e3);
    color: #333;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

/* My Stories Section */
.stories-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.stories-header h2 {
    font-family: 'Zain', sans-serif;
    color: #5a67d8;
    margin: 0;
    font-size: 1.8em;
}

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

.story-card {
    background: linear-gradient(135deg, #a8edea, #fed6e3);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.story-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border-color: #4ecdc4;
}

.story-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.story-title {
    font-family: 'Zain', sans-serif;
    color: #5a67d8;
    font-size: 1.2em;
    margin: 0;
    flex: 1;
}

.story-date {
    font-size: 0.8em;
    color: #666;
    margin: 0;
}

.story-words {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.story-word-tag {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: 600;
}

.story-preview {
    color: #333;
    font-size: 0.9em;
    line-height: 1.4;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.story-card-actions {
    display: flex;
    gap: 10px;
}

.story-card-btn {
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8em;
    transition: all 0.3s ease;
    flex: 1;
}

.story-card-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.3);
}

.story-card-btn.delete {
    background: linear-gradient(45deg, #ff6b6b, #ee5a52);
    flex: 0 0 auto;
    padding: 8px 12px;
}

.story-card-btn.delete:hover {
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.no-stories-message {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 1.1em;
}

.no-stories-message p {
    margin: 0;
}

/* Settings Button */
.settings-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 8px 16px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

.modal-header {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-family: 'Zain', sans-serif;
    font-size: 1.5em;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2em;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 30px;
}

.setting-group {
    margin-bottom: 25px;
}

.setting-group label {
    display: block;
    font-weight: 600;
    color: #5a67d8;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.setting-group input[type="password"],
.setting-group input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.setting-group input:focus {
    outline: none;
    border-color: #4ecdc4;
}

.help-text {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
}

.help-text a {
    color: #4ecdc4;
    text-decoration: none;
}

.help-text a:hover {
    text-decoration: underline;
}

.setting-group input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
}

.setting-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.save-btn, .clear-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

.save-btn {
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    color: white;
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(78, 205, 196, 0.3);
}

.clear-btn {
    background: linear-gradient(45deg, #ff6b6b, #ee5a52);
    color: white;
}

.clear-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
}

/* Loading Animation */
.loading {
    text-align: center;
    padding: 40px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #e2e8f0;
    border-top: 6px solid #4ecdc4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading p {
    font-size: 1.2em;
    color: #5a67d8;
    font-weight: 600;
}

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

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

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

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .logo {
        max-width: 250px;
    }

    .sign-in-prompt-content {
        padding: 30px 15px;
    }

    .sign-in-prompt-content h2 {
        font-size: 2em;
    }

    .sign-in-prompt-description {
        font-size: 1.1em;
    }

    .sign-in-features {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .feature-item {
        padding: 12px;
    }

    .title {
        font-size: 2.5em;
    }
    
    .header-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .header-btn, .settings-btn {
        width: 100%;
        max-width: 250px;
        margin: 0 auto;
    }
    
    .tab-navigation {
        flex-direction: column;
        gap: 8px;
    }
    
    .tab-btn {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .word-cloud-header {
        flex-direction: column;
        text-align: center;
    }
    
    .word-cloud-header h2 {
        min-width: auto;
    }
    
    .refresh-btn {
        align-self: center;
    }
    
    .stories-header {
        flex-direction: column;
        text-align: center;
    }
    
    .saved-stories {
        grid-template-columns: 1fr;
    }
    
    .story-card-actions {
        flex-direction: column;
    }
    
    .story-content {
        font-size: 1.4em;
    }
    
    .story-navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .length-options {
        flex-direction: column;
        gap: 10px;
    }
    
    .length-option {
        min-width: auto;
        justify-content: center;
    }
}

.custom-pronouns {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.custom-pronouns input {
    flex: 1 1 80px;
    min-width: 80px;
    max-width: 120px;
    padding: 8px 10px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1em;
    text-align: center;
    font-family: 'Zain', sans-serif;
}

.custom-pronouns input:focus {
    outline: none;
    border-color: #4ecdc4;
    box-shadow: 0 0 0 2px rgba(78, 205, 196, 0.2);
}

#settings-modal .setting-group, #welcome-modal .setting-group {
    margin-bottom: 18px;
}

#settings-modal .modal-content, #welcome-modal .modal-content {
    max-width: 400px;
}

/* Form Elements and Labels */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    background-color: #fff;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus,
.form-group select:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.form-group input[type="text"]::placeholder,
.form-group input[type="password"]::placeholder {
    color: #999;
    font-style: italic;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
}

.form-group small a {
    color: #4a90e2;
    text-decoration: none;
}

.form-group small a:hover {
    text-decoration: underline;
}

/* Pronoun inputs styling */
.pronoun-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.pronoun-inputs input {
    padding: 0.6rem;
    font-size: 0.9rem;
}

/* Form actions */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e1e5e9;
}

.form-actions button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

.form-actions button[type="submit"] {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: white;
}

.form-actions button[type="submit"]:hover {
    background: linear-gradient(135deg, #357abd, #2c5aa0);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.form-actions button[type="button"] {
    background: #f8f9fa;
    color: #666;
    border: 2px solid #e1e5e9;
}

.form-actions button[type="button"]:hover {
    background: #e9ecef;
    border-color: #ced4da;
    color: #495057;
}

/* Modal specific styling */
.modal-content {
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid #e1e5e9;
}

.modal-header h2 {
    margin: 0;
    color: #333;
    font-size: 1.5rem;
    font-weight: 700;
}

.modal-body {
    padding: 1.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .pronoun-inputs {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .modal-content {
        width: 95%;
        margin: 2.5vh auto;
    }
    
    .modal-header,
    .modal-body {
        padding: 1rem;
    }
}

/* Story Type Styling */
.story-type-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.story-type-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    background-color: #fff;
    transition: all 0.3s ease;
    box-sizing: border-box;
    cursor: pointer;
}

.story-type-select:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.story-type-select option {
    padding: 0.5rem;
    font-size: 1rem;
}

/* Story Length Styling */
.length-options {
    margin-bottom: 1.5rem;
}

.length-option {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.length-option:hover {
    background-color: #f8f9fa;
}

.length-option input[type="radio"] {
    margin-right: 0.75rem;
    transform: scale(1.1);
    accent-color: #4a90e2;
}

.option-label {
    font-size: 0.95rem;
    color: #333;
    font-weight: 500;
}

/* SSO Sign-In Styling */
.sso-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.sso-description {
    text-align: center;
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.4;
}

.sso-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    color: #333;
    text-decoration: none;
    width: 100%;
}

.sso-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sso-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Google Button */
.google-btn {
    border-color: #4285f4;
    color: #4285f4;
}

.google-btn:hover {
    background: #4285f4;
    color: white;
    border-color: #4285f4;
}

/* Apple Button */
.apple-btn {
    border-color: #000;
    color: #000;
}

.apple-btn:hover {
    background: #000;
    color: white;
    border-color: #000;
}

/* Guest Button */
.guest-btn {
    border-color: #6c757d;
    color: #6c757d;
    background: #f8f9fa;
}

.guest-btn:hover {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}

/* Divider */
.sso-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: #666;
    font-size: 0.9rem;
}

.sso-divider::before,
.sso-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e1e5e9;
}

.sso-divider span {
    padding: 0 1rem;
    background: white;
}

/* Footer */
.sso-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e1e5e9;
}

.privacy-note {
    font-size: 0.8rem;
    color: #666;
    line-height: 1.4;
    margin: 0;
}

.privacy-note a {
    color: #4a90e2;
    text-decoration: none;
}

.privacy-note a:hover {
    text-decoration: underline;
}

/* User Profile Section */
.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #4a90e2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 600;
    color: #333;
    margin: 0;
    font-size: 0.95rem;
}

.user-email {
    color: #666;
    margin: 0;
    font-size: 0.8rem;
}

.sign-out-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    transition: background-color 0.2s ease;
}

.sign-out-btn:hover {
    background: #e9ecef;
    color: #333;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sso-btn {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }
    
    .sso-icon {
        width: 24px;
        height: 24px;
    }
    
    .user-profile {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
}

/* Disabled Features Styling */
.disabled {
    opacity: 0.4;
    cursor: not-allowed !important;
    pointer-events: none !important;
    user-select: none !important;
    position: relative;
}

.disabled::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: inherit;
    z-index: 1;
}

.disabled input[type="radio"] {
    cursor: not-allowed !important;
    pointer-events: none !important;
    user-select: none !important;
}

.disabled .option-label {
    color: #999 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    user-select: none !important;
}

/* Story Length Options - Disabled State */
.length-option.disabled {
    opacity: 0.3;
    cursor: not-allowed !important;
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    pointer-events: none !important;
    user-select: none !important;
}

.length-option.disabled input[type="radio"] {
    cursor: not-allowed !important;
    pointer-events: none !important;
    user-select: none !important;
}

.length-option.disabled .option-label {
    color: #999;
    cursor: not-allowed !important;
    pointer-events: none !important;
    user-select: none !important;
}

.length-option.disabled:hover {
    background-color: #f8f9fa;
    transform: none;
    cursor: not-allowed !important;
}

.length-option.disabled:active {
    transform: none;
    cursor: not-allowed !important;
}

/* Story Type Select - Disabled State */
.story-type-select.disabled {
    opacity: 0.4;
    cursor: not-allowed !important;
    background-color: #f5f5f5;
    pointer-events: none !important;
    user-select: none !important;
}

.story-type-select.disabled option {
    color: #999;
    pointer-events: none !important;
    user-select: none !important;
}

/* Custom Tab - Disabled State */
.tab-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed !important;
    background-color: #f5f5f5;
    color: #999;
    pointer-events: none !important;
    user-select: none !important;
}

.tab-btn.disabled:hover {
    background-color: #f5f5f5;
    color: #999;
    transform: none;
    cursor: not-allowed !important;
}

.tab-btn.disabled:active {
    background-color: #f5f5f5;
    color: #999;
    transform: none;
    cursor: not-allowed !important;
}

.tab-btn.disabled.active {
    background-color: #f5f5f5;
    color: #999;
    border-color: #dee2e6;
    cursor: not-allowed !important;
}

/* Generate Button - Limit Reached State */
.generate-btn.limit-reached {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    cursor: pointer;
}

.generate-btn.limit-reached:hover {
    background: linear-gradient(135deg, #c82333, #bd2130);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* Usage Limit Indicator */
.usage-limit {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 1rem;
    text-align: center;
}

.usage-limit h4 {
    margin: 0 0 0.5rem 0;
    color: #856404;
    font-size: 0.95rem;
}

.usage-limit p {
    margin: 0;
    color: #856404;
    font-size: 0.85rem;
}

.usage-limit .sign-in-prompt {
    margin-top: 0.5rem;
}

.usage-limit .sign-in-prompt button {
    background: #007bff;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.2s ease;
}

.usage-limit .sign-in-prompt button:hover {
    background: #0056b3;
}

/* Feature Lock Icons */
.feature-lock {
    position: relative;
}

.feature-lock::after {
    content: '🔒';
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 0.8rem;
    background: #fff;
    border-radius: 50%;
    padding: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Responsive adjustments for disabled states */
@media (max-width: 768px) {
    .disabled {
        opacity: 0.3;
    }
    
    .length-option.disabled {
        opacity: 0.3;
    }
    
    .tab-btn.disabled {
        opacity: 0.3;
    }
}

/* Comprehension Questions Styles */
.comprehension-header {
    text-align: center;
    margin-bottom: 30px;
}

.comprehension-header h2 {
    font-family: 'Zain', sans-serif;
    color: #5a67d8;
    font-size: 2em;
    margin-bottom: 10px;
}

.comprehension-subtitle {
    color: #666;
    font-size: 1.1em;
}

.comprehension-questions {
    margin-bottom: 30px;
}

.question-container {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    border-left: 5px solid #4ecdc4;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.question-number {
    font-weight: bold;
    color: #5a67d8;
    font-size: 1.1em;
    margin-bottom: 10px;
}

.question-text {
    font-size: 1.2em;
    color: #333;
    margin-bottom: 20px;
    line-height: 1.5;
}

.answer-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.answer-option {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.answer-option:hover {
    border-color: #4ecdc4;
    background: #f0fdfa;
}

.answer-option.selected {
    border-color: #4ecdc4;
    background: #e6fffa;
}

.answer-option input[type="radio"] {
    margin-right: 12px;
    transform: scale(1.2);
}

.answer-option label {
    cursor: pointer;
    flex: 1;
    font-size: 1em;
}

.comprehension-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Quiz Results Styles */
.results-header {
    text-align: center;
    margin-bottom: 30px;
}

.results-header h2 {
    font-family: 'Zain', sans-serif;
    color: #5a67d8;
    font-size: 2em;
    margin-bottom: 20px;
}

.score-display {
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    color: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.3);
}

.score-percentage {
    font-size: 3em;
    font-weight: bold;
    margin-bottom: 10px;
}

.score-text {
    font-size: 1.2em;
    opacity: 0.9;
}

.results-summary {
    margin-bottom: 30px;
}

.result-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid #4ecdc4;
}

.result-item.correct {
    border-left-color: #48bb78;
    background: #f0fff4;
}

.result-item.incorrect {
    border-left-color: #f56565;
    background: #fff5f5;
}

.result-question {
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.result-answer {
    color: #666;
    margin-bottom: 5px;
}

.result-correct-answer {
    color: #48bb78;
    font-weight: bold;
}

.results-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Parent Dashboard Styles */
.dashboard-header {
    text-align: center;
    margin-bottom: 30px;
}

.dashboard-header h2 {
    font-family: 'Zain', sans-serif;
    color: #5a67d8;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.dashboard-subtitle {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 20px;
}

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

.stat-card {
    background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transition: transform 0.3s ease;
}

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

.stat-icon {
    font-size: 2.5em;
    margin-right: 20px;
    opacity: 0.9;
}

.stat-content h3 {
    font-size: 1.1em;
    margin-bottom: 5px;
    opacity: 0.9;
}

.stat-number {
    font-size: 2em;
    font-weight: bold;
    font-family: 'Zain', sans-serif;
}

.dashboard-content {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.dashboard-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid #e2e8f0;
}

.dashboard-tab {
    flex: 1;
    padding: 15px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.dashboard-tab:hover {
    background: #e2e8f0;
    color: #5a67d8;
}

.dashboard-tab.active {
    background: white;
    color: #5a67d8;
    border-bottom-color: #4ecdc4;
}

.dashboard-tab-content {
    padding: 30px;
}

.dashboard-panel {
    display: none;
}

.dashboard-panel.active {
    display: block;
}

.dashboard-panel h3 {
    font-family: 'Zain', sans-serif;
    color: #5a67d8;
    font-size: 1.5em;
    margin-bottom: 20px;
}

/* Activity List Styles */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.activity-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    border-left: 4px solid #4ecdc4;
    transition: transform 0.3s ease;
}

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

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.activity-title {
    font-weight: bold;
    color: #333;
}

.activity-date {
    color: #666;
    font-size: 0.9em;
}

.activity-details {
    color: #666;
    line-height: 1.5;
}

/* Quiz History Styles */
.quiz-history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.quiz-history-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    border-left: 4px solid #4ecdc4;
}

.quiz-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.quiz-story-title {
    font-weight: bold;
    color: #333;
}

.quiz-score {
    background: #4ecdc4;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: bold;
}

.quiz-details {
    color: #666;
    font-size: 0.9em;
}

/* Progress Chart Styles */
.progress-chart-container {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Dashboard Settings Styles */
.dashboard-settings {
    max-width: 500px;
}

.dashboard-settings .setting-group {
    margin-bottom: 20px;
}

.dashboard-settings .setting-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.dashboard-settings .setting-group input[type="text"],
.dashboard-settings .setting-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.dashboard-settings .setting-group input[type="text"]:focus,
.dashboard-settings .setting-group select:focus {
    outline: none;
    border-color: #4ecdc4;
}

.dashboard-settings .setting-group input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
}

.dashboard-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.dashboard-actions .action-btn {
    flex: 1;
}

/* Responsive Design for Dashboard */
@media (max-width: 768px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .dashboard-tabs {
        flex-direction: column;
    }
    
    .dashboard-tab {
        text-align: center;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-icon {
        font-size: 2em;
        margin-right: 15px;
    }
    
    .stat-number {
        font-size: 1.5em;
    }

    /* Comprehension Quiz Mobile Styles */
    .comprehension-actions {
        flex-direction: column;
        align-items: center;
    }

    .comprehension-actions .action-btn {
        width: 100%;
        max-width: 300px;
    }

    .question-container {
        padding: 20px;
    }

    .answer-option {
        padding: 15px;
    }

    /* Quiz Results Mobile Styles */
    .results-actions {
        flex-direction: column;
        align-items: center;
    }

    .results-actions .action-btn {
        width: 100%;
        max-width: 300px;
    }

    .score-percentage {
        font-size: 2.5em;
    }

    /* Dashboard Content Mobile Styles */
    .dashboard-tab-content {
        padding: 20px;
    }

    .activity-item,
    .quiz-history-item {
        padding: 15px;
    }

    .activity-header,
    .quiz-history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .dashboard-settings {
        max-width: 100%;
    }
}

/* Additional Mobile Optimizations */
@media (max-width: 480px) {
    .logo {
        max-width: 200px;
    }

    .dashboard-header h2 {
        font-size: 2em;
    }

    .comprehension-header h2 {
        font-size: 1.5em;
    }

    .results-header h2 {
        font-size: 1.5em;
    }

    .question-text {
        font-size: 1.1em;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-icon {
        font-size: 1.8em;
        margin-right: 12px;
    }

    .stat-number {
        font-size: 1.3em;
    }
}

/* Quiz Prompt Styles */
.quiz-prompt {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    color: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    z-index: 1000;
    animation: slideInUp 0.5s ease-out;
    max-width: 300px;
}

.quiz-prompt-content p {
    margin-bottom: 15px;
    font-size: 1.1em;
    font-weight: 600;
}

.quiz-prompt-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.quiz-prompt-actions .action-btn {
    flex: 1;
    min-width: 120px;
    padding: 10px 15px;
    font-size: 0.9em;
}

.quiz-prompt-actions .action-btn.secondary {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.quiz-prompt-actions .action-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

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

/* Responsive Quiz Prompt */
@media (max-width: 768px) {
    .quiz-prompt {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .quiz-prompt-actions {
        flex-direction: column;
    }
    
    .quiz-prompt-actions .action-btn {
        width: 100%;
    }
}

/* Refined Main Button Sizing */
.main-btn {
    display: inline-block;
    width: auto;
    min-width: 120px;
    max-width: 100%;
    margin: 10px 6px;
    padding: 12px 28px;
    border: none;
    border-radius: 24px;
    font-family: 'Zain', sans-serif;
    font-size: 1.08em;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(80, 48, 160, 0.10);
    transition: background 0.2s, color 0.2s, box-shadow 0.2s, border 0.2s;
    outline: none;
    line-height: 1.2;
}

/* Main Menu Buttons (slightly larger, but not oversized) */
.main-menu .main-btn {
    font-size: 1.18em;
    padding: 18px 0;
    width: 100%;
    max-width: 420px;
    margin: 18px auto;
    border-radius: 36px;
}

/* Header Buttons (compact) */
.main-btn--header {
    font-size: 1em;
    min-width: 100px;
    min-height: 34px;
    padding: 8px 16px;
    border-radius: 20px;
    margin: 0 4px;
    box-shadow: 0 1px 4px rgba(80,48,160,0.06);
}

/* Tab, Nav, Action, Dashboard, etc. (compact) */
.main-btn--tab,
.main-btn--nav,
.main-btn--settings,
.main-btn--primary,
.main-btn--sso {
    font-size: 1em;
    min-width: 100px;
    min-height: 34px;
    padding: 10px 18px;
    border-radius: 20px;
    margin: 0 4px;
}

@media (max-width: 600px) {
    .main-btn {
        font-size: 0.98em;
        padding: 10px 0;
        border-radius: 18px;
        min-width: 90px;
    }
    .main-menu .main-btn {
        font-size: 1.05em;
        padding: 14px 0;
        border-radius: 24px;
        max-width: 98vw;
    }
    .main-btn--header,
    .main-btn--tab,
    .main-btn--nav,
    .main-btn--settings,
    .main-btn--primary,
    .main-btn--sso {
        font-size: 0.95em;
        padding: 8px 8px;
        border-radius: 14px;
        min-width: 70px;
    }
}

/* Main Button Color & Shadow Rules */
.main-btn--primary {
  background: #FEA741;
  color: #fff;
  box-shadow: 0 2px 8px rgba(80, 48, 160, 0.10);
}
.main-btn--primary:hover,
.main-btn--primary:focus,
.main-btn--primary:active {
  background: #FD6363;
  color: #fff;
  box-shadow: 0 4px 16px rgba(253, 99, 99, 0.18);
}

.main-btn--settings {
  background: #fff;
  color: #8A6BF8;
  border: 2px solid #8A6BF8;
  box-shadow: 0 2px 8px rgba(80, 48, 160, 0.08);
}
.main-btn--settings:hover,
.main-btn--settings:focus,
.main-btn--settings:active {
  background: #f3edff;
  color: #8A6BF8;
  border: 2px solid #8A6BF8;
  box-shadow: 0 4px 16px rgba(138, 107, 248, 0.12);
}

.main-btn--tab {
  background: #fff;
  color: #8A6BF8;
  border: 2px solid #8A6BF8;
  box-shadow: 0 1px 4px rgba(80, 48, 160, 0.06);
}
.main-btn--tab.active,
.main-btn--tab.selected {
  background: #FD6363;
  color: #fff;
  border-color: #FD6363;
  box-shadow: 0 4px 16px rgba(253, 99, 99, 0.18);
}
.main-btn--tab:hover,
.main-btn--tab:focus {
  background: #f3edff;
  color: #8A6BF8;
  border: 2px solid #8A6BF8;
}

.main-btn--nav {
  background: #8A6BF8;
  color: #fff;
  box-shadow: 0 2px 8px rgba(80, 48, 160, 0.10);
}
.main-btn--nav:hover,
.main-btn--nav:focus,
.main-btn--nav:active {
  background: #FD6363;
  color: #fff;
  box-shadow: 0 4px 16px rgba(253, 99, 99, 0.18);
}

.main-btn--sso.google-btn {
  background: #fff;
  color: #4285f4;
  border: 2px solid #4285f4;
  box-shadow: 0 2px 8px rgba(66, 133, 244, 0.10);
}
.main-btn--sso.google-btn:hover,
.main-btn--sso.google-btn:focus {
  background: #4285f4;
  color: #fff;
}
.main-btn--sso.apple-btn {
  background: #fff;
  color: #000;
  border: 2px solid #000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}
.main-btn--sso.apple-btn:hover,
.main-btn--sso.apple-btn:focus {
  background: #000;
  color: #fff;
}
.main-btn--sso.guest-btn {
  background: #fff;
  color: #6c757d;
  border: 2px solid #6c757d;
  box-shadow: 0 2px 8px rgba(108, 117, 125, 0.10);
}
.main-btn--sso.guest-btn:hover,
.main-btn--sso.guest-btn:focus {
  background: #6c757d;
  color: #fff;
}

/* Header Navigation Styles */
.header-nav {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 20px;
    gap: 15px;
}

.header-nav-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* User Menu Styles */
.user-menu-container {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #fff;
    border: 2px solid #8A6BF8;
    border-radius: 20px;
    color: #8A6BF8;
    font-family: 'Zain', sans-serif;
    font-weight: 600;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(80, 48, 160, 0.08);
}

.user-menu-btn:hover {
    background: #f3edff;
    box-shadow: 0 4px 12px rgba(138, 107, 248, 0.12);
}

.user-menu-arrow {
    font-size: 0.8em;
    transition: transform 0.2s ease;
}

.user-menu-btn.active .user-menu-arrow {
    transform: rotate(180deg);
}

.user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #fff;
    border: 2px solid #8A6BF8;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(80, 48, 160, 0.15);
    min-width: 220px;
    z-index: 1000;
    animation: slideInDown 0.2s ease;
}

.user-menu-header {
    padding: 16px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8f9ff;
    border-radius: 10px 10px 0 0;
}

.user-menu-header span {
    display: block;
    font-family: 'Zain', sans-serif;
}

#user-menu-full-name {
    font-weight: 600;
    color: #5a67d8;
    font-size: 1em;
    margin-bottom: 4px;
}

#user-menu-email {
    font-size: 0.85em;
    color: #718096;
}

.user-menu-items {
    padding: 8px 0;
}

.user-menu-item {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    text-align: left;
    font-family: 'Zain', sans-serif;
    font-size: 0.9em;
    color: #4a5568;
    cursor: pointer;
    transition: background 0.2s ease;
}

.user-menu-item:hover {
    background: #f3edff;
    color: #5a67d8;
}

.user-menu-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 8px 0;
}

/* Animation for menu */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .header-nav {
        flex-direction: column;
        gap: 10px;
    }
    
    .header-nav-section {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .user-menu {
        right: -10px;
        min-width: 200px;
    }
} 