/* ==========================================
   PROVISOR EXAM SYSTEM - GLOBAL STYLES
   ========================================== */

:root {
    --primary: #007bff;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --light: #f8f9fa;
    --dark: #343a40;
    --gray: #6c757d;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: #0056b3;
}

button, .btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-block;
    text-align: center;
}

button:hover, .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

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

.btn-primary:hover {
    background-color: #0056b3;
}

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

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

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

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 18px;
}

.btn-block {
    width: 100%;
}

/* ==========================================
   LAYOUT
   ========================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.col {
    display: flex;
    flex-direction: column;
}

.col-12 {
    grid-column: 1 / -1;
}

.col-md-6 {
    grid-column: span 1;
}

@media (max-width: 768px) {
    .row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* ==========================================
   NAVBAR & HEADER
   ========================================== */

.site-header {
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
    color: #172033;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1100;
}

.site-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 76px;
    gap: 24px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #172033;
    font-size: 21px;
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
}

.logo:hover {
    color: var(--primary);
}

.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), #18a999);
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(0, 123, 255, 0.24);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 6px;
    align-items: center;
    margin-left: auto;
}

.nav-menu a {
    color: #233047;
    border-radius: 8px;
    font-weight: 650;
    line-height: 1;
    padding: 11px 12px;
    transition: var(--transition);
}

.nav-menu a:hover {
    background: rgba(0, 123, 255, 0.08);
    color: var(--primary);
}

.nav-user {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-left: 10px;
    padding-left: 16px;
    border-left: 1px solid rgba(15, 23, 42, 0.1);
}

.nav-user-name {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #475569;
    font-size: 14px;
    font-weight: 700;
}

.language-form {
    display: inline-flex;
}

.language-form select {
    min-width: 132px;
    height: 38px;
    padding: 0 34px 0 12px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 8px;
    background-color: #fff;
    color: #233047;
    cursor: pointer;
    font-size: 14px;
    font-weight: 650;
}

.nav-close-btn,
.nav-menu-header,
.menu-toggle {
    display: none;
}

.nav-overlay {
    display: none;
}

@media (max-width: 1100px) {
    .site-nav {
        gap: 16px;
    }

    .nav-menu {
        gap: 2px;
    }

    .nav-user {
        gap: 8px;
        padding-left: 10px;
    }

    .nav-menu a {
        padding: 10px 9px;
    }

    .language-form select {
        min-width: 118px;
    }

    .nav-user .btn {
        padding: 8px 12px;
    }
}

@media (max-width: 900px) {
    .site-nav {
        min-height: 68px;
    }

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 1px solid rgba(15, 23, 42, 0.12);
        border-radius: 8px;
        background: #fff;
        color: #172033;
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
        position: relative;
        z-index: 1102;
    }

    .menu-toggle span,
    .menu-toggle span::before,
    .menu-toggle span::after {
        display: block;
        width: 20px;
        height: 2px;
        border-radius: 999px;
        background: currentColor;
        transition: var(--transition);
    }

    .menu-toggle span {
        position: relative;
    }

    .menu-toggle span::before,
    .menu-toggle span::after {
        content: "";
        position: absolute;
        left: 0;
    }

    .menu-toggle span::before {
        top: -7px;
    }

    .menu-toggle span::after {
        top: 7px;
    }

    .menu-toggle.active span {
        background: transparent;
    }

    .menu-toggle.active span::before {
        top: 0;
        transform: rotate(45deg);
    }

    .menu-toggle.active span::after {
        top: 0;
        transform: rotate(-45deg);
    }

    .nav-overlay.active {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.52);
        z-index: 1000;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(380px, calc(100vw - 28px));
        align-items: stretch;
        flex-direction: column;
        gap: 6px;
        margin: 0;
        padding: 18px;
        background: #fff;
        box-shadow: -24px 0 45px rgba(15, 23, 42, 0.2);
        overflow-y: auto;
        transform: translateX(105%);
        transition: transform 0.28s ease;
        z-index: 1101;
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    .nav-menu-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 48px;
        margin-bottom: 10px;
    }

    .nav-menu-title {
        color: #172033;
        font-size: 18px;
        font-weight: 800;
    }

    .nav-close-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        padding: 0;
        border: 1px solid rgba(15, 23, 42, 0.12);
        border-radius: 8px;
        background: #f8fafc;
        color: #172033;
        font-size: 26px;
        line-height: 1;
    }

    .nav-menu a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        min-height: 48px;
        padding: 0 14px;
        color: #172033;
        background: #f8fafc;
        border: 1px solid rgba(15, 23, 42, 0.07);
    }

    .nav-user {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
        margin: 12px 0 0;
        padding: 14px 0 0;
        border-left: 0;
        border-top: 1px solid rgba(15, 23, 42, 0.1);
    }

    .nav-user-name {
        max-width: none;
        padding: 10px 12px;
        border-radius: 8px;
        background: #f8fafc;
        color: #475569;
    }

    .language-form,
    .language-form select,
    .nav-user .btn {
        width: 100%;
    }

    .language-form select {
        height: 44px;
    }
}

@media (max-width: 480px) {
    .site-nav {
        min-height: 64px;
    }

    .logo {
        font-size: 18px;
    }

    .logo-mark {
        width: 34px;
        height: 34px;
    }
}

/* ==========================================
   FORMS
   ========================================== */

.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

input, textarea, select {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-family: inherit;
    transition: var(--transition);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

.form-error {
    color: var(--danger);
    font-size: 14px;
    margin-top: 5px;
}

/* ==========================================
   ALERTS & MESSAGES
   ========================================== */

.alert {
    padding: 15px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background-color: #d4edda;
    border-color: var(--success);
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: var(--danger);
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: var(--warning);
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: var(--info);
    color: #0c5460;
}

/* ==========================================
   CARDS
   ========================================== */

.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 25px;
    transition: var(--transition);
    border: 1px solid #e9ecef;
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    transform: translateY(-4px);
}

.card-header {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    color: #333;
}

.card-body {
    padding: 0;
}

.card-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

/* ==========================================
   HERO SECTION
   ========================================== */

.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #0056b3 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 20px;
    font-weight: 700;
}

.hero p {
    font-size: 20px;
    margin-bottom: 30px;
    opacity: 0.9;
}

@media (max-width: 768px) {
    .hero {
        padding: 50px 0;
    }

    .hero h1 {
        font-size: 32px;
    }

    .hero p {
        font-size: 18px;
    }
}

/* ==========================================
   GRID & PRICING
   ========================================== */

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.price-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    text-align: center;
    box-shadow: var(--box-shadow);
    border: 2px solid transparent;
    transition: var(--transition);
}

.price-card:hover {
    border-color: var(--primary);
    transform: translateY(-10px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.2);
}

.price-card.featured {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(0,123,255,0.05) 0%, rgba(0,123,255,0.02) 100%);
}

.price-card h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.price {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary);
    margin: 15px 0;
}

.price-desc {
    color: var(--gray);
    margin-bottom: 20px;
}

.price-features {
    text-align: left;
    margin: 20px 0;
}

.price-features li {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
}

.price-features li:before {
    content: "✓";
    color: var(--success);
    font-weight: 700;
    margin-right: 10px;
}

/* ==========================================
   TEST & QUESTION
   ========================================== */

.test-header {
    background: white;
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--box-shadow);
}

.test-info {
    display: flex;
    gap: 40px;
}

.test-info-item {
    display: flex;
    flex-direction: column;
}

.test-info-label {
    font-size: 14px;
    color: var(--gray);
    margin-bottom: 5px;
}

.test-info-value {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.timer {
    font-size: 32px;
    font-weight: 700;
    color: var(--danger);
    font-family: 'Courier New', monospace;
}

.timer.warning {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.question-container {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: var(--box-shadow);
}

.question-number {
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 10px;
}

.question-text {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
}

.question-image {
    margin: 20px 0;
    max-width: 100%;
    height: auto;
    max-height: 300px;
    border-radius: var(--border-radius);
}

.answer-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.answer-option {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.answer-option:hover {
    border-color: var(--primary);
    background-color: rgba(0, 123, 255, 0.05);
}

.answer-option input[type="radio"] {
    margin-right: 15px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.answer-option input[type="radio"]:checked + label {
    font-weight: 600;
}

.answer-option label {
    margin: 0;
    cursor: pointer;
    flex-grow: 1;
}

.answer-option.correct {
    border-color: var(--success);
    background-color: rgba(40, 167, 69, 0.1);
}

.answer-option.incorrect {
    border-color: var(--danger);
    background-color: rgba(220, 53, 69, 0.1);
}

/* ==========================================
   RESULTS
   ========================================== */

.result-score {
    background: white;
    border-radius: var(--border-radius);
    padding: 40px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: var(--box-shadow);
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #0056b3 100%);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0 auto 20px;
    font-size: 48px;
    font-weight: 700;
}

.score-circle.passed {
    background: linear-gradient(135deg, var(--success) 0%, #20c997 100%);
}

.score-circle.failed {
    background: linear-gradient(135deg, var(--danger) 0%, #fd7e14 100%);
}

.score-status {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
}

.score-status.passed {
    color: var(--success);
}

.score-status.failed {
    color: var(--danger);
}

.result-answers {
    display: grid;
    gap: 20px;
}

.answer-result {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    border-left: 4px solid;
    box-shadow: var(--box-shadow);
}

.answer-result.correct {
    border-left-color: var(--success);
}

.answer-result.incorrect {
    border-left-color: var(--danger);
}

.answer-result-question {
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.answer-result-question:before {
    content: "✓";
    color: var(--success);
    font-weight: 700;
    font-size: 20px;
}

.answer-result.incorrect .answer-result-question:before {
    content: "✗";
    color: var(--danger);
}

/* ==========================================
   TABLES
   ========================================== */

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th {
    background-color: #f8f9fa;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #e9ecef;
}

td {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
}

tr:hover {
    background-color: #f8f9fa;
}

.table-responsive {
    overflow-x: auto;
}

/* ==========================================
   PAGINATION
   ========================================== */

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.pagination a, .pagination span {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.pagination a:hover {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination .active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ==========================================
   DASHBOARD
   ========================================== */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stats-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--box-shadow);
    border-left: 4px solid var(--primary);
}

.stats-card.success {
    border-left-color: var(--success);
}

.stats-card.danger {
    border-left-color: var(--danger);
}

.stats-card.warning {
    border-left-color: var(--warning);
}

.stats-label {
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 10px;
}

.stats-value {
    font-size: 32px;
    font-weight: 700;
    color: #333;
}

/* ==========================================
   FOOTER
   ========================================== */

footer {
    background-color: #343a40;
    color: #ccc;
    padding: 40px 0 20px;
    margin-top: 50px;
}

footer a {
    color: white;
}

footer a:hover {
    color: var(--primary);
}

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

.footer-section h3 {
    margin-bottom: 15px;
    color: white;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    padding: 8px 0;
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid #555;
    padding-top: 20px;
}

/* ==========================================
   UTILITIES
   ========================================== */

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

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

.text-muted {
    color: var(--gray);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.m-0 { margin: 0; }
.m-1 { margin: 5px; }
.m-2 { margin: 10px; }
.m-3 { margin: 15px; }
.m-4 { margin: 20px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 5px; }
.mb-2 { margin-bottom: 10px; }
.mb-3 { margin-bottom: 15px; }
.mb-4 { margin-bottom: 20px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 5px; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 15px; }
.mt-4 { margin-top: 20px; }

.p-0 { padding: 0; }
.p-1 { padding: 5px; }
.p-2 { padding: 10px; }
.p-3 { padding: 15px; }
.p-4 { padding: 20px; }

.hidden {
    display: none;
}

.d-flex {
    display: flex;
}

.gap-1 { gap: 5px; }
.gap-2 { gap: 10px; }
.gap-3 { gap: 15px; }

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .test-info {
        gap: 20px;
    }

    .question-container {
        padding: 20px;
    }

    .result-score {
        padding: 25px;
    }

    .score-circle {
        width: 120px;
        height: 120px;
        font-size: 36px;
    }

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

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

    table {
        font-size: 14px;
    }

    th, td {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    button, .btn {
        padding: 10px 16px;
        font-size: 14px;
    }

    .hero h1 {
        font-size: 24px;
    }

    .hero p {
        font-size: 16px;
    }

    .price {
        font-size: 28px;
    }

    .timer {
        font-size: 24px;
    }

    .test-header {
        flex-direction: column;
        gap: 15px;
    }

    .test-info {
        width: 100%;
        justify-content: space-around;
    }
}

/* ==========================================
   ANIMATIONS
   ========================================== */

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

.fade-in {
    animation: slideIn 0.5s ease-out;
}

/* Print styles */
@media print {
    header, footer, .no-print {
        display: none;
    }

    body {
        background: white;
    }

    .card {
        page-break-inside: avoid;
    }
}
