/* ================================
   NCLEXSTABBER - Professional NCLEX Platform
   Medical-Themed Blue & White Design
   ================================ */

/* CSS Variables */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --secondary-color: #0891b2;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Container */
.container {
    max-width: 100%;
    margin: 0;
    padding: 0 2rem;
    width: 100%;
}

/* Home page specific - full width */
#home-page .container {
    max-width: 100%;
    padding: 0 3rem;
}

/* Navigation Bar */
.navbar {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    box-shadow: var(--shadow);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    padding: 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo i {
    font-size: 1.8rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0;
    align-items: center;
}

.nav-link {
    color: white !important;
    text-decoration: none;
    font-weight: 500 !important;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    transition: var(--transition);
    white-space: nowrap;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
    gap: 0.3rem;
}
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.2);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: var(--transition);
}

/* Main Content */
#main-content {
    flex: 1;
    padding-bottom: 0.5rem;
}

.page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

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

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem 0;
    text-align: center;
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1rem;
    margin-bottom: 1rem;
    opacity: 0.95;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-family);
    font-size: 1rem;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

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

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

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

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.stat-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Section Headers */
.section-header {
    text-align: center;
    margin: 1.5rem 0 1rem;
}

.section-header h2 {
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.category-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.category-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.category-card h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.category-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.category-stats {
    display: flex;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Features Section */
.features-section {
    margin: 1.5rem 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 1rem 0;
}

.feature-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
}

.feature-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
}

/* Page Header */
.page-header {
    text-align: center;
    margin: 3rem 0;
}

.page-header h1 {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Topics Filters */
.topics-filters {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.filter-select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-family: var(--font-family);
    font-size: 0.95rem;
    min-width: 200px;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Topics Container */
.topics-container {
    margin: 2rem 0;
}

.topic-category {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    overflow: hidden;
}

.topic-category-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    padding: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topic-category-header h3 {
    font-size: 1.5rem;
}

.topic-category-content {
    padding: 1.5rem;
    display: none;
}

.topic-category-content.active {
    display: block;
}

.topic-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: var(--transition);
    cursor: pointer;
}

.topic-item:hover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.topic-info h4 {
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.topic-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

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

/* Quiz Container */
.quiz-container {
    max-width: 900px;
    margin: 2rem auto;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.quiz-header {
    padding: 1.5rem;
    background: var(--bg-color);
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.quiz-progress {
    flex: 1;
    min-width: 200px;
}

.progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

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

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

.quiz-controls {
    display: flex;
    gap: 0.5rem;
}

.quiz-content {
    padding: 2rem;
}

.question-card {
    margin-bottom: 2rem;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.question-type-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-mcq {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.badge-sata {
    background: rgba(8, 145, 178, 0.1);
    color: var(--secondary-color);
}

.badge-priority {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.badge-delegation {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.difficulty-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.difficulty-easy {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.difficulty-moderate {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.difficulty-hard {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.question-text {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.question-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option-item {
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: start;
    gap: 1rem;
}

.option-item:hover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.option-item input[type="radio"],
.option-item input[type="checkbox"] {
    margin-top: 0.25rem;
    cursor: pointer;
}

.option-item.selected {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.1);
}

.option-item.correct {
    border-color: var(--success-color);
    background: rgba(16, 185, 129, 0.1);
}

.option-item.incorrect {
    border-color: var(--danger-color);
    background: rgba(239, 68, 68, 0.1);
}

/* Quiz option styles for case studies */
.quiz-option {
    padding: 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
}

.quiz-option:hover {
    border-color: #667eea;
    background: linear-gradient(to right, rgba(102, 126, 234, 0.05), rgba(102, 126, 234, 0.02));
    transform: translateX(8px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.quiz-option.selected {
    border-color: #667eea;
    background: linear-gradient(to right, rgba(102, 126, 234, 0.12), rgba(102, 126, 234, 0.05));
    border-width: 3px;
    padding-left: calc(1.25rem - 1px); /* Compensate for thicker border */
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.quiz-option .option-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transition: all 0.2s ease;
}

.quiz-option:hover .option-letter {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.quiz-option.selected .option-letter {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: scale(1.15);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.5);
}

.quiz-option .option-text {
    flex: 1;
    color: #2d3748;
    line-height: 1.6;
    font-size: 1rem;
    transition: color 0.2s ease;
}

.quiz-option:hover .option-text {
    color: #1a202c;
}

.quiz-option.selected .option-text {
    color: #1a202c;
    font-weight: 500;
}

/* Add a subtle click/active state */
.quiz-option:active {
    transform: translateX(4px) scale(0.98);
}

.quiz-options {
    margin: 1.5rem 0;
}

.rationale-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-color);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.rationale-section h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rationale-section p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.clinical-pearls {
    background: rgba(37, 99, 235, 0.05);
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
}

.clinical-pearls h5 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quiz-footer {
    padding: 1.5rem;
    background: var(--bg-color);
    border-top: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.quiz-footer-center {
    flex: 1;
    text-align: center;
}

.bookmark-label {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.bookmark-label input[type="checkbox"] {
    cursor: pointer;
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.dashboard-card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 2rem;
}

.card-header {
    padding: 1.5rem;
    background: var(--bg-color);
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
}

.card-header i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.card-content {
    padding: 1.5rem;
}

.activity-list,
.weak-areas-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item,
.weak-area-item {
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
}

.activity-item h4,
.weak-area-item h4 {
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.activity-item p,
.weak-area-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* About Page */
.about-content {
    max-width: 900px;
    margin: 0 auto;
}

.about-section {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.about-section h2 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.about-section h2 i {
    color: var(--primary-color);
}

.about-section p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.step-card {
    text-align: center;
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: var(--transition);
}

.step-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.step-number {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.step-card h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.step-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.features-list {
    list-style: none;
    margin-top: 1rem;
}

.features-list li {
    padding: 0.75rem 0;
    display: flex;
    align-items: start;
    gap: 1rem;
}

.features-list i {
    color: var(--success-color);
    margin-top: 0.25rem;
}

.cta-section {
    text-align: center;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(8, 145, 178, 0.1));
}

.cta-section h2 {
    justify-content: center;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, var(--primary-dark), var(--text-primary));
    color: white;
    padding: 3rem 0 1rem;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section p {
    opacity: 0.9;
    line-height: 1.6;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
    opacity: 0.9;
    transition: var(--transition);
}

.footer-links a:hover {
    opacity: 1;
    padding-left: 5px;
}

.social-icons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-icons a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: var(--transition);
}

.social-icons a:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-bottom a {
    color: white;
    text-decoration: none;
    opacity: 0.9;
}

.footer-bottom a:hover {
    opacity: 1;
}

/* Loading Spinner */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
}

.loading-spinner.active {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-spinner p {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: var(--primary-dark);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow-lg);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .stats-grid,
    .categories-grid,
    .features-grid {
        grid-template-columns: 1fr;
    }

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

    .quiz-header,
    .quiz-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .quiz-controls {
        width: 100%;
        justify-content: space-between;
    }

    .topics-filters {
        flex-direction: column;
    }

    .filter-select {
        min-width: 100%;
    }

    .page-header h1 {
        font-size: 2rem;
    }

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

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.5rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .btn-large {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-1 {
    margin-bottom: 1rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

.mt-1 {
    margin-top: 1rem;
}

.mt-2 {
    margin-top: 2rem;
}

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

/* ========================================
   GAMIFICATION STYLES
   ======================================== */

/* Level Display */
.level-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem;
    border-radius: 12px;
    color: white;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

#user-level {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.level-badge {
    font-size: 2.5rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.level-text {
    font-size: 1.25rem;
    font-weight: 600;
}

/* XP Bar */
.xp-bar-container {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    height: 24px;
    overflow: hidden;
    position: relative;
    margin-top: 0.5rem;
}

#xp-bar {
    background: linear-gradient(90deg, #ffd700, #ffed4e);
    height: 100%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 20px;
    position: relative;
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.5);
}

#xp-bar::after {
    content: attr(data-xp);
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: #333;
}

#xp-text {
    text-align: center;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    opacity: 0.9;
}

/* XP Notifications */
.xp-notification-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    pointer-events: none;
}

.xp-notification {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 10px;
    animation: slideInRight 0.5s ease-out, slideOutRight 0.5s ease-in 2.5s;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.xp-amount {
    font-size: 1.5rem;
    font-weight: 700;
}

.xp-reason {
    font-size: 0.875rem;
    opacity: 0.9;
}

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

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

/* Level Up Overlay */
.level-up-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.5s ease-out;
}

.level-up-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    color: white;
    max-width: 500px;
    animation: scaleIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.level-up-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.level-up-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.level-up-badge {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    animation: rotate 2s ease-in-out infinite;
}

@keyframes rotate {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(360deg) scale(1.2); }
}

.level-up-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.level-arrow {
    font-size: 2.5rem;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.level-up-title-text {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.level-up-close {
    background: white;
    color: #667eea;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.level-up-close:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}

/* Badge Notifications */
.badge-notification-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    pointer-events: none;
}

.badge-notification {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    margin-top: 10px;
    animation: slideInUp 0.5s ease-out, slideOutDown 0.5s ease-in 4.5s;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    gap: 1rem;
    align-items: center;
    max-width: 350px;
}

.badge-icon {
    font-size: 3rem;
    animation: wiggle 0.5s ease-in-out;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

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

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

.badge-info {
    flex: 1;
}

.badge-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #667eea;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.badge-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: #333;
    margin: 0.25rem 0;
}

.badge-description {
    font-size: 0.875rem;
    color: #666;
}

.badge-xp {
    font-size: 0.875rem;
    color: #667eea;
    font-weight: 600;
    margin-top: 0.25rem;
}

/* Confetti Animation */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    top: -10px;
    z-index: 9998;
    animation: confetti-fall 4s linear forwards;
}

@keyframes confetti-fall {
    to {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Badges Grid */
.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.badge-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.badge-card.unlocked {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.badge-card.locked {
    opacity: 0.4;
    filter: grayscale(100%);
}

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

.badge-card-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.badge-card-name {
    font-weight: 600;
    color: #333;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.badge-card-description {
    font-size: 0.75rem;
    color: #666;
}

.badge-card-xp {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #667eea;
    font-weight: 600;
}

/* Progress Animations */
.progress-bar-animated {
    position: relative;
    overflow: hidden;
}

.progress-bar-animated::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Stats Cards Enhancement */
.stat-card.gamified {
    position: relative;
    overflow: hidden;
}

.stat-card.gamified::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(102, 126, 234, 0.1),
        transparent
    );
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .level-up-content {
        padding: 2rem;
        max-width: 90%;
    }
    
    .level-up-title {
        font-size: 2rem;
    }
    
    .level-up-badge {
        font-size: 3rem;
    }
    
    .badge-notification {
        max-width: calc(100vw - 40px);
    }
    
    .xp-notification-container {
        right: 10px;
        left: 10px;
    }
    
    .badges-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

/* ========================================
   RESOURCES SIDEBAR STYLES
   ======================================== */

.sidebar {
    position: fixed;
    left: 0;
    top: 80px;
    height: calc(100vh - 80px);
    width: 280px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    transform: translateX(0);
    z-index: 999;
    overflow-y: auto;
    display: block !important;
    visibility: visible !important;
}

.sidebar.collapsed {
    transform: translateX(-280px);
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.sidebar-header i {
    margin-right: 0.5rem;
}

.sidebar-toggle {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.sidebar.collapsed {
    transform: translateX(-280px);
}

.sidebar.collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

.sidebar-menu {
    padding: 1rem 0;
}

.sidebar-item {
    margin-bottom: 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.1);
    padding-left: 2rem;
}

.sidebar-link i:first-child {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

.sidebar-link span {
    flex: 1;
}

.sidebar-link .arrow {
    transition: transform 0.3s ease;
    margin-right: 0;
    margin-left: auto;
}

.sidebar-item.active .sidebar-link .arrow {
    transform: rotate(90deg);
}

.sidebar-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0,0,0,0.2);
}

.sidebar-item.active .sidebar-submenu {
    max-height: 500px;
}

.sidebar-submenu a {
    display: flex;
    align-items: center;
    padding: 0.6rem 1.5rem 0.6rem 3rem;
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.sidebar-submenu a:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    padding-left: 3.5rem;
}

.sidebar-submenu a i {
    margin-right: 0.5rem;
    width: 18px;
    text-align: center;
    font-size: 0.85rem;
}

/* Main content adjustment when sidebar is visible */
.main-with-sidebar {
    margin-left: 280px;
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed ~ .main-with-sidebar {
    margin-left: 0;
}

/* Responsive sidebar */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-280px);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .main-with-sidebar {
        margin-left: 0;
    }
}

/* Sidebar toggle button (mobile) */
.sidebar-mobile-toggle {
    position: fixed;
    left: 10px;
    bottom: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    z-index: 998;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.sidebar-mobile-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

@media (max-width: 768px) {
    .sidebar-mobile-toggle {
        display: flex;
    }
}

/* ========================================
   TIMED QUIZ MODE STYLES
   ======================================== */

/* Timer Display */
.quiz-timer-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.timer-label {
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 0.9;
}

#quiz-timer {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

#quiz-timer.timer-warning {
    color: #ffd700;
    animation: pulse-warning 1s ease-in-out infinite;
}

#quiz-timer.timer-critical {
    color: #ff6b6b;
    animation: pulse-critical 0.5s ease-in-out infinite;
}

@keyframes pulse-warning {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

@keyframes pulse-critical {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}

/* Time Warning Notifications */
.time-warning-notification {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.125rem;
    font-weight: 600;
    box-shadow: 0 8px 30px rgba(255, 107, 107, 0.5);
    z-index: 10000;
    animation: slideInDown 0.5s ease-out, slideOutUp 0.5s ease-in 2.5s;
}

.time-warning-notification i {
    font-size: 1.5rem;
}

@keyframes slideOutUp {
    from {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    to {
        transform: translateX(-50%) translateY(-100px);
        opacity: 0;
    }
}

/* Quiz Mode Selection */
.quiz-mode-selector {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.quiz-mode-selector h3 {
    margin-bottom: 1.5rem;
    color: #333;
}

.quiz-modes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.quiz-mode-card {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.quiz-mode-card:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

.quiz-mode-card.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.quiz-mode-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.quiz-mode-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
}

.quiz-mode-description {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 1rem;
}

.quiz-mode-features {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.8rem;
    color: #999;
}

.quiz-mode-features li {
    margin: 0.25rem 0;
}

.quiz-mode-features li:before {
    content: "✓ ";
    color: #667eea;
    font-weight: bold;
}

/* Timed Mode Settings */
.timed-settings {
    display: none;
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.timed-settings.active {
    display: block;
}

.setting-group {
    margin-bottom: 1.5rem;
}

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

.setting-group select,
.setting-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
}

.time-presets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.time-preset-btn {
    padding: 0.75rem;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.time-preset-btn:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.time-preset-btn.selected {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

/* NCLEX Simulation Mode */
.nclex-simulation-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    text-align: center;
}

.nclex-simulation-header h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.75rem;
}

.nclex-simulation-header p {
    margin: 0;
    opacity: 0.9;
}

.simulation-stats {
    display: flex;
    justify-content: space-around;
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.simulation-stat {
    text-align: center;
}

.simulation-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
}

.simulation-stat-label {
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.25rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .quiz-timer-container {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    #quiz-timer {
        font-size: 1.5rem;
    }
    
    .quiz-modes {
        grid-template-columns: 1fr;
    }
    
    .time-presets {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .simulation-stats {
        flex-direction: column;
        gap: 1rem;
    }
}


/* ========================================
   ENHANCED ANALYTICS DASHBOARD STYLES
   ======================================== */

/* Gamification Overview */
.gamification-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.gamification-stat {
    text-align: center;
}

.gamification-stat-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.gamification-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
}

.gamification-stat-label {
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.25rem;
}

.xp-progress-container {
    margin-top: 1.5rem;
}

.xp-progress-label {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.5rem;
    text-align: center;
}

.xp-progress-bar {
    height: 20px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.xp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.6s ease;
}

/* NCLEX Readiness Score */
.readiness-score-container {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin: 2rem 0;
}

.readiness-score-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.readiness-score-inner {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.readiness-score-value {
    font-size: 3rem;
    font-weight: 700;
    color: #333;
}

.readiness-score-max {
    font-size: 1rem;
    color: #999;
}

.readiness-info {
    flex: 1;
}

.readiness-level {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.readiness-message {
    font-size: 1rem;
    color: #666;
    line-height: 1.6;
}

.readiness-factors {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e5e7eb;
}

.readiness-factors h4 {
    margin-bottom: 1rem;
    color: #333;
}

.readiness-factor {
    margin-bottom: 1.5rem;
}

.readiness-factor-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.readiness-factor-name {
    font-weight: 600;
    color: #333;
}

.readiness-factor-value {
    font-weight: 700;
    color: #667eea;
}

.readiness-factor-bar {
    height: 10px;
    background: #e5e7eb;
    border-radius: 5px;
    overflow: hidden;
}

.readiness-factor-fill {
    height: 100%;
    transition: width 0.6s ease;
}

.readiness-factor-weight {
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.25rem;
    display: block;
}

/* Recommendations */
.recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.recommendation-item {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #e5e7eb;
    transition: all 0.3s ease;
}

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

.recommendation-item.high {
    border-left-color: #ef4444;
    background: linear-gradient(to right, rgba(239, 68, 68, 0.05), #f8f9fa);
}

.recommendation-item.medium {
    border-left-color: #667eea;
    background: linear-gradient(to right, rgba(102, 126, 234, 0.05), #f8f9fa);
}

.recommendation-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.recommendation-content {
    flex: 1;
}

.recommendation-content h4 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-size: 1.125rem;
}

.recommendation-content p {
    margin: 0 0 1rem 0;
    color: #666;
    font-size: 0.875rem;
    line-height: 1.6;
}

.recommendation-content .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Chart Containers */
#performance-time-chart,
#category-radar-chart {
    max-height: 300px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .gamification-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .readiness-score-container {
        flex-direction: column;
        text-align: center;
    }
    
    .readiness-score-circle {
        width: 150px;
        height: 150px;
    }
    
    .readiness-score-inner {
        width: 120px;
        height: 120px;
    }
    
    .readiness-score-value {
        font-size: 2.5rem;
    }
    
    .recommendation-item {
        flex-direction: column;
        text-align: center;
    }
}


/* ========================================
   THEME SYSTEM STYLES
   ======================================== */

:root {
    /* Default light theme colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-tertiary: #adb5bd;
    --border-color: #dee2e6;
    --shadow: rgba(0, 0, 0, 0.1);
    --primary: #667eea;
    --primary-dark: #5568d3;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
}

/* Theme-aware components */
body {
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.navbar {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px var(--shadow);
}

.dashboard-card,
.stat-card,
.feature-card,
.category-card {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 10px var(--shadow);
}

.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

/* Theme Toggle Button */
.theme-toggle-btn {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.3s ease;
    margin-left: 1rem;
}

.theme-toggle-btn:hover {
    background: var(--bg-secondary);
    transform: scale(1.1);
    border-color: var(--primary);
}

/* Theme Selector Modal */
.theme-selector-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    animation: fadeIn 0.3s ease;
}

.theme-selector-content {
    background: var(--bg-primary);
    border-radius: 20px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
    animation: slideInUp 0.3s ease;
}

.theme-selector-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.theme-selector-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.theme-selector-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-selector-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.theme-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
}

.theme-option {
    position: relative;
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
}

.theme-option:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--shadow);
    border-color: var(--primary);
}

.theme-option.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.theme-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.theme-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.theme-preview {
    height: 60px;
    border-radius: 8px;
    margin: 0 auto;
    width: 100%;
}

.theme-check {
    position: absolute;
    top: 10px;
    right: 10px;
    color: var(--success);
    font-size: 1.5rem;
}

/* Dark theme specific adjustments */
body.theme-dark .navbar {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

body.theme-dark .hero {
    background: linear-gradient(135deg, #667eea 0%, #3a4a8f 100%);
}

body.theme-dark .stat-card,
body.theme-dark .feature-card,
body.theme-dark .category-card {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

body.theme-dark .btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

body.theme-dark .btn-secondary:hover {
    background: var(--bg-secondary);
}

/* Navy theme adjustments */
body.theme-navy .hero {
    background: linear-gradient(135deg, #64ffda 0%, #3a9985 100%);
}

body.theme-navy .level-container,
body.theme-navy .quiz-timer-container {
    background: linear-gradient(135deg, #64ffda 0%, #3a9985 100%);
}

/* Forest theme adjustments */
body.theme-forest .hero {
    background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
}

body.theme-forest .level-container,
body.theme-forest .quiz-timer-container {
    background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
}

/* Purple theme adjustments */
body.theme-purple .hero {
    background: linear-gradient(135deg, #9c27b0 0%, #6a1b9a 100%);
}

body.theme-purple .level-container,
body.theme-purple .quiz-timer-container {
    background: linear-gradient(135deg, #9c27b0 0%, #6a1b9a 100%);
}

/* Sunset theme adjustments */
body.theme-sunset .hero {
    background: linear-gradient(135deg, #ff9800 0%, #e65100 100%);
}

body.theme-sunset .level-container,
body.theme-sunset .quiz-timer-container {
    background: linear-gradient(135deg, #ff9800 0%, #e65100 100%);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .theme-options {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        padding: 1.5rem;
    }
    
    .theme-option {
        padding: 1rem;
    }
    
    .theme-icon {
        font-size: 2rem;
    }
}


/* ========================================
   DAILY CHALLENGES STYLES
   ======================================== */

.daily-challenges-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.challenges-progress {
    text-align: right;
}

.challenges-progress span {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.5rem;
}

.challenges-progress-bar {
    width: 150px;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.challenges-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    transition: width 0.6s ease;
}

.daily-challenges-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.daily-challenge-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.daily-challenge-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px var(--shadow);
}

.daily-challenge-item.completed {
    border-color: var(--success);
    background: linear-gradient(to right, rgba(16, 185, 129, 0.1), var(--bg-secondary));
}

.challenge-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.challenge-info {
    flex: 1;
}

.challenge-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.challenge-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.challenge-progress-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.challenge-progress-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.challenge-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    transition: width 0.6s ease;
}

.challenge-progress-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.challenge-reward {
    text-align: center;
    min-width: 80px;
}

.challenge-reward span {
    display: block;
    font-weight: 700;
    color: var(--primary);
    font-size: 1.125rem;
}

.challenge-reward i {
    font-size: 2rem;
    color: var(--success);
}

/* Challenge Complete Notification */
.challenge-complete-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 8px 30px var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 9999;
    animation: slideInUp 0.5s ease, slideOutDown 0.5s ease 3.5s;
    max-width: 400px;
}

.challenge-complete-icon {
    font-size: 3rem;
    animation: bounce 0.6s ease;
}

.challenge-complete-content {
    flex: 1;
}

.challenge-complete-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--success);
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.challenge-complete-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.challenge-complete-reward {
    font-size: 0.875rem;
    color: var(--primary);
    font-weight: 600;
}

/* All Challenges Complete */
.all-challenges-complete {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(102, 126, 234, 0.1));
    border-radius: 12px;
    margin-top: 1.5rem;
}

.completion-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 1s infinite;
}

.completion-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.completion-message {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Challenge Button Badge */
#daily-challenge-btn {
    position: relative;
}

#daily-challenge-btn.has-challenges::after {
    content: attr(data-count);
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    animation: pulse 2s infinite;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .daily-challenge-item {
        flex-direction: column;
        text-align: center;
    }
    
    .challenge-progress-wrapper {
        width: 100%;
    }
    
    .challenge-complete-notification {
        left: 10px;
        right: 10px;
        bottom: 10px;
        max-width: none;
    }
}


/* Download Animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

/* Interactive Flashcards */
.flashcard-interactive {
    perspective: 1000px;
    margin: 1rem 0;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    min-height: 200px;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flashcard-inner.flipped {
    transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    min-height: 200px;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--shadow);
    cursor: pointer;
}

.flashcard-front {
    background: var(--bg-card);
    color: var(--text-primary);
}

.flashcard-back {
    background: var(--primary);
    color: white;
    transform: rotateY(180deg);
}

.flashcard-deck-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.flashcard-controls {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: center;
}

/* Responsive Flashcards */
@media (max-width: 768px) {
    .flashcard-deck-container {
        grid-template-columns: 1fr;
    }
    
    .flashcard-front,
    .flashcard-back {
        min-height: 150px;
        padding: 1.5rem;
    }
}

/* Leaderboard Styles */
.leaderboard-user-card {
    background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
    color: white;
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.3);
}

.user-rank-badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    min-width: 120px;
}

.rank-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.rank-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

.user-rank-stats {
    display: flex;
    gap: 2rem;
    flex: 1;
    flex-wrap: wrap;
}

.rank-stat {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.rank-stat i {
    font-size: 2rem;
    opacity: 0.8;
}

.rank-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.rank-stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

.leaderboard-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.leaderboard-tab {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.leaderboard-tab:hover {
    color: var(--primary);
    background: var(--bg-secondary);
}

.leaderboard-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.leaderboard-podium {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.podium-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 15px var(--shadow);
    transition: transform 0.3s ease;
}

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

.podium-medal {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.podium-rank {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.podium-avatar {
    font-size: 3rem;
    margin: 1rem 0;
}

.podium-name {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.podium-name.current-user {
    color: var(--primary);
    font-weight: 700;
}

.podium-level {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.podium-xp {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0.75rem 0;
}

.podium-stats {
    display: flex;
    justify-content: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.leaderboard-rows {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.leaderboard-row {
    display: grid;
    grid-template-columns: 60px 2fr 1fr 1.5fr 1fr 1fr 1fr;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.leaderboard-row:hover {
    background: var(--bg-secondary);
    transform: translateX(5px);
}

.current-user-row {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.1) 0%, transparent 100%);
    border-left: 4px solid var(--primary);
}

.lb-rank {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-align: center;
}

.lb-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.lb-avatar {
    font-size: 1.5rem;
}

.lb-name {
    font-weight: 600;
    color: var(--text-primary);
}

.lb-you-badge {
    background: var(--primary);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

.lb-level,
.lb-xp,
.lb-accuracy,
.lb-streak,
.lb-badges {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.lb-xp {
    font-weight: 600;
    color: var(--primary);
}

.leaderboard-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-color);
    text-align: center;
}

.leaderboard-footer p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0.5rem 0;
}

/* Responsive Leaderboard */
@media (max-width: 968px) {
    .leaderboard-podium {
        grid-template-columns: 1fr;
    }
    
    .leaderboard-row {
        grid-template-columns: 50px 1.5fr 0.8fr 1fr;
        font-size: 0.875rem;
        padding: 0.75rem;
    }
    
    .lb-streak,
    .lb-badges {
        display: none;
    }
    
    .user-rank-stats {
        gap: 1rem;
    }
    
    .rank-stat {
        flex-direction: column;
        text-align: center;
        gap: 0.25rem;
    }
}

@media (max-width: 600px) {
    .leaderboard-user-card {
        flex-direction: column;
        padding: 1.5rem;
    }
    
    .user-rank-badge {
        min-width: auto;
        width: 100%;
    }
    
    .leaderboard-row {
        grid-template-columns: 40px 1fr 0.8fr;
    }
    
    .lb-level,
    .lb-accuracy {
        display: none;
    }
}

/* Clickable Stat Card */
.stat-card.clickable {
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card.clickable:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--shadow);
}
/* CRITICAL FIXES FOR VISIBILITY ISSUES */

/* Ensure navbar is always on top and visible */
.navbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9999 !important;
    background: linear-gradient(135deg, #2563eb, #1e40af) !important;
}

/* Fix navigation links visibility */
.nav-link {
    color: white !important;
    font-weight: 600 !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2) !important;
}

/* Add padding to main content so it's not hidden under fixed navbar */
main {
    margin-top: 80px !important;
    position: relative;
    z-index: 1;
}

/* Fix hero section button visibility */
.hero-section .btn-secondary {
    background: transparent !important;
    border: 2px solid white !important;
    color: white !important;
    font-weight: 600 !important;
}

.hero-section .btn-primary {
    background: white !important;
    color: #2563eb !important;
    font-weight: 600 !important;
    border: 2px solid white !important;
}

/* Ensure all buttons are visible */
.btn {
    position: relative;
    z-index: 10;
}

/* Force main content to account for sidebar */
main {
    margin-left: 280px !important;
    margin-top: 80px !important;
}

@media (max-width: 968px) {
    .sidebar {
        transform: translateX(-280px) !important;
    }
    .sidebar.active {
        transform: translateX(0) !important;
    }
    main {
        margin-left: 0 !important;
    }
}

/* ========================================
   CRITICAL NAVIGATION FIXES
   ======================================== */

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

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.2rem;
    align-items: center;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 0.65rem;
    border-radius: 6px;
    transition: var(--transition);
    white-space: nowrap;
    font-size: 0.9rem;
}

.nav-link i {
    font-size: 0.9rem !important;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    transform: translateY(-1px) !important;
}

/* Ensure FAQ and Login are visible */
.nav-menu li:nth-last-child(1),
.nav-menu li:nth-last-child(2) {
    margin-right: 0 !important;
}

/* Scrollbar for navigation if needed */
.nav-menu::-webkit-scrollbar {
    height: 4px;
}

.nav-menu::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.nav-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.nav-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Mobile responsiveness */
@media (max-width: 1200px) {
    .nav-link {
        padding: 0.4rem 0.5rem !important;
        font-size: 0.75rem !important;
    }
    
    .nav-link i {
        font-size: 0.85rem !important;
    }
}

@media (max-width: 992px) {
    .nav-menu {
        gap: 0.3rem !important;
    }
    
    .nav-link {
        padding: 0.4rem 0.4rem !important;
        font-size: 0.7rem !important;
    }
}

/* ========================================
   FLASHCARD & RESOURCE MODAL FIXES
   ======================================== */

/* Ensure modals are always on top and visible */
.resource-modal {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.75) !important;
    z-index: 10000 !important;
    justify-content: center !important;
    align-items: center !important;
    overflow-y: auto !important;
}

.resource-modal-content {
    background: white !important;
    border-radius: 12px !important;
    max-width: 900px !important;
    width: 90% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important;
    position: relative !important;
    margin: 2rem auto !important;
}

.resource-modal-header {
    padding: 1.5rem !important;
    border-bottom: 2px solid #e0e0e0 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)) !important;
    color: white !important;
    border-radius: 12px 12px 0 0 !important;
}

.resource-modal-body {
    padding: 2rem !important;
    color: #333 !important;
}

/* Flashcard specific fixes */
.flashcard-inner {
    min-height: 300px !important;
    display: block !important;
    position: relative !important;
    transform-style: preserve-3d !important;
    transition: transform 0.6s !important;
}

.flashcard-inner.flipped {
    transform: rotateY(180deg) !important;
}

.flashcard-front,
.flashcard-back {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 3rem 2rem !important;
    min-height: 300px !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2) !important;
    cursor: pointer !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
}

.flashcard-back {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    transform: rotateY(180deg) !important;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
}

/* Ensure cheatsheet content is fully visible */
.resource-modal-body h3,
.resource-modal-body h4,
.resource-modal-body p,
.resource-modal-body ul,
.resource-modal-body ol,
.resource-modal-body div {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.resource-modal-body ul,
.resource-modal-body ol {
    padding-left: 2rem !important;
    margin: 1rem 0 !important;
}

.resource-modal-body li {
    margin: 0.5rem 0 !important;
    line-height: 1.6 !important;
}

/* ========================================
   PAGE VISIBILITY FIXES
   ======================================== */

/* Ensure all pages can be displayed */
.page {
    display: none !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
}

.page.active {
    display: block !important;
    opacity: 1 !important;
}

/* ========================================
   QUIZ ERROR PREVENTION
   ======================================== */

/* Ensure quiz container is visible */
#quiz-content {
    display: block !important;
    visibility: visible !important;
    min-height: 400px !important;
}

/* Loading indicator */
.loading-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(255, 255, 255, 0.95) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    z-index: 9999 !important;
}


.sidebar-open-btn {
    display: none !important;
}

.sidebar.collapsed ~ .sidebar-open-btn {
    display: block !important;
}


/* ================================
   CASE STUDIES STYLES
   ================================ */

.case-studies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.case-study-card {
    transition: all 0.3s ease;
}

.case-study-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(102, 126, 234, 0.3) !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .case-studies-grid {
        grid-template-columns: 1fr;
    }
}


/* ========================================
   WELCOME MODAL STYLES
   ======================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
}

.modal-content-welcome {
    background: var(--bg-card);
    border-radius: 20px;
    max-width: 900px;
    max-height: 90vh;
    width: 90%;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease-out;
}

.modal-close-btn {
    position: sticky;
    top: 1rem;
    right: 1rem;
    float: right;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s;
}

.modal-close-btn:hover {
    background: var(--primary-dark);
    transform: rotate(90deg);
}

.modal-body-welcome {
    padding: 3rem;
}

.feature-item {
    margin-bottom: 2rem;
}

.feature-item h3 {
    color: var(--primary);
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.feature-item p {
    color: var(--text);
    line-height: 1.8;
    margin-bottom: 0.5rem;
}

.feature-item ul {
    color: var(--text);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Mobile responsive for welcome modal */
@media (max-width: 768px) {
    .modal-content-welcome {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-body-welcome {
        padding: 2rem 1.5rem;
    }
    
    .modal-body-welcome h1 {
        font-size: 1.5rem !important;
    }
    
    .modal-body-welcome h2 {
        font-size: 1.3rem !important;
    }
    
    .feature-item h3 {
        font-size: 1.1rem;
    }
}

/* Update container to be full width */
.container {
    max-width: 100%;
    margin: 0;
    padding: 0 2rem;
    width: 100%;
}

#home-page .container {
    max-width: 100%;
    padding: 0 3rem;
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    #home-page .container {
        padding: 0 1.5rem;
    }
}
