@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=JetBrains+Mono:wght@400;500&display=swap');
:root {
    --color-cream-50: rgba(252, 252, 249, 1);
    --color-cream-100: rgba(255, 255, 253, 1);
    --color-slate-900: rgba(19, 52, 59, 1);
    --color-slate-500: rgba(98, 108, 113, 1);
    --color-teal-500: rgba(33, 128, 141, 1);
    --color-teal-600: rgba(29, 116, 128, 1);
    --color-teal-700: rgba(26, 104, 115, 1);
    --color-brown-600-rgb: 94, 82, 64;
    --color-teal-500-rgb: 33, 128, 141;
    
    --color-background: var(--color-cream-50);
    --color-surface: var(--color-cream-100);
    --color-text: var(--color-slate-900);
    --color-text-secondary: var(--color-slate-500);
    --color-primary: var(--color-teal-500);
    --color-primary-hover: var(--color-teal-600);
    --color-border: rgba(var(--color-brown-600-rgb), 0.2);
    --color-card-border: rgba(var(--color-brown-600-rgb), 0.12);
}

@media (prefers-color-scheme: dark) {
    :root {
        --color-charcoal-700: rgba(31, 33, 33, 1);
        --color-charcoal-800: rgba(38, 40, 40, 1);
        --color-gray-200: rgba(245, 245, 245, 1);
        --color-gray-300: rgba(167, 169, 169, 1);
        --color-teal-300: rgba(50, 184, 198, 1);
        --color-gray-400-rgb: 119, 124, 124;
        
        --color-background: var(--color-charcoal-700);
        --color-surface: var(--color-charcoal-800);
        --color-text: var(--color-gray-200);
        --color-text-secondary: rgba(167, 169, 169, 0.85);
        --color-primary: var(--color-teal-300);
        --color-border: rgba(var(--color-gray-400-rgb), 0.3);
        --color-card-border: rgba(var(--color-gray-400-rgb), 0.2);
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--color-background);
    color: var(--color-text);
    line-height: 1.6;
}

header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--color-primary);
}

/* Dropdown Navigation */
.nav-links .dropdown {
    position: relative;
}

.nav-links .dropdown-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-links .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    list-style: none;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
}

.nav-links .dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-links .dropdown-menu li {
    padding: 0;
}

.nav-links .dropdown-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--color-text);
    text-decoration: none;
    transition: background 0.2s;
    font-size: 0.95rem;
}

.nav-links .dropdown-menu a:hover {
    background: rgba(var(--color-teal-500-rgb), 0.1);
    color: var(--color-primary);
}

/* Mobile dropdown */
@media (max-width: 768px) {
    .nav-links .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        background: transparent;
        padding-left: 1rem;
        margin-top: 0;
    }
    
    .nav-links .dropdown-menu a {
        padding: 0.5rem 0;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.hero p {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    max-width: 700px;
    margin: 0.5rem auto 1.5rem;
}

.hero div a {
    margin: 0 0.5rem;
}

.cta-button {
    display: inline-block;
    background: var(--color-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s;
    border: none;
    cursor: pointer;
}

.cta-button:hover {
    background: var(--color-primary-hover);
}

.section {
    margin-bottom: 3rem;
}

.section h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.section h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--color-primary);
}

.section p {
    color: var(--color-text-secondary);
}

.section ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 2rem;
    text-align: center;
    color: var(--color-text-secondary);
    margin-top: 4rem;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-text);
    cursor: pointer;
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 1rem;
        padding-top: 1rem;
    }

    .nav-links.active {
        display: flex;
    }

    .mobile-menu-btn {
        display: block;
    }
}

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-card-border);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.card h3 {
    color: var(--color-primary);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--color-background);
    border-radius: 8px;
    border: 1px solid var(--color-border);
}

.contact-icon {
    font-size: 1.5rem;
}

.contact-text {
    flex: 1;
}

.contact-label {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.2rem;
}

.contact-value {
    color: var(--color-text);
    font-weight: 500;
}

/* ========================================
   Kerala PSC Practice Section Styles
   ======================================== */

/* Practice Configuration Card */
.practice-config-card {
    background: var(--color-surface);
    border: 1px solid var(--color-card-border);
    border-radius: 12px;
    padding: 2rem;
    margin-top: 1.5rem;
}

.practice-config-card h3 {
    color: var(--color-primary);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.config-item label {
    display: block;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.practice-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-background);
    color: var(--color-text);
    font-size: 1rem;
    transition: border-color 0.3s;
}

.practice-select:focus {
    outline: none;
    border-color: var(--color-primary);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 3rem;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
    border: 4px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error Message */
.error-message {
    background: var(--color-surface);
    border: 2px solid #dc3545;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
}

.error-message h3 {
    color: #dc3545;
    margin-bottom: 1rem;
}

/* Question Card */
.question-card {
    background: var(--color-surface);
    border: 1px solid var(--color-card-border);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.question-header {
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.question-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.question-number {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text);
}

.question-badges {
    display: flex;
    gap: 0.5rem;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge-module {
    background: rgba(var(--color-teal-500-rgb), 0.1);
    color: var(--color-primary);
}

.badge-year {
    background: rgba(var(--color-brown-600-rgb), 0.1);
    color: var(--color-text-secondary);
}

/* Progress Bar */
.progress-container {
    margin-top: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--color-background);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--color-primary);
    transition: width 0.3s ease;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

/* Question Content */
.question-text {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--color-text);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.option-item {
    position: relative;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    transition: all 0.3s;
}

.option-item:hover {
    border-color: var(--color-primary);
    background: rgba(var(--color-teal-500-rgb), 0.05);
}

.option-item input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.option-item label {
    display: flex;
    align-items: center;
    padding: 1rem;
    cursor: pointer;
    gap: 1rem;
}

.option-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--color-background);
    border-radius: 50%;
    font-weight: 600;
    color: var(--color-text);
    flex-shrink: 0;
}

.option-text {
    flex: 1;
    color: var(--color-text);
}

.option-item input[type="radio"]:checked + label {
    background: rgba(var(--color-teal-500-rgb), 0.1);
}

.option-item input[type="radio"]:checked + label .option-letter {
    background: var(--color-primary);
    color: white;
}

/* Correct/Incorrect Answer Highlighting */
.option-item.correct-answer {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.1);
}

.option-item.correct-answer .option-letter {
    background: #28a745;
    color: white;
}

.option-item.incorrect-answer {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
}

.option-item.incorrect-answer .option-letter {
    background: #dc3545;
    color: white;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.secondary-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: 2px solid var(--color-border);
    background: transparent;
    color: var(--color-text);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.secondary-button:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* Feedback Section */
.feedback-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--color-border);
}

.feedback-result {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
}

.feedback-result.correct {
    background: rgba(40, 167, 69, 0.1);
    border: 2px solid #28a745;
    color: #28a745;
}

.feedback-result.incorrect {
    background: rgba(220, 53, 69, 0.1);
    border: 2px solid #dc3545;
    color: #dc3545;
}

/* Feedback text styles (for sample quiz) */
.feedback-correct {
    color: #28a745;
    font-weight: 600;
    font-size: 1.1rem;
}

.feedback-incorrect {
    color: #dc3545;
    font-weight: 600;
    font-size: 1.1rem;
}

.feedback-icon {
    font-size: 1.5rem;
    font-weight: bold;
}

.explanation-box,
.exam-info-box {
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.explanation-box h4,
.exam-info-box h4 {
    color: var(--color-primary);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.explanation-box p,
.exam-info-box p {
    color: var(--color-text);
    line-height: 1.6;
}

/* Results Section */
.results-card {
    background: var(--color-surface);
    border: 1px solid var(--color-card-border);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
}

.results-card h2 {
    color: var(--color-primary);
    margin-bottom: 2rem;
}

.final-score {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 2rem;
    background: var(--color-background);
    border-radius: 12px;
}

.score-circle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
}

.score-number {
    font-size: 3rem;
    font-weight: bold;
}

.score-label {
    font-size: 0.9rem;
    text-transform: uppercase;
}

.score-details {
    text-align: left;
}

.score-text {
    font-size: 1.2rem;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.percentage-text {
    font-size: 2rem;
    font-weight: bold;
    color: var(--color-primary);
}

.module-breakdown {
    background: var(--color-background);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: left;
}

.module-breakdown h3 {
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.module-stat {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
}

.module-stat:last-child {
    border-bottom: none;
}

.module-name {
    color: var(--color-text);
    font-weight: 500;
}

.module-score {
    color: var(--color-text-secondary);
}

.pagination-info {
    background: var(--color-background);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: left;
    border: 2px solid var(--color-primary);
}

.pagination-info h3 {
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.pagination-info p {
    margin: 0.5rem 0;
    color: var(--color-text);
}

.pagination-info .exhausted-message {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(var(--color-teal-500-rgb), 0.1);
    border-radius: 6px;
    color: var(--color-primary);
    font-size: 1.1rem;
}

.results-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Responsive Design for Practice Section */
@media (max-width: 768px) {
    .config-grid {
        grid-template-columns: 1fr;
    }

    .question-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .progress-text {
        flex-direction: column;
        gap: 0.25rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .final-score {
        flex-direction: column;
        gap: 1rem;
    }

    .score-details {
        text-align: center;
    }

    .results-actions {
        flex-direction: column;
    }
}

/* ============================================
   User Authentication Styles
   ============================================ */

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-left: 1rem;
    border-left: 1px solid var(--color-border);
    margin-left: 0.5rem;
}

.user-email {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.logout-btn {
    padding: 0.4rem 0.8rem;
    background: var(--color-primary);
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background 0.2s, opacity 0.2s;
}

.logout-btn:hover {
    background: var(--color-primary-hover);
    color: white;
}

@media (max-width: 768px) {
    .user-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding-left: 0;
        border-left: none;
        margin-left: 0;
        padding-top: 0.5rem;
        border-top: 1px solid var(--color-border);
        margin-top: 0.5rem;
        width: 100%;
    }

    .user-email {
        max-width: 100%;
    }

    .logout-btn {
        width: 100%;
        text-align: center;
    }
}

/* ============================================
   User Profile Button & Dropdown
   ============================================ */

.user-profile-container {
    position: relative;
    margin-left: 0.5rem;
}

.profile-btn {
    height: 40px;
    border-radius: 20px;
    background: white;
    border: 2px solid #e0e0e0;
    padding: 0 12px 0 0;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    overflow: hidden;
}

.profile-btn svg {
    border-radius: 50%;
    flex-shrink: 0;
}

.profile-btn-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.35);
    border-color: var(--color-primary);
}

/* Hide name on small screens */
@media (max-width: 900px) {
    .profile-btn {
        padding: 0;
        border-radius: 50%;
        width: 40px;
    }
    .profile-btn-name {
        display: none;
    }
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    min-width: 220px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

.user-profile-container.open .profile-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #eee;
}

.profile-avatar-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid #e8e8e8;
    flex-shrink: 0;
}

.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-name {
    font-weight: 600;
    color: #1a1a2e;
    font-size: 0.9rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-email {
    color: #888;
    font-size: 0.75rem;
    margin: 2px 0 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-sub {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 1rem;
    background: #f8f9fa;
    font-size: 0.8rem;
}

.sub-badge {
    color: #155724;
    background: #d4edda;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.7rem;
}

.sub-days {
    color: #666;
    font-size: 0.75rem;
}

.profile-logout {
    display: block;
    padding: 0.75rem 1rem;
    color: #dc3545;
    text-decoration: none;
    font-size: 0.85rem;
    border-radius: 0 0 10px 10px;
    transition: background 0.2s;
}

.profile-logout:hover {
    background: #fee2e2;
}

@media (max-width: 768px) {
    .user-profile-container {
        margin-left: 0;
        padding-top: 0.5rem;
        border-top: 1px solid var(--color-border);
        margin-top: 0.5rem;
        display: flex;
        justify-content: center;
    }
    
    .profile-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: 12px 12px 0 0;
        min-width: 100%;
    }
}

/* ========================================
   AI Deep Dive Feature Styles
   ======================================== */

.ai-deep-dive-section {
    background: linear-gradient(135deg, rgba(33, 128, 141, 0.08) 0%, rgba(50, 184, 198, 0.05) 100%);
    border: 1px solid rgba(33, 128, 141, 0.2);
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.ai-deep-dive-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.ai-hint {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.ai-buttons-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.btn-ai {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
    color: white;
}

.btn-ai:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-ai:active {
    transform: translateY(0);
}

.ai-icon {
    font-size: 1.1rem;
}

.ai-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 4px;
}

/* ChatGPT - Green */
.btn-chatgpt {
    background: linear-gradient(135deg, #10a37f 0%, #0d8c6f 100%);
}

.btn-chatgpt:hover {
    background: linear-gradient(135deg, #0d8c6f 0%, #0a7a5f 100%);
}

/* Claude/Anthropic - Orange/Terracotta */
.btn-claude {
    background: linear-gradient(135deg, #d97757 0%, #c4664a 100%);
}

.btn-claude:hover {
    background: linear-gradient(135deg, #c4664a 0%, #b55a40 100%);
}

/* Perplexity AI - Teal */
.btn-perplexity {
    background: linear-gradient(135deg, #20808d 0%, #1a6b76 100%);
}

.btn-perplexity:hover {
    background: linear-gradient(135deg, #1a6b76 0%, #155a63 100%);
}

/* Mobile responsiveness for AI buttons */
@media (max-width: 600px) {
    .ai-buttons-grid {
        grid-template-columns: 1fr;
    }
    
    .btn-ai {
        padding: 1rem;
    }
}

@media (min-width: 601px) and (max-width: 768px) {
    .ai-buttons-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ai-buttons-grid .btn-perplexity {
        grid-column: span 2;
    }
}

/* ========================================
   AI Feature Section (Homepage)
   ======================================== */

.ai-feature-section {
    background: linear-gradient(135deg, rgba(33, 128, 141, 0.06) 0%, rgba(50, 184, 198, 0.03) 100%);
    border-radius: 16px;
    padding: 2.5rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(33, 128, 141, 0.15);
}

.ai-feature-section h2 {
    text-align: center;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.feature-tagline {
    text-align: center;
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem auto;
}

.ai-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.ai-feature-card {
    background: var(--color-surface);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid var(--color-card-border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.ai-feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.ai-feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.ai-feature-card h3 {
    font-size: 1.1rem;
    color: var(--color-text);
    margin-bottom: 0.75rem;
}

.ai-feature-card p {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.ai-cta {
    text-align: center;
}

.ai-cta .cta-button {
    display: inline-block;
    padding: 0.9rem 2rem;
    background: var(--color-primary);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: background 0.2s, transform 0.2s;
}

.ai-cta .cta-button:hover {
    background: var(--color-primary-hover);
    transform: translateY(-2px);
}

@media (max-width: 900px) {
    .ai-feature-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .ai-feature-section {
        padding: 1.5rem;
    }
}

@media (min-width: 901px) and (max-width: 1024px) {
    .ai-feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ai-feature-grid .ai-feature-card:last-child {
        grid-column: span 2;
        max-width: 50%;
        margin: 0 auto;
    }
}

/* ========================================
   Policy Pages Styles
   ======================================== */

.policy-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.policy-page h1 {
    font-size: 2.5rem;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.policy-page .last-updated {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.policy-page .policy-intro {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.policy-page h2 {
    font-size: 1.5rem;
    color: var(--color-primary);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-border);
}

.policy-page h3 {
    font-size: 1.15rem;
    color: var(--color-text);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.policy-page p {
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.policy-page ul,
.policy-page ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
    color: var(--color-text-secondary);
}

.policy-page li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.policy-page a {
    color: var(--color-primary);
    text-decoration: none;
}

.policy-page a:hover {
    text-decoration: underline;
}

.policy-page strong {
    color: var(--color-text);
}

.policy-page .highlight-box {
    background: rgba(var(--color-teal-500-rgb), 0.08);
    border-left: 4px solid var(--color-primary);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
}

.policy-page .highlight-box p {
    margin: 0;
    color: var(--color-text);
}

.policy-page .warning-box {
    background: rgba(220, 53, 69, 0.08);
    border-left: 4px solid #dc3545;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
}

.policy-page .warning-box p {
    margin: 0;
    color: var(--color-text);
}

.policy-page .policy-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: var(--color-surface);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.policy-page .policy-table th,
.policy-page .policy-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.policy-page .policy-table th {
    background: rgba(var(--color-teal-500-rgb), 0.1);
    color: var(--color-primary);
    font-weight: 600;
}

.policy-page .policy-table td {
    color: var(--color-text-secondary);
}

.policy-page .policy-table tr:last-child td {
    border-bottom: none;
}

.policy-page .summary-box {
    background: var(--color-surface);
    border: 1px solid var(--color-card-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.policy-page .summary-box h3 {
    color: var(--color-primary);
    margin-top: 0;
}

.policy-page .summary-box ul {
    margin-bottom: 0;
}

.policy-page .contact-card {
    background: var(--color-surface);
    border: 1px solid var(--color-card-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.policy-page .contact-card h3 {
    color: var(--color-primary);
    margin-top: 0;
    margin-bottom: 1rem;
}

.policy-page .support-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.policy-page .support-card {
    background: var(--color-surface);
    border: 1px solid var(--color-card-border);
    border-radius: 12px;
    padding: 1.5rem;
}

.policy-page .support-card h3 {
    color: var(--color-primary);
    margin-top: 0;
    font-size: 1.1rem;
}

.policy-page .business-hours-table {
    width: 100%;
    max-width: 400px;
}

/* Footer Links */
.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--color-primary);
}

@media (max-width: 768px) {
    .policy-page {
        padding: 2rem 1rem;
    }
    
    .policy-page h1 {
        font-size: 2rem;
    }
    
    .policy-page h2 {
        font-size: 1.3rem;
    }
    
    .policy-page .policy-table {
        font-size: 0.9rem;
    }
    
    .policy-page .policy-table th,
    .policy-page .policy-table td {
        padding: 0.75rem;
    }
    
    .footer-links {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }
}

/* 2026-09-26: tablet (769-1100px) header - keep nav on one line with the brand */
@media (min-width: 769px) and (max-width: 1100px) {
    nav { padding: .75rem 1.25rem; flex-wrap: nowrap; gap: 1rem; }
    .logo { font-size: 1.3rem; white-space: nowrap; }
    .nav-links { gap: 1.1rem; align-items: center; }
    .nav-links a { white-space: nowrap; font-size: .95rem; }
}


/* ==========================================================================
   v3 visual refresh (2026-09-26)
   page-designer inspire "mesh-grid-hero" (hero dot grid, layered card shadows)
   + "tinted-strata" (soft tinted section bands); reference styles Linear/Stripe
   depth + 21st.dev-grade buttons/cards. All colours checked for WCAG AA.
   ========================================================================== */
:root {
    --color-background: #f3f8f7;
    --color-surface: #ffffff;
    --color-text: #0f2f35;
    --color-text-secondary: #5b6b70;
    --color-primary: #177580;
    --color-primary-hover: #115e67;
    --color-teal-500-rgb: 23, 117, 128;
    --color-border: rgba(15, 47, 53, 0.12);
    --color-card-border: rgba(15, 47, 53, 0.08);
    --v3-accent: #f29e4c;
    --v3-accent-ink: #9a4a14;
    --v3-accent-soft: #fff4e8;
    --v3-mint: #e6f3f1;
    --v3-shadow-sm: 0 1px 2px rgba(15, 47, 53, .06), 0 1px 3px rgba(15, 47, 53, .05);
    --v3-shadow: 0 1px 2px rgba(15, 47, 53, .05), 0 6px 16px -4px rgba(15, 47, 53, .10);
    --v3-shadow-lg: 0 2px 4px rgba(15, 47, 53, .04), 0 24px 48px -16px rgba(15, 47, 53, .22);
    --v3-radius: 14px;
}
@media (prefers-color-scheme: dark) {
    :root {
        --color-background: #141a1b;
        --color-surface: #1c2426;
        --color-text: #eef3f2;
        --color-text-secondary: #a9b7b8;
        --color-primary: #4fc3cf;
        --color-primary-hover: #7ad3dc;
        --color-teal-500-rgb: 79, 195, 207;
        --color-border: rgba(255, 255, 255, 0.12);
        --color-card-border: rgba(255, 255, 255, 0.08);
        --v3-accent-soft: #3a2a1b;
        --v3-accent-ink: #f6c08c;
        --v3-mint: #18282a;
    }
}

body { -webkit-font-smoothing: antialiased; }
h1, h2, h3 { letter-spacing: -0.015em; }

/* header: crisp white bar with a soft shadow */
header { background: rgba(255, 255, 255, 0.92); backdrop-filter: saturate(160%) blur(8px); -webkit-backdrop-filter: saturate(160%) blur(8px); box-shadow: var(--v3-shadow-sm); border-bottom-color: transparent; }
@media (prefers-color-scheme: dark) { header { background: rgba(28, 36, 38, 0.92); } }
.logo { letter-spacing: -0.01em; }
.nav-links a { border-radius: 6px; }

/* hero: dot-grid texture on a mint wash (hero only) */
.hero, .v3-hero {
    background-color: var(--color-surface);
    background-image:
        radial-gradient(rgba(var(--color-teal-500-rgb), 0.16) 1px, transparent 1px),
        radial-gradient(1200px 400px at 85% -10%, rgba(var(--color-teal-500-rgb), 0.12), transparent 70%),
        radial-gradient(800px 360px at 0% 110%, rgba(242, 158, 76, 0.10), transparent 70%);
    background-size: 22px 22px, 100% 100%, 100% 100%;
    border-bottom: 1px solid var(--color-border);
}

/* buttons */
.cta-button {
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(15, 47, 53, .12), inset 0 1px 0 rgba(255, 255, 255, .18);
    transition: background .2s, transform .15s, box-shadow .2s;
}
.cta-button:hover { transform: translateY(-1px); box-shadow: 0 6px 16px -6px rgba(var(--color-teal-500-rgb), .55); }
.cta-button:active { transform: translateY(0); }
.secondary-button { border-radius: 10px; transition: background .2s, border-color .2s, transform .15s; }

/* cards: white, layered shadow, no heavy border */
.card, .practice-config-card, .results-card, .question-card, .ai-feature-card {
    background: var(--color-surface);
    border: 1px solid var(--color-card-border);
    border-radius: var(--v3-radius);
    box-shadow: var(--v3-shadow);
}
.ai-feature-section { background: var(--v3-mint); border: 0; border-radius: 20px; }
.ai-feature-card { transition: transform .2s, box-shadow .2s; }
.ai-feature-card:hover { transform: translateY(-2px); box-shadow: var(--v3-shadow-lg); }

/* badges become pills */
.badge { border-radius: 999px; }

/* answer options: lift on hover, clear selected state */
.option-item { border-radius: 12px; background: var(--color-surface); transition: border-color .15s, box-shadow .15s, transform .15s; }
.option-item:hover { box-shadow: var(--v3-shadow-sm); }

footer { background: var(--color-surface); }

/* tinted section bands (homepage) */
.v3-band { background: var(--color-surface); border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); }
.v3-band-mint { background: var(--v3-mint); }

/* scroll reveal: only when JS added .v3-js, and never with reduced motion */
.v3-js .v3-reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.v3-js .v3-reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    .v3-js .v3-reveal { opacity: 1; transform: none; transition: none; }
    .cta-button, .ai-feature-card, .option-item { transition: none; }
    .cta-button:hover, .ai-feature-card:hover { transform: none; }
}


/* ==========================================================================
   v4 identity theme "instruments & OMR" (2026-09-26)
   page-designer: decide -> long_serif_bio + editorial_calm @ intensity 1.33;
   inspire -> audiogram-grid, cochlear-spiral, omr-bubbles (adapted);
   delight -> instrument line-draw (load, adapted from audiogram-settle), omr-bubble-nudge (hover/tap).
   Sister of kiranvk.me's paper-and-ink theme: same serif/mono family,
   her own motifs: ENT instrument line art and the PSC OMR answer sheet.
   ========================================================================== */
:root {
    --paper: #f4efe5;
    --paper-2: #ebe4d6;
    --paper-card: #fffcf6;
    --ink: #13302f;
    --ink-2: #4f5f5c;
    --brick: #b8432a;
    --ear-left: #1f5f8b;
    --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
    --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
    --color-background: var(--paper);
    --color-surface: var(--paper-card);
    --color-text: var(--ink);
    --color-text-secondary: var(--ink-2);
    --color-primary: #17707a;
    --color-primary-hover: #105961;
    --color-teal-500-rgb: 23, 112, 122;
    --color-border: rgba(19, 48, 47, 0.14);
    --color-card-border: rgba(19, 48, 47, 0.10);
    --v3-mint: #e7eee8;
    --v3-accent-soft: #f7e6dc;
    --v3-accent-ink: #9b3a23;
}
@media (prefers-color-scheme: dark) {
    :root {
        --paper: #141816;
        --paper-2: #1b201e;
        --paper-card: #1d2422;
        --ink: #eee9dd;
        --ink-2: #b3b9b1;
        --brick: #e07a5f;
        --ear-left: #7fb2d9;
        --color-primary: #5cc3cc;
        --color-primary-hover: #86d3da;
        --color-teal-500-rgb: 92, 195, 204;
        --color-border: rgba(238, 233, 221, 0.14);
        --color-card-border: rgba(238, 233, 221, 0.09);
        --v3-mint: #1a2422;
        --v3-accent-soft: #33221b;
        --v3-accent-ink: #f0a88f;
    }
}

/* paper with a faint case-sheet grid (fine 24px, stronger every 5th line) */
body {
    background-color: var(--paper);
    background-image:
        linear-gradient(rgba(var(--color-teal-500-rgb), .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--color-teal-500-rgb), .055) 1px, transparent 1px),
        linear-gradient(rgba(var(--color-teal-500-rgb), .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--color-teal-500-rgb), .05) 1px, transparent 1px);
    background-size: 24px 24px, 24px 24px, 120px 120px, 120px 120px;
}
header { background: color-mix(in srgb, var(--paper) 90%, transparent); }
footer { background: var(--paper-2); }

/* type: serif display like kiranvk.me, mono case-sheet labels */
.logo { font-family: var(--serif); font-weight: 400; font-size: 1.7rem; letter-spacing: 0; color: var(--ink); }
.logo::after { content: ''; display: inline-block; width: 7px; height: 7px; margin-left: 5px; border-radius: 50%; background: var(--brick); vertical-align: middle; }
h1, .section h2, .results-card h2, .sb-h1, .sq-h1 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }
.section h2 { font-size: 2.4rem; line-height: 1.1; }
.sb-h1, .sq-h1 { line-height: 1.02; }
.sb-h1 { font-size: clamp(2.5rem, 5.2vw, 4.1rem); }
.sq-h1 { font-size: clamp(2.3rem, 4.4vw, 3.5rem); }
.sb-hl, .sq-h1 em { font-style: italic; color: var(--color-primary); }
.sb-eyebrow, .sb-tag, .sq-eyebrow, .dp-when, .badge, .sb-stats span, .sq-stats span, .qx-t-lbl { font-family: var(--mono); letter-spacing: .04em; }
.sb-eyebrow::before { content: ''; display: inline-block; width: 26px; height: 1px; background: currentColor; margin-right: 10px; vertical-align: middle; }

/* hero: no gradient wash, just paper; the instrument drawing is the picture */
.hero, .v3-hero { background: transparent; border-bottom: 1px dashed var(--color-border); }
.sq-hero { background: var(--paper-card); }

/* cards on warm paper-white with hairline + dashed inner rules */
.card, .practice-config-card, .results-card, .question-card, .ai-feature-card, .sb-door, .dp-skill {
    background: var(--paper-card);
}
.ai-feature-section { background: var(--paper-2); }
.dp-edu li { border-bottom-style: dashed; }

/* OMR bubbles: section underline + bullets on the question-bank side */
.omr-row { display: inline-flex; gap: 6px; align-items: center; font-family: var(--mono); font-size: .72rem; color: var(--ink-2); }
.omr-row i { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid currentColor; display: inline-grid; place-items: center; font-style: normal; font-size: .55rem; line-height: 1; }
.omr-row i.is-fill { background: var(--ink); border-color: var(--ink); color: var(--paper-card); }
.omr-row b { font-weight: 500; margin-right: 4px; }

/* ENT instruments figure (line art: otoscope, head mirror, tuning fork) */
.ag-card { position: relative; margin: 0; background: var(--paper-card); border: 1px solid var(--color-card-border); border-radius: 18px; padding: 42px 18px 12px; box-shadow: 0 30px 60px -30px rgba(19, 48, 47, .35); }
.ag-chip { position: absolute; top: 12px; left: 14px; font-family: var(--mono); font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; background: var(--ink); color: var(--paper-card); padding: 4px 8px; border-radius: 6px; }
.ag-legend { display: flex; gap: 14px; justify-content: space-between; flex-wrap: wrap; margin-top: 6px; font-family: var(--mono); font-size: .68rem; color: var(--ink-2); }
.ent-svg { display: block; width: 100%; height: auto; overflow: visible; }
.ent-svg * { fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ent-svg .ent-thin, .ent-svg .ent-thin * { stroke-width: 1; stroke-opacity: .55; }
.ent-svg .ent-beam * { stroke: var(--color-primary); stroke-width: 2; }
.ent-svg .ent-waves * { stroke: var(--brick); stroke-width: 1.6; }
.ent-svg .ent-lab { fill: var(--ink-2); stroke: none; font-family: var(--mono); font-size: 9px; }

/* delight: instruments draw themselves once, then the beam and fork keep a gentle pulse */
@media (prefers-reduced-motion: no-preference) {
    .ent-animate .ent-g * { stroke-dasharray: 1; stroke-dashoffset: 1; animation: ent-draw 1.4s ease-out forwards; }
    .ent-animate .ent-mirror * { animation-delay: .1s; }
    .ent-animate .ent-oto * { animation-delay: .45s; }
    .ent-animate .ent-fork * { animation-delay: .8s; }
    .ent-animate .ent-lary * { animation-delay: 1.1s; }
    .ent-animate .ent-lab { animation: none; opacity: 0; animation: ent-fade .4s ease-out 1.9s forwards; }
    .ent-animate .ent-beam { animation: ent-pulse 2.4s ease-in-out 2s infinite; }
    .ent-animate .ent-waves { animation: ent-pulse 1.2s ease-in-out 2.2s infinite; transform-box: fill-box; }
    @keyframes ent-draw { to { stroke-dashoffset: 0; } }
    @keyframes ent-fade { to { opacity: 1; } }
    @keyframes ent-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
}

/* delight: omr-bubble-nudge (primary buttons fill a bubble on hover/tap) */
.omr-btn::before { content: ''; display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid currentColor; margin-right: 9px; vertical-align: -1px; transition: background .2s; }
.omr-btn:hover::before, .omr-btn.is-tap::before { background: currentColor; }
@media (prefers-reduced-motion: reduce) { .omr-btn::before { transition: none; } }

@media (max-width: 600px) {
    .section h2 { font-size: 2rem; }
    body { background-size: 20px 20px, 20px 20px, 100px 100px, 100px 100px; }
}
.sample-badge { background: var(--ink); color: var(--paper-card); font-family: var(--mono); font-weight: 500; letter-spacing: .06em; box-shadow: none; }
