:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding-top: 76px;
    background-color: #f8f9fa;
}

.main-content {
    min-height: calc(100vh - 200px);
}

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

.hero-section h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-section p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* Study Materials Styles */
.material-item {
    transition: all 0.3s ease;
}

.material-item:hover {
    transform: translateY(-2px);
}

.material-item .card {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.material-item:hover .card {
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.list-view .material-item {
    width: 100%;
    max-width: none;
}

.list-view .card {
    margin-bottom: 1rem;
}

.list-view .card-body {
    display: flex;
    align-items: center;
    padding: 1rem;
}

.list-view .card-title {
    margin-bottom: 0.25rem;
}

.material-content img {
    max-width: 100%;
    height: auto;
}

.material-sidebar .card {
    border: 1px solid #dee2e6;
}

/* Chart Container Optimization */
.chart-container {
    position: relative;
    margin: auto;
    height: 250px !important;
    width: 100% !important;
    overflow: hidden;
}

.chart-container canvas {
    max-height: 250px !important;
    width: 100% !important;
    height: auto !important;
}

@media (max-width: 768px) {
    .chart-container {
        height: 200px !important;
    }
    
    .chart-container canvas {
        max-height: 200px !important;
    }
}

/* Dashboard Widget Optimization */
.dashboard-widget {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.dashboard-widget .widget-title {
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--dark-color);
}

/* Performance optimizations */
.stats-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.stats-card:hover {
    transform: translateY(-2px);
}

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

.stats-label {
    color: var(--secondary-color);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Filter Cards */
.filter-card {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Material Type Badges */
.badge.bg-danger {
    background-color: #dc3545 !important;
}

.badge.bg-success {
    background-color: #198754 !important;
}

.badge.bg-primary {
    background-color: #0d6efd !important;
}

.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
}

/* Responsive improvements */
@media (max-width: 576px) {
    .material-item {
        margin-bottom: 1rem;
    }
    
    .dashboard-widget {
        padding: 1rem;
    }
    
    .stats-number {
        font-size: 2rem;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .hero-section-small {
        padding: 40px 0;
    }
}

.hero-section-small::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.hero-section-small .container {
    position: relative;
    z-index: 2;
}

/* Cards */
.feature-card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.feature-card .card-body {
    padding: 2rem;
}

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

/* Blog Styles */
.blog-post-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    overflow: hidden;
}

.blog-post-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.blog-post-card .card-img-top {
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-post-card:hover .card-img-top {
    transform: scale(1.05);
}

.badge-category {
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
}

/* Exam Interface */
.exam-container {
    max-width: 1000px;
    margin: 0 auto;
}

.question-card {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
    background: white;
}

.question-number {
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 1rem;
}

.option-item {
    margin: 0.5rem 0;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-item:hover {
    background-color: #f8f9fa;
    border-color: var(--primary-color);
}

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

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

.option-item.incorrect {
    background-color: var(--danger-color) !important;
    border-color: var(--danger-color) !important;
    color: white;
}

/* Timer */
.exam-timer {
    position: fixed;
    top: 90px;
    right: 20px;
    background: white;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.timer-display {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.timer-warning {
    color: var(--warning-color) !important;
}

.timer-danger {
    color: var(--danger-color) !important;
}

/* Progress Bar */
.progress-container {
    margin-bottom: 2rem;
}

.progress {
    height: 10px;
    border-radius: 5px;
}

/* Statistics */
.stats-card {
    background: linear-gradient(45deg, var(--primary-color), var(--info-color));
    color: white;
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
}

.stats-number {
    font-size: 2.5rem;
    font-weight: bold;
    display: block;
}

.stats-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Dashboard */
.dashboard-widget {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

/* Forms */
.form-floating {
    margin-bottom: 1rem;
}

.btn-custom {
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

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

/* Enhanced Buttons */
.btn-custom-gradient {
    background: linear-gradient(45deg, var(--primary-color), var(--info-color));
    border: none;
    color: white;
    transition: all 0.3s ease;
}

.btn-custom-gradient:hover {
    background: linear-gradient(45deg, var(--info-color), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Leaderboard */
.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.rank-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 1rem;
}

.rank-1 { background: #ffd700; color: #333; }
.rank-2 { background: #c0c0c0; color: #333; }
.rank-3 { background: #cd7f32; color: white; }
.rank-other { background: var(--light-color); color: var(--dark-color); }

/* Step by Step Process */
.step-number {
    font-size: 1.5rem;
    width: 60px;
    height: 60px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.process-step {
    position: relative;
    padding: 2rem 0;
}

.process-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -15px;
    width: 30px;
    height: 2px;
    background: var(--primary-color);
    transform: translateY(-50%);
}

/* Privacy and Terms Styles */
.terms-nav .nav-link {
    color: var(--dark-color);
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
    transition: all 0.3s ease;
}

.terms-nav .nav-link:hover,
.terms-nav .nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

/* Table Enhancements */
.table-hover tbody tr:hover td {
    background-color: rgba(13, 110, 253, 0.05);
}

.table-bordered th,
.table-bordered td {
    border-color: #dee2e6;
}

/* Testimonial Cards */
.testimonial-card {
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.testimonial-card:hover {
    border-left-color: var(--success-color);
    transform: translateX(5px);
}

.testimonial-card .card-body {
    position: relative;
}

.testimonial-card .card-body::before {
    content: '"';
    font-size: 4rem;
    color: var(--primary-color);
    position: absolute;
    top: -10px;
    left: -10px;
    opacity: 0.2;
    font-family: Georgia, serif;
}

/* Additional Styles for Rich Content Pages */

/* Loading States */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --text-color: #ffffff;
        --card-bg: #2d2d2d;
    }
    
    body {
        background-color: var(--bg-color);
        color: var(--text-color);
    }
    
    .card {
        background-color: var(--card-bg);
        border-color: #404040;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .card {
        border: 1px solid #ddd !important;
        page-break-inside: avoid;
    }
    
    .hero-section,
    .hero-section-small {
        background: none !important;
        color: #000 !important;
    }
}

/* Accessibility Improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 9999;
}

.skip-link:focus {
    top: 6px;
}

/* Focus indicators */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
    
    .exam-timer {
        position: relative;
        top: 0;
        right: 0;
        margin-bottom: 1rem;
    }
    
    .question-card {
        padding: 1rem;
    }
    
    .option-item {
        padding: 0.75rem;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 60px 0;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .feature-card .card-body {
        padding: 1.5rem;
    }
    
    .stats-number {
        font-size: 2rem;
    }
}

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

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Loading Spinner */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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