:root {
    --primary-color: #3b82f6; /* Light Blue (Sky Blue) */
    --primary-hover: #2563eb;
    --secondary-color: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --success-color: #10b981;
    --error-color: #f43f5e;
    --bg-gradient: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    --card-bg: rgba(255, 255, 255, 0.9);
    --card-border: rgba(255, 255, 255, 0.4);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-main);
    background: var(--bg-gradient);
    min-height: 100vh;
    line-height: 1.6;
}

h1, h2, h3, .logo {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
}

#app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    margin-bottom: 2rem;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

/* Membership Card */
.membership-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem !important;
    border: 2px solid rgba(59, 130, 246, 0.1);
}

.membership-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    background: var(--primary-color);
}

.logo {
    font-size: 1.5rem;
    color: var(--primary-color);
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

section {
    width: 100%;
    max-width: 800px;
    display: none;
    flex-direction: column;
    align-items: center;
}

section.active {
    display: flex;
    animation: fadeInSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Hero Section */
.hero-content {
    text-align: center;
    margin-bottom: 3rem;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #0f172a;
}

.highlight {
    color: var(--primary-color);
}

.hero-content p {
    font-size: 1.25rem;
    color: var(--text-muted);
}

/* Glass Card */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    padding: 3rem;
    width: 100%;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease;
}

/* Upload Drop Zone */
#drop-zone {
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-lg);
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

#drop-zone:hover, #drop-zone.drag-over {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

#drop-zone p {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

.primary-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.4);
}

.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
}

/* Loading State */
.hidden {
    display: none !important;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(99, 102, 241, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Quiz Configuration */
.quiz-config-container {
    padding-bottom: 2rem;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
}

.config-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
}

.config-row {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.config-group {
    flex: 1;
    min-width: 200px;
}

/* Docs and Review List Styles */
.docs-list, .review-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.doc-item {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.doc-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.doc-info {
    flex: 1;
}

.doc-name {
    font-weight: 600;
    color: var(--text-main);
    display: block;
}

.doc-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.doc-actions {
    display: flex;
    gap: 0.5rem;
}

.review-item {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border-left: 5px solid var(--error-color);
    box-shadow: var(--shadow-sm);
}

.review-item h3 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.review-feedback {
    background: #fff5f5;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
}
.sm-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.home-nav-btn {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    width: 50px !important;
    height: 50px !important;
    background: white !important;
    border: 3px solid #3b82f6 !important;
    color: #3b82f6 !important;
    border-radius: 50% !important;
    font-size: 24px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    display: none; /* JS will toggle this */
    align-items: center !important;
    justify-content: center !important;
    z-index: 2147483647 !important; /* Max z-index possible */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
    transition: all 0.2s ease !important;
}

.home-nav-btn:hover {
    background: #3b82f6 !important;
    color: white !important;
    transform: scale(1.1) !important;
}

.home-nav-btn:active {
    transform: translateY(0);
}

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

.config-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.checkbox-group {
    display: flex;
    gap: 1rem;
}

.checkbox-group label {
    font-weight: normal;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

#question-count {
    padding: 0.5rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    width: 100px;
}

/* Quiz UI Components Update */
.quiz-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    gap: 1rem;
}

.secondary-btn {
    background: white;
    color: var(--text-main);
    border: 1px solid #cbd5e1;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.secondary-btn:hover {
    background: #f8fafc;
    border-color: var(--primary-color);
}

.secondary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Question Types Styles */
.short-answer-input {
    width: 100%;
    padding: 1rem;
    font-size: 1.125rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    transition: border-color 0.3s ease;
}

.short-answer-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Feedback Comments */
.feedback-container {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 0.75rem;
    display: none;
}

.feedback-container.active {
    display: block;
}

.feedback-correct {
    background: rgba(34, 197, 94, 0.1);
    color: #166534;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.feedback-wrong {
    background: rgba(239, 68, 68, 0.1);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.feedback-comment {
    margin-top: 0.75rem;
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-wrap; /* Preserve line breaks for icons */
}

.progress-bar-container {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    margin: 0 1.5rem;
    overflow: hidden;
}

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

.question-card h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

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

.option-btn {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    text-align: left;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-btn:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.02);
    transform: scale(1.01);
}

.option-btn:active {
    transform: scale(0.98);
}

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

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

.option-btn.wrong {
    background: var(--error-color);
    color: white;
    border-color: var(--error-color);
}

/* Footer */
footer {
    padding: 2rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 640px) {
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .glass-card {
        padding: 1.5rem;
    }
    
    #drop-zone {
        padding: 1.5rem;
    }
}

/* Custom Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2147483647;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    max-width: 400px;
    width: 90%;
    text-align: center;
    padding: 2.5rem !important;
    transform: scale(0.9);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}
