* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary-color: #4f46e5;
    --primary-dark: #3730a3;
    --secondary-color: #f59e0b;
    --secondary-dark: #d97706;
    --success-color: #22c55e;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --light-color: #f8f9fa;
    --dark-color: #1e1b4b;
    --gray-color: #6b7280;
    --light-gray: #e5e7eb;
    --border-radius: 12px;
    --box-shadow: 0 4px 16px rgba(79, 70, 229, 0.1);
    --transition: all 0.3s ease;
}

body {
    background-color: #f5f4ff;
    color: var(--dark-color);
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--dark-color);
}

.logo-icon {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-right: 12px;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.category-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.logo-text h1 {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--primary-dark);
}

.logo-text p {
    font-size: 0.78rem;
    color: var(--gray-color);
    letter-spacing: 0.3px;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 1.5rem;
}

nav ul li a {
    color: var(--dark-color);
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

nav ul li a:hover {
    background-color: var(--light-gray);
    color: var(--primary-color);
}

nav ul li a.active {
    background-color: var(--primary-color);
    color: white;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #6d28d9 100%);
    color: white;
    padding: 4.5rem 0 3.5rem;
    text-align: center;
    border-radius: 0 0 24px 24px;
    margin-bottom: 2.5rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -60px;
    width: 320px;
    height: 320px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: -40px;
    width: 260px;
    height: 260px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
    pointer-events: none;
}

.hero h1 {
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.15rem;
    max-width: 620px;
    margin: 0 auto 2rem;
    opacity: 0.88;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn i {
    margin-right: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #7c3aed);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.45);
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid white;
    color: white;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Main Content */
.content-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

@media (max-width: 992px) {
    .content-section {
        grid-template-columns: 1fr;
    }
}

/* Test Section */
.test-section {
    background-color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.section-title {
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--light-gray);
    display: flex;
    align-items: center;
}

.section-title i {
    margin-right: 10px;
    color: var(--secondary-color);
}

/* Test Navigation */
.test-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.category-card {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    border: 2px solid transparent;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary-color);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.15);
}

.category-card.active {
    border-color: var(--primary-color);
    background-color: #eef2ff;
}

.category-icon {
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    color: var(--primary-color);
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 1rem;
}

.category-card h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
}

.category-card p {
    color: var(--gray-color);
    font-size: 0.9rem;
}

/* Test Interface */
.test-interface {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
    display: none;
}

.test-interface.active {
    display: block;
}

.test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--light-gray);
}

.question-counter {
    background: linear-gradient(135deg, var(--primary-color), #7c3aed);
    color: white;
    padding: 0.5rem 1.1rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.2px;
}

.test-timer {
    display: flex;
    align-items: center;
    color: var(--danger-color);
    font-weight: 600;
}

.test-timer i {
    margin-right: 8px;
}

.test-question {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.test-image {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    border: 1px solid var(--light-gray);
}

.test-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.option {
    padding: 1rem 1.5rem;
    border: 2px solid var(--light-gray);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.option:hover {
    background-color: #fafafe;
    border-color: #c7d2fe;
}

.option.selected {
    border-color: var(--primary-color);
    background-color: #eef2ff;
}

.option.correct {
    border-color: var(--success-color);
    background-color: #e8f5e9;
}

.option.incorrect {
    border-color: var(--danger-color);
    background-color: #ffebee;
}

.option-letter {
    background-color: var(--light-gray);
    color: var(--dark-color);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 15px;
    flex-shrink: 0;
}

.option.selected .option-letter {
    background: linear-gradient(135deg, var(--primary-color), #7c3aed);
    color: white;
}

.test-controls {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #3d8b40;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.user-stats, .pdr-rules, .quick-links, .news-section {
    background-color: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.news-item {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--light-gray);
}

.news-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.news-title {
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.35rem;
}

.news-title a {
    color: inherit;
    text-decoration: none;
}

.news-title a:hover {
    color: var(--secondary-color);
}

.news-date {
    font-size: 0.85rem;
    color: var(--gray-color);
    margin-bottom: 0.5rem;
}

.news-body {
    font-size: 0.95rem;
    color: var(--dark-color);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-full-body {
    font-size: 1rem;
    color: var(--dark-color);
    line-height: 1.7;
}

.comment-form textarea {
    width: 100%;
}

.reply-toggle {
    background: none;
    border: none;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-top: 0.5rem;
}

.reply-toggle:hover {
    color: var(--secondary-color);
}

.comment-reply-form {
    margin-top: 0.75rem;
    display: none;
}

.comment-reply-form.is-visible {
    display: block;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment-item {
    background-color: #f7f9ff;
    border: 1px solid #e5ecff;
    border-radius: 8px;
    padding: 0.85rem 1rem;
}

.comment-item.reply {
    background-color: #ffffff;
}

.comment-replies {
    margin-top: 0.75rem;
    padding-left: 1rem;
    border-left: 2px solid #e5ecff;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.comment-date {
    font-size: 0.85rem;
    color: var(--gray-color);
}

.comment-body {
    color: var(--dark-color);
    white-space: pre-wrap;
}

.news-empty {
    color: var(--gray-color);
}

.stats-item {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--light-gray);
}

.leaderboard {
    background-color: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 1.5rem;
}

.leaderboard-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.leaderboard-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 0.5rem;
    align-items: center;
    padding: 0.6rem 0.8rem;
    background-color: #f7f9ff;
    border-radius: 8px;
    border: 1px solid #e5ecff;
}

.leaderboard-rank {
    font-weight: 700;
    color: var(--primary-dark);
    min-width: 36px;
}

.leaderboard-name {
    font-weight: 600;
    color: var(--dark-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard-points {
    font-weight: 700;
    color: var(--secondary-dark);
}

.leaderboard-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    color: white;
    background-color: var(--gray-color);
    text-transform: uppercase;
}

.leaderboard-badge.top1 {
    background-color: #f5b700;
}

.leaderboard-badge.top3 {
    background-color: #ff9800;
}

.leaderboard-badge.top10 {
    background-color: var(--primary-color);
}

.leaderboard-empty {
    color: var(--gray-color);
    padding: 0.5rem 0;
}

.stats-item:last-child {
    border-bottom: none;
}

.stats-value {
    font-weight: 600;
    color: var(--primary-color);
}

.rules-list {
    list-style: none;
}

.rules-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--light-gray);
}

.rules-list li:last-child {
    border-bottom: none;
}

.rules-list a {
    color: var(--dark-color);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.rules-list a:hover {
    color: var(--primary-color);
}

.rules-list i {
    margin-right: 10px;
    color: var(--secondary-color);
}

/* Results Section */
.results-section {
    background-color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
    display: none;
}

.results-section.active {
    display: block;
}

.results-summary {
    text-align: center;
    padding: 2rem;
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
}

.results-score {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.results-message {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.results-details {
    margin-bottom: 2rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
    background-color: #f8f9fa;
}

/* Footer */
footer {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    color: white;
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: #ddd;
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
    padding-left: 5px;
}

.copyright {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #aaa;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        text-align: center;
    }

    nav ul {
        margin-top: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    nav ul li {
        margin: 0.3rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .test-categories {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .mobile-menu-btn {
        display: block;
        position: absolute;
        right: 20px;
        top: 25px;
    }

    nav {
        width: 100%;
        display: none;
        margin-top: 1rem;
    }

    nav.active {
        display: block;
    }

    nav ul {
        flex-direction: column;
    }

    nav ul li {
        margin: 0.5rem 0;
    }

    .test-controls {
        flex-direction: column;
        gap: 1rem;
    }

    .test-controls .btn {
        width: 100%;
    }
}

/* Progress Bar */
.progress-bar {
    height: 8px;
    background-color: var(--light-gray);
    border-radius: 4px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #7c3aed);
    width: 0%;
    transition: width 0.5s ease;
}

/* Notification */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: none;
}

.notification.success {
    background-color: var(--success-color);
}

.notification.error {
    background-color: var(--danger-color);
}

.notification.info {
    background-color: var(--primary-color);
}}

/* ── Page builder block styles (news body) ─────────────────────────── */

/* Bootstrap-compatible grid for .row / .col-* inside news body */
.news-full-body .row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -8px;
    margin-left: -8px;
}
.news-full-body .g-3 {
    gap: 1rem;
    margin-right: 0;
    margin-left: 0;
}
.news-full-body .g-3 > [class^="col"] {
    padding-right: 0;
    padding-left: 0;
}
.news-full-body .mb-4 { margin-bottom: 1.5rem !important; }
.news-full-body .col-12  { flex: 0 0 100%;       max-width: 100%; }
.news-full-body .col-md-6 { flex: 0 0 calc(50% - 0.5rem); max-width: calc(50% - 0.5rem); }
.news-full-body .col-md-4 { flex: 0 0 calc(33.333% - 0.667rem); max-width: calc(33.333% - 0.667rem); }

@media (max-width: 767px) {
    .news-full-body .col-md-6,
    .news-full-body .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Typography inside news body */
.news-full-body h1,
.news-full-body h2,
.news-full-body h3,
.news-full-body h4 {
    color: var(--dark-color);
    font-weight: 700;
    line-height: 1.3;
    margin-top: 0;
    margin-bottom: 0.6rem;
}
.news-full-body h1 { font-size: 1.9rem; }
.news-full-body h2 { font-size: 1.5rem; }
.news-full-body h3 { font-size: 1.25rem; }
.news-full-body h4 { font-size: 1.05rem; }

.news-full-body p {
    margin-top: 0;
    margin-bottom: 0.85rem;
    color: var(--dark-color);
}
.news-full-body ul,
.news-full-body ol {
    padding-left: 1.4rem;
    margin-bottom: 0.85rem;
    color: var(--dark-color);
}
.news-full-body li { margin-bottom: 0.25rem; }

.news-full-body strong { font-weight: 700; }
.news-full-body em     { font-style: italic; }
.news-full-body u      { text-decoration: underline; }

.news-full-body a {
    color: var(--primary-color);
    text-decoration: underline;
}
.news-full-body a:hover { color: var(--secondary-color); }

/* Images */
.news-full-body img.img-fluid {
    max-width: 100%;
    height: auto;
    display: block;
}
.news-full-body img.rounded {
    border-radius: 8px;
}
.news-full-body img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
}
