@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #667eea;
    --primary-dark: #764ba2;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --light: #f8f9fa;
    --dark: #2c3e50;
    --gray: #95a5a6;
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: var(--dark);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* === NAVBAR === */

.navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
    gap: 12px;
}

.navbar-brand {
    font-size: 24px;
    font-weight: 700;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 46px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid #e7eef4;
    background: #f8fafc;
    cursor: pointer;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.nav-toggle span {
    display: block;
    height: 3px;
    width: 22px;
    margin: 0 auto;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.nav-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
}

.nav-toggle:active {
    transform: scale(0.98);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.2);
}

.logo {
    text-decoration: none;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-menu {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    transition: color 0.3s;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    border-radius: 10px;
    padding: 8px 10px;
}

.nav-link:hover {
    color: var(--primary);
}

.admin-link {
    color: var(--danger);
    font-weight: 600;
}

.admin-btn {
    color: var(--danger);
}

.nav-dropdown {
    position: relative;
}

.dropdown-btn {
    position: relative;
}

.dropdown-btn::after {
    content: '▼';
    font-size: 12px;
    margin-left: 5px;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    min-width: 200px;
    z-index: 1001;
}

.nav-dropdown:hover .dropdown-menu {
    display: flex;
    flex-direction: column;
}

.nav-dropdown:focus-within .dropdown-menu {
    display: flex;
    flex-direction: column;
}

.dropdown-menu a {
    color: var(--dark);
    text-decoration: none;
    padding: 12px 20px;
    font-size: 15px;
    transition: background 0.2s;
}

.dropdown-menu a:hover {
    background: var(--light);
}

/* === BUTTONS === */

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: var(--gray);
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #229954;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-large {
    padding: 16px 40px;
    font-size: 18px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
}

/* === HERO SECTION === */

.hero-section {
    padding: 60px 30px;
    text-align: center;
    background: white;
    border-radius: 15px;
    margin: 40px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.hero-section h2 {
    font-size: 36px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
}

.hero-section p {
    font-size: 18px;
    color: var(--gray);
    margin-bottom: 30px;
}

/* === STATS GRID === */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.stat-box {
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.stat-box h3 {
    font-size: 36px;
    color: var(--primary);
    margin-bottom: 10px;
}

.stat-box p {
    color: var(--gray);
}

/* === INFO CARDS === */

.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.info-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s;
}

.info-card:hover {
    transform: translateY(-5px);
}

.info-card h3 {
    color: var(--primary);
    margin-bottom: 10px;
}

.info-card p {
    color: var(--gray);
}

/* === QUIZ FORM === */

.quiz-form {
    max-width: 500px;
    margin: 40px auto;
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

.quiz-form h2 {
    text-align: center;
    color: var(--dark);
    margin-bottom: 30px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-item {
    display: flex;
    flex-direction: column;
}

.form-item label {
    font-weight: 500;
    margin-bottom: 10px;
}

.form-input {
    padding: 12px 15px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Roboto', sans-serif;
    transition: border-color 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
}

.form-input.disabled {
    background: #f8f9fa;
    cursor: not-allowed;
}

.info-text {
    text-align: center;
    color: var(--gray);
    font-size: 14px;
    margin-top: 20px;
}

/* === ALERTS === */

.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* === QUIZ === */


.quiz-container {
    background: white;
    padding: 32px;
    border-radius: 18px;
    margin: 40px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border: 1px solid #e7eef4;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.quiz-header h2 {
    color: var(--dark);
    margin-top: 4px;
}

.quiz-subtitle {
    font-weight: 600;
    color: #0f6c75;
    letter-spacing: 0.2px;
}

.quiz-legend {
    display: flex;
    gap: 12px;
    align-items: center;
    color: var(--gray);
    font-size: 14px;
}

.legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    display: inline-block;
    margin-right: 6px;
    border: 1px solid rgba(0,0,0,0.08);
}

.legend-dot.correct { background: #dff8ef; border-color: #1abc9c; }
.legend-dot.wrong { background: #ffebee; border-color: #e57373; }
.legend-dot.pending { background: #fff9e6; border-color: #f9d26a; }

.question-carousel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
    gap: 6px;
    margin: 18px 0 12px;
    padding: 12px;
    background: #f1f6fb;
    border-radius: 14px;
    border: 1px solid #d6e9fa;
}

.carousel-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    border-radius: 4px;
    background: #e0e8f0;
    border: 1px solid #cfd9e4;
    text-decoration: none;
    color: #2c3e50;
    font-weight: 600;
    font-size: 14px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.carousel-item:hover {
    transform: translateY(-1px);
    border-color: #7bd9f0;
    box-shadow: 0 3px 8px rgba(69, 170, 242, 0.15);
}

.carousel-item.active {
    border-color: #1eb2d8;
    box-shadow: 0 4px 12px rgba(15, 108, 117, 0.35);
    background: linear-gradient(135deg, #26c6da 0%, #00acc1 100%);
    color: white;
    transform: translateY(-1px) scale(1.05);
}

.carousel-item.correct {
    background: #6bd098;
    border-color: #2aa26f;
    color: white;
}

.carousel-item.wrong {
    background: #ff653b;
    border-color: #e74c3c;
    color: white;
}

.carousel-item.pending {
    background: #fff3cd;
    border-color: #f5d27b;
    color: #8a6d3b;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #f1f6fb;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e2ebf3;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #26c6da 0%, #007bff 100%);
    transition: width 0.3s;
}

.question-text {
    font-size: 22px;
    color: var(--dark);
    margin: 12px 0 24px;
    line-height: 1.6;
}

.question-header {
    background: #f7fbff;
    border: 1px solid #dbe7f3;
    border-radius: 14px;
    padding: 16px 18px;
}

.question-number {
    color: #0f6c75;
    font-weight: 700;
    margin-bottom: 6px;
}

.answers-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 24px 0;
}

.answer-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: #f9fbfd;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid #dbe7f3;
}

.answer-item:hover {
    background: #eef6ff;
    border-color: #26c6da;
}

.answer-item.selected {
    border-color: #26c6da;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    background: linear-gradient(135deg, #f2fbff 0%, #e4f5ff 100%);
}

.answer-item.correct {
    background: #e7f8ef;
    border-color: #27ae60;
    box-shadow: inset 4px 0 0 #27ae60;
}

.answer-item.incorrect {
    background: #ffecea;
    border-color: #e74c3c;
    box-shadow: inset 4px 0 0 #e74c3c;
}

.answer-checkbox,
.answer-radio {
    width: 20px;
    height: 20px;
    margin-right: 15px;
    accent-color: var(--primary);
    cursor: pointer;
}

.answer-label {
    flex: 1;
    cursor: pointer;
    user-select: none;
}

.full-width {
    width: 100%;
    margin-top: 4px;
}

.comment-box {
    background: #fff8e1;
    border-left: 6px solid #ff653b;
    padding: 18px;
    border-radius: 12px;
    color: #7a7a7a;
    margin-top: 20px;
    font-size: 16px;
}

/* === RESULTS === */

.results-container {
    padding: 40px 0;
}

.results-card {
    max-width: 500px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    text-align: center;
}

.results-card h2 {
    color: var(--success);
    margin-bottom: 30px;
}

.result-score {
    margin: 30px 0;
}

.score-circle {
    display: inline-block;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
}

.score-number {
    font-size: 48px;
    font-weight: 700;
}

.score-percent {
    font-size: 24px;
}

.result-bar {
    width: 100%;
    height: 10px;
    background: #ecf0f1;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
}

.result-bar-fill {
    height: 100%;
    transition: width 0.5s ease;
}

.result-status {
    margin: 30px 0;
    font-size: 20px;
    font-weight: 500;
}

.status-excellent { color: var(--success); }
.status-good { color: var(--warning); }
.status-fair { color: #e67e22; }
.status-poor { color: var(--danger); }

.results-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* === CABINET === */

.cabinet-container {
    background: white;
    padding: 40px;
    border-radius: 15px;
    margin: 40px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.cabinet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
}

.cabinet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.cabinet-card {
    background: var(--light);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid var(--primary);
}

.stats-card .stat-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.stats-card .stat-item:last-child {
    border-bottom: none;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.results-table thead {
    background: var(--light);
}

.results-table th,
.results-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.percentage-badge {
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
}

.badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}

.badge.success {
    background: #d4edda;
    color: #155724;
}

.badge.info {
    background: #d1ecf1;
    color: #0c5460;
}

.badge.warning {
    background: #fff3cd;
    color: #856404;
}

/* === RATING === */

.rating-container {
    background: white;
    padding: 40px;
    border-radius: 15px;
    margin: 40px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.rating-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.rating-table thead {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.rating-table th,
.rating-table td {
    padding: 15px;
    text-align: left;
}

.rating-table tbody tr:hover {
    background: var(--light);
}

.rating-table tbody tr.top-1 {
    background: #fff9e6;
    font-weight: 600;
}

.mini-progress {
    width: 100%;
    height: 6px;
    background: #ecf0f1;
    border-radius: 5px;
    overflow: hidden;
}

.mini-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success) 0%, var(--primary) 100%);
}

/* === ADMIN === */

.admin-container {
    background: white;
    padding: 40px;
    border-radius: 15px;
    margin: 40px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.admin-stat {
    background: var(--light);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border-left: 4px solid var(--primary);
}

.admin-stat h3 {
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 5px;
}

.admin-stat p {
    color: var(--gray);
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.admin-card {
    background: var(--light);
    padding: 20px;
    border-radius: 10px;
}

.admin-card ul {
    list-style: none;
}

.admin-card li {
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.admin-table thead {
    background: var(--light);
}

.admin-table th,
.admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.admin-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
    flex-wrap: wrap;
}

/* === FOOTER === */

.footer {
    background: var(--dark);
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 60px;
}

/* === RESPONSIVE === */

@media (max-width: 1024px) {
    .container {
        padding: 16px;
    }

    .quiz-container,
    .rating-container,
    .admin-container,
    .results-card,
    .quiz-form {
        padding: 28px;
    }
}

@media (max-width: 900px) {
    .navbar-container {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 8px;
    }

    .nav-toggle {
        display: flex;
        margin-left: auto;
    }

    .navbar-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 8px;
        padding: 4px 4px 12px;
        border-radius: 14px;
        background: white;
        box-shadow: 0 10px 30px rgba(0,0,0,0.08);
        border: 1px solid #e7eef4;
    }

    .navbar-menu.open {
        display: flex;
    }

    .nav-link {
        width: 100%;
        text-align: left;
        padding: 10px 12px;
    }

    .nav-dropdown {
        width: 100%;
    }

    .dropdown-menu {
        position: static;
        margin-top: 6px;
        border: 1px solid #e7eef4;
        box-shadow: none;
    }
}

@media (max-width: 720px) {
    .hero-section {
        padding: 40px 18px;
    }

    .hero-section h2 {
        font-size: 28px;
    }

    .hero-section p,
    .quiz-subtitle {
        font-size: 16px;
    }

    .quiz-container,
    .rating-container,
    .admin-container,
    .quiz-form,
    .results-card {
        padding: 22px;
    }

    .quiz-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .quiz-legend {
        flex-wrap: wrap;
        gap: 8px 14px;
    }

    .question-text {
        font-size: 18px;
        line-height: 1.5;
    }

    .question-carousel {
        display: flex;
        overflow-x: auto;
        padding: 12px 10px;
        gap: 8px;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }

    .carousel-item {
        flex: 0 0 42px;
        font-size: 13px;
    }

    .answers-wrapper {
        gap: 10px;
    }

    .answer-item {
        align-items: flex-start;
        gap: 10px;
        padding: 14px 12px;
    }

    .answer-label {
        font-size: 15px;
        line-height: 1.45;
    }

    .btn,
    .btn-large,
    .full-width {
        width: 100%;
    }
}

@media (max-width: 540px) {
    .container {
        padding: 14px;
    }

    .navbar-brand {
        width: 100%;
    }

    .quiz-header h2 {
        font-size: 20px;
    }

    .question-header {
        padding: 12px 12px;
    }

    .question-number {
        font-size: 14px;
    }

    .question-text {
        font-size: 17px;
    }

    .progress-bar {
        height: 12px;
    }

    .stat-box h3,
    .rating-table th,
    .rating-table td {
        font-size: 14px;
    }

    .stats-grid,
    .info-cards {
        grid-template-columns: 1fr;
    }
}
