/* =============================================
   UzQuizBot Platform — style.css
   Bootstrap 5 asosida, ko'k rang sxemasi
   ============================================= */

/* =============================================
   AUTH SAHIFALARI
   ============================================= */

.auth-page {
    background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-container {
    max-width: 420px;
    width: 100%;
    margin: auto;
    padding: 20px;
}

.auth-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    padding: 40px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 24px;
}

.auth-logo .logo-icon {
    font-size: 48px;
    color: #1a73e8;
    display: block;
    margin-bottom: 8px;
}

.auth-logo h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #212529;
}

.auth-logo p {
    color: #6c757d;
    margin-bottom: 0;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    color: #6c757d;
    font-size: 14px;
}

/* =============================================
   SIDEBAR LAYOUT
   ============================================= */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    background: #ffffff;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
}

.sidebar-brand a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #1a73e8;
    font-size: 20px;
    font-weight: 700;
}

.sidebar-brand a:hover {
    color: #1557b0;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    text-decoration: none;
    color: #495057;
    border-radius: 8px;
    margin: 2px 8px;
    transition: background 0.2s ease, color 0.2s ease;
    font-size: 14px;
}

.nav-item i {
    font-size: 18px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.nav-item:hover {
    background: #f0f4ff;
    color: #1a73e8;
}

.nav-item.active {
    background: #e8f0fe;
    color: #1a73e8;
    font-weight: 600;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid #e9ecef;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.user-info .user-details {
    flex: 1;
    min-width: 0;
}

.user-info .user-name {
    font-size: 14px;
    font-weight: 600;
    color: #212529;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-info .user-role {
    font-size: 12px;
    color: #6c757d;
}

.avatar-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

/* =============================================
   MAIN CONTENT
   ============================================= */

.main-content {
    margin-left: 260px;
    min-height: 100vh;
    background: #f8f9fa;
    transition: margin-left 0.3s ease;
}

.top-navbar {
    background: #ffffff;
    padding: 12px 24px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 12px;
}

.content-area {
    padding: 24px;
}

/* =============================================
   MOBIL (max-width: 768px)
   ============================================= */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .content-area {
        padding: 16px;
    }
}

/* =============================================
   STAT KARTALAR
   ============================================= */

.stat-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: none;
    height: 100%;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 12px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    margin: 8px 0 4px;
    color: #212529;
    line-height: 1.2;
}

.stat-card .stat-label {
    color: #6c757d;
    font-size: 14px;
    margin: 0;
}

/* Stat icon rang variantlari */
.stat-icon.bg-blue-light {
    background: #e8f0fe;
    color: #1a73e8;
}

.stat-icon.bg-green-light {
    background: #e6f4ea;
    color: #198754;
}

.stat-icon.bg-orange-light {
    background: #fff3e0;
    color: #fd7e14;
}

.stat-icon.bg-purple-light {
    background: #f3e8fd;
    color: #6f42c1;
}

/* =============================================
   TESTLAR RO'YXATI
   ============================================= */

.quiz-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 12px;
    border-left: 4px solid #1a73e8;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.quiz-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.quiz-card .quiz-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #212529;
}

.quiz-card .quiz-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #6c757d;
    flex-wrap: wrap;
}

.quiz-card .quiz-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.quiz-card .quiz-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* Holat badge'lari */
.badge-draft {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.badge-active {
    background: #e6f4ea;
    color: #198754;
}

.badge-archived {
    background: #fff3e0;
    color: #fd7e14;
}

/* =============================================
   SAVOLLAR KIRITISH
   ============================================= */

.question-item {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    border: 2px solid #e9ecef;
    position: relative;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.question-item:hover {
    border-color: #c5d8fd;
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.08);
}

.question-item.dragging {
    opacity: 0.5;
    border-style: dashed;
    border-color: #1a73e8;
}

.question-number {
    position: absolute;
    top: -12px;
    left: 16px;
    background: #1a73e8;
    color: #ffffff;
    border-radius: 20px;
    padding: 2px 12px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.6;
}

.drag-handle {
    cursor: grab;
    color: #adb5bd;
    font-size: 20px;
    padding: 4px;
    transition: color 0.2s ease;
}

.drag-handle:hover {
    color: #6c757d;
}

.drag-handle:active {
    cursor: grabbing;
}

/* =============================================
   BOSQICHLI FORMA (STEP INDICATOR)
   ============================================= */

.step-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    margin-bottom: 32px;
}

.step {
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: #6c757d;
    background: #ffffff;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.step-label {
    font-size: 13px;
    color: #6c757d;
    white-space: nowrap;
}

.step.active .step-circle {
    background: #1a73e8;
    border-color: #1a73e8;
    color: #ffffff;
}

.step.active .step-label {
    color: #1a73e8;
    font-weight: 600;
}

.step.completed .step-circle {
    background: #198754;
    border-color: #198754;
    color: #ffffff;
}

.step.completed .step-label {
    color: #198754;
}

.step-line {
    width: 60px;
    height: 2px;
    background: #dee2e6;
    margin: 0 4px;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.step.completed + .step-line {
    background: #198754;
}

/* =============================================
   UMUMIY KOMPONENTLAR
   ============================================= */

.page-header {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    color: #212529;
}

/* Tugmalar */
.btn-primary {
    background-color: #1a73e8;
    border-color: #1a73e8;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #1557b0;
    border-color: #1557b0;
}

.btn-primary:active {
    background-color: #1246a0;
    border-color: #1246a0;
}

.btn-outline-primary {
    color: #1a73e8;
    border-color: #1a73e8;
}

.btn-outline-primary:hover {
    background-color: #1a73e8;
    border-color: #1a73e8;
}

/* Form elementlari */
.form-control:focus,
.form-select:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 0 0.2rem rgba(26, 115, 232, 0.2);
}

/* Kartalar */
.card {
    border-radius: 12px;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.card-header {
    background: #ffffff;
    border-bottom: 1px solid #e9ecef;
    border-radius: 12px 12px 0 0 !important;
    padding: 16px 20px;
    font-weight: 600;
}

/* Jadval */
.table th {
    font-weight: 600;
    font-size: 13px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e9ecef;
}

.table td {
    vertical-align: middle;
    font-size: 14px;
}

/* Autosave holati */
#autosaveStatus {
    font-size: 12px;
    transition: color 0.3s ease;
}

/* Import zona */
.import-zone {
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.import-zone:hover,
.import-zone.dragover {
    border-color: #1a73e8;
    background: #f0f4ff;
}

.import-zone i {
    font-size: 48px;
    color: #adb5bd;
    margin-bottom: 12px;
}

/* Leaderboard */
.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #f8f9fa;
}

.leaderboard-item.rank-1 {
    background: #fff8e1;
    border-left: 3px solid #ffc107;
}

.leaderboard-item.rank-2 {
    background: #f5f5f5;
    border-left: 3px solid #9e9e9e;
}

.leaderboard-item.rank-3 {
    background: #fff3e0;
    border-left: 3px solid #ff9800;
}

.rank-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

/* Scrollbar */
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 2px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* Animatsiyalar */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

/* Responsive jadval */
@media (max-width: 576px) {
    .quiz-card .quiz-meta {
        flex-direction: column;
        gap: 4px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .step-label {
        display: none;
    }

    .step-line {
        width: 32px;
    }

    .auth-card {
        padding: 24px 20px;
    }
}

/* =============================================
   QO'SHIMCHA UTILLAR (INTERACTIVE PREVIEW)
   ============================================= */

.hover-bg-light:hover {
    background-color: rgba(0, 0, 0, 0.04) !important;
}

.transition-all {
    transition: all 0.2s ease;
}

.cursor-pointer {
    cursor: pointer;
}

.question-preview-item {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.question-preview-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}
