/* ===== CSS RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1f2937;
    --light: #f3f4f6;
    --white: #ffffff;
    --sidebar-width: 280px;
    --topbar-height: 60px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== MOBILE FIRST LAYOUT ===== */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== TOPBAR (Mobile) ===== */
.topbar {
    background: var(--white);
    height: var(--topbar-height);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
}

.topbar .logo {
    font-size: 18px;
    font-weight: bold;
    color: var(--primary);
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--dark);
}

.topbar-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    left: -280px;
    top: var(--topbar-height);
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--white);
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    transition: left 0.3s ease;
    z-index: 999;
    overflow-y: auto;
}

.sidebar.active {
    left: 0;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 998;
}

.sidebar-overlay.active {
    display: block;
}

.sidebar-menu {
    list-style: none;
    padding: 10px 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--dark);
    text-decoration: none;
    transition: all 0.3s;
    gap: 12px;
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background: var(--primary);
    color: white;
}

.sidebar-menu li a i {
    width: 20px;
    text-align: center;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-top: var(--topbar-height);
    padding: 20px 15px;
    min-height: calc(100vh - var(--topbar-height));
}

/* ===== CARDS ===== */
.card {
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.card-header {
    border-bottom: 1px solid var(--light);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--dark);
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.stat-card.success {
    background: linear-gradient(135deg, var(--success), #059669);
}

.stat-card.warning {
    background: linear-gradient(135deg, var(--warning), #d97706);
}

.stat-card .stat-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: bold;
}

.stat-card .stat-label {
    font-size: 14px;
    opacity: 0.9;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-block {
    width: 100%;
    display: block;
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

/* ===== TOPICS GRID ===== */
.topics-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.topic-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s;
}

.topic-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.topic-info h3 {
    font-size: 16px;
    margin-bottom: 5px;
}

.topic-info .question-count {
    font-size: 13px;
    color: #6b7280;
}

.topic-icon {
    font-size: 28px;
    color: var(--primary);
}

/* ===== QUESTION CARD ===== */
.question-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.question-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.question-number {
    background: var(--primary);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
}

.language-toggle {
    display: flex;
    gap: 5px;
}

.lang-btn {
    padding: 5px 15px;
    border: 1px solid var(--primary);
    background: white;
    color: var(--primary);
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.lang-btn.active {
    background: var(--primary);
    color: white;
}

.question-text {
    font-size: 16px;
    margin-bottom: 15px;
    line-height: 1.6;
}

.question-image {
    width: 100%;
    max-width: 400px;
    border-radius: 8px;
    margin: 15px 0;
}

.options-list {
    list-style: none;
}

.option-item {
    background: #f9fafb;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s;
}

.option-item:hover {
    border-color: var(--primary);
}

.option-item.selected {
    background: #dbeafe;
    border-color: var(--primary);
}

.option-item.correct {
    background: #d1fae5;
    border-color: var(--success);
}

.option-item.wrong {
    background: #fee2e2;
    border-color: var(--danger);
}

/* ===== TIMER ===== */
.timer {
    position: fixed;
    top: 70px;
    right: 15px;
    background: var(--danger);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 500;
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 25px;
    border-radius: 10px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

/* ===== RESPONSIVE (Tablet & Desktop) ===== */
@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .topics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .menu-toggle {
        display: none;
    }
    
    .sidebar {
        left: 0;
    }
    
    .sidebar-overlay {
        display: none !important;
    }
    
    .main-content {
        margin-left: var(--sidebar-width);
    }
    
    .topbar {
        left: var(--sidebar-width);
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .topics-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===== UTILITY CLASSES ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.d-none { display: none; }
.d-block { display: block; }

/* ===== BENGALI FONT SUPPORT ===== */
.bn-text {
    font-family: 'SolaimanLipi', 'Kalpurush', sans-serif;
}