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

:root {
    --primary-color: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f9fafb;
    --sidebar-bg: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --hover-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
}

/* ---------- UI Modal (shared) ---------- */
.ui-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    padding: 18px;
}

.ui-modal {
    width: min(560px, 100%);
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
    overflow: hidden;
}

.ui-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    background: #fff;
}

.ui-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.ui-modal-close {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: #fff;
    cursor: pointer;
    color: var(--text-secondary);
}

.ui-modal-close:hover {
    color: var(--text-primary);
    box-shadow: var(--card-shadow);
}

.ui-modal-body {
    padding: 14px 16px;
}

.ui-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid var(--border-color);
    background: #fff;
}

.ui-form {
    display: grid;
    gap: 12px;
}

.ui-field {
    display: grid;
    gap: 6px;
}

.ui-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
}

.ui-req {
    color: var(--danger-color);
    font-weight: 700;
}

.ui-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: #fff;
    outline: none;
}

.ui-input:focus {
    border-color: rgba(79, 70, 229, 0.65);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.10);
}

.ui-help {
    font-size: 12px;
    color: var(--text-secondary);
}

.ui-confirm-text {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
}

.ui-btn {
    border: 1px solid transparent;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
}

.ui-btn-ghost {
    background: #fff;
    border-color: var(--border-color);
    color: var(--text-primary);
}

.ui-btn-ghost:hover {
    box-shadow: var(--card-shadow);
}

.ui-btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.ui-btn-primary:hover {
    filter: brightness(0.95);
}

.ui-btn-danger {
    background: var(--danger-color);
    border-color: var(--danger-color);
    color: #fff;
}

.ui-btn-danger:hover {
    filter: brightness(0.95);
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.logo {
    padding: 0 20px 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
}

.logo i {
    font-size: 32px;
}

.nav-menu {
    list-style: none;
}

.nav-item {
    margin-bottom: 5px;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav-item a i {
    width: 20px;
    font-size: 18px;
}

.nav-item:hover a {
    background: #f3f4f6;
    color: var(--primary-color);
}

.nav-item.active a {
    background: #eef2ff;
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 500;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 20px 30px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.search-bar {
    display: flex;
    align-items: center;
    background: white;
    padding: 10px 20px;
    border-radius: 10px;
    width: 300px;
    box-shadow: var(--card-shadow);
}

.search-bar i {
    color: var(--text-secondary);
    margin-right: 10px;
}

.search-bar input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 14px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.notification-badge {
    position: relative;
    cursor: pointer;
}

.notification-badge i {
    font-size: 20px;
    color: var(--text-secondary);
}

.badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger-color);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
}

.user-profile-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* Content Wrapper */
.content-wrapper {
    max-width: 1200px;
}

/* Welcome Section */
.welcome-section {
    margin-bottom: 30px;
}

.welcome-section h1 {
    font-size: 28px;
    margin-bottom: 8px;
}

.welcome-section p {
    color: var(--text-secondary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--card-shadow);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.stat-icon.blue { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.stat-icon.green { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.stat-icon.purple { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.stat-icon.orange { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }

.stat-info h3 {
    font-size: 24px;
    margin-bottom: 4px;
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.continue-card, .recommend-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}

.card-header {
    margin-bottom: 20px;
}

.card-header h2 {
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.continue-test-item {
    display: flex;
    gap: 15px;
}

.test-icon {
    width: 50px;
    height: 50px;
    background: #eef2ff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 24px;
}

.test-details {
    flex: 1;
}

.test-details h3 {
    font-size: 16px;
    margin-bottom: 10px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.progress-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 4px;
}

.btn-primary, .btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

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

.btn-primary:hover {
    background: var(--primary-light);
}

.btn-secondary {
    background: #f3f4f6;
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: #e5e7eb;
}

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

.recommend-icon {
    font-size: 48px;
    color: var(--warning-color);
    margin-bottom: 15px;
}

.recommend-content p {
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.recommend-content .highlight {
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 20px;
}

/* Recent Tests */
.recent-tests {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-all {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
}

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

.test-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    border-radius: 8px;
    transition: background 0.3s;
}

.test-item:hover {
    background: #f9fafb;
}

.test-icon-small {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.test-icon-small.green { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.test-icon-small.blue { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.test-icon-small.orange { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }

.test-info {
    flex: 1;
}

.test-info h4 {
    font-size: 15px;
    margin-bottom: 4px;
}

.test-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.test-score {
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 14px;
}

.test-score.high {
    background: #d1fae5;
    color: #065f46;
}

.test-score.medium {
    background: #fef3c7;
    color: #92400e;
}

.test-score.low {
    background: #fee2e2;
    color: #991b1b;
}

/* Subjects Grid */
.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 28px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-header p {
    color: var(--text-secondary);
}

.subjects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.subject-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s;
}

.subject-card:hover {
    box-shadow: var(--hover-shadow);
    transform: translateY(-2px);
}

.subject-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    margin-bottom: 15px;
}

.subject-card h3 {
    font-size: 18px;
    margin-bottom: 5px;
}

.test-count {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 15px;
}

.btn-subject {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 15px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background: white;
    margin: 50px auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-secondary);
}

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

#modalTitle {
    margin-bottom: 20px;
}

.modal-test-item {
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-test-item:hover {
    background: #f9fafb;
    border-color: var(--primary-color);
}

.modal-test-info h4 {
    margin-bottom: 5px;
}

.modal-test-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: var(--text-secondary);
}

.modal-test-meta i {
    margin-right: 5px;
}

/* Ranking Tabs */
.ranking-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.tab-btn {
    padding: 10px 25px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.tab-btn:hover {
    background: #f9fafb;
}

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

/* Podium */
.podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 30px;
    margin-bottom: 40px;
}

.podium-item {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 12px;
    min-width: 180px;
    box-shadow: var(--card-shadow);
}

.podium-item.first {
    transform: scale(1.1);
    box-shadow: var(--hover-shadow);
}

.podium-avatar {
    position: relative;
    margin-bottom: 10px;
}

.podium-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.podium-item.first .podium-avatar img {
    width: 100px;
    height: 100px;
}

.crown {
    position: absolute;
    top: -20px;
    right: -10px;
    font-size: 30px;
}

.podium-medal {
    font-size: 24px;
    margin: 10px 0;
}

.podium-item h4 {
    margin-bottom: 5px;
    font-size: 16px;
}

.podium-score {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 18px;
}

/* Ranking Table */
.ranking-table-container {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
}

.ranking-table-container h3 {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
}

.ranking-table th {
    text-align: left;
    padding: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
}

.ranking-table td {
    padding: 15px 12px;
    border-bottom: 1px solid var(--border-color);
}

.ranking-table tbody tr:hover {
    background: #f9fafb;
}

.ranking-table .user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ranking-table .user-cell img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
}

.change-up {
    color: #10b981;
}

.change-down {
    color: #ef4444;
}

/* Your Rank Card */
.your-rank-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 12px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rank-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.rank-info i {
    font-size: 40px;
}

.rank-info h4 {
    font-size: 16px;
    margin-bottom: 5px;
    opacity: 0.9;
}

.rank-position {
    font-size: 24px;
    font-weight: bold;
}

.rank-stats {
    display: flex;
    gap: 30px;
}

.rank-stats .stat {
    text-align: center;
}

.rank-stats .label {
    display: block;
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.rank-stats .value {
    font-size: 18px;
    font-weight: bold;
}

.rank-stats .value.positive {
    color: #4ade80;
}

/* Analytics Grid */
.analytics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.analytics-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}

.analytics-card.full-width {
    grid-column: 1 / -1;
}

.analytics-card h3 {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
}

.subject-bars {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.subject-bar-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.subject-label {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.difficulty-stats {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.difficulty-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.difficulty-header {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.progress-fill.easy-fill {
    background: #10b981;
}

.progress-fill.medium-fill {
    background: #f59e0b;
}

.progress-fill.hard-fill {
    background: #ef4444;
}

/* Simple Bar Chart */
.chart-container {
    padding: 20px 0;
}

.simple-bar-chart {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 200px;
}

.chart-bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.bar {
    width: 40px;
    background: var(--primary-color);
    border-radius: 4px 4px 0 0;
    transition: height 0.3s;
    position: relative;
}

.bar:hover {
    background: var(--primary-light);
}

.bar::before {
    content: attr(data-value);
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: var(--text-secondary);
}

/* Strengths and Weaknesses */
.strength-list, .weakness-list {
    list-style: none;
}

.strength-list li, .weakness-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.strength-list li:last-child, .weakness-list li:last-child {
    border-bottom: none;
}

.strength-list i {
    color: #10b981;
}

.weakness-list i {
    color: #ef4444;
}

.tag {
    margin-left: auto;
    padding: 4px 8px;
    background: #d1fae5;
    color: #065f46;
    border-radius: 4px;
    font-size: 12px;
}

.btn-small {
    margin-left: auto;
    padding: 6px 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}

.btn-small:hover {
    background: var(--primary-light);
}

/* Profile Page */
.profile-header {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: var(--card-shadow);
}

/* ========== MOTIVATSION QUOTE  boshlanish kodi ========== */
.profile-cover {
    height: 150px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.motivation-quote {
    text-align: center;
    color: white;
    padding: 20px 40px;
    max-width: 600px;
    position: relative;
}

.motivation-quote i {
    font-size: 20px;
    opacity: 0.6;
}

.motivation-quote .fa-quote-left {
    position: absolute;
    top: 0;
    left: 0;
}

.motivation-quote .fa-quote-right {
    position: absolute;
    bottom: 0;
    right: 0;
}

.motivation-quote p {
    font-size: 18px;
    font-weight: 500;
    line-height: 1.6;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    margin: 0;
    font-style: italic;
}
/* ========== MOTIVATSION QUOTE tugash kodi ========== */
.profile-info {
    padding: 20px 30px 30px;
    display: flex;
    align-items: flex-end;
    gap: 20px;
    position: relative;
}

.profile-avatar-large {
    margin-top: -60px;
}

.profile-avatar-large img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid white;
    object-fit: cover;
}

.profile-details {
    flex: 1;
}

.profile-details h1 {
    margin-bottom: 8px;
}

.profile-email, .profile-group {
    color: var(--text-secondary);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-edit-profile {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-edit-profile:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.profile-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
}

.info-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
}

.info-card h3 {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
}

.info-list, .stats-list {
    list-style: none;
}

.info-list li, .stats-list li {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.info-list li:last-child, .stats-list li:last-child {
    border-bottom: none;
}

.info-list .label, .stats-list .label {
    color: var(--text-secondary);
    font-size: 14px;
}

.info-list .value, .stats-list .value {
    font-weight: 500;
    font-size: 14px;
}

.achievements-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
}

.achievements-card h3 {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.achievement-item {
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.achievement-item i {
    font-size: 24px;
    margin-bottom: 8px;
}

.achievement-item.unlocked {
    background: #eef2ff;
    border-color: var(--primary-color);
}

.achievement-item.unlocked i {
    color: #fbbf24;
}

.achievement-item.locked {
    opacity: 0.5;
}

.achievement-item span {
    font-size: 12px;
    display: block;
}

.settings-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}

.settings-card h3 {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.setting-info i {
    width: 20px;
    color: var(--text-secondary);
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.language-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    cursor: pointer;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 80px;
    }
    
    .sidebar .logo span,
    .nav-item span {
        display: none;
    }
    
    .nav-item a {
        justify-content: center;
        padding: 12px;
    }
    
    .main-content {
        margin-left: 80px;
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .subjects-grid {
        grid-template-columns: 1fr;
    }
    
    .analytics-grid {
        grid-template-columns: 1fr;
    }
    
    .profile-content {
        grid-template-columns: 1fr;
    }
    
    .podium {
        flex-direction: column;
        align-items: center;
    }
    
    .ranking-table {
        font-size: 12px;
    }
    
    .ranking-table th,
    .ranking-table td {
        padding: 8px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card, .subject-card, .analytics-card {
    animation: fadeIn 0.5s ease-out;
}



/* ========== ATTENDANCE STYLES ========== */

/* Month Selector */
.month-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin: 30px 0;
}

.month-selector h2 {
    font-size: 24px;
    min-width: 180px;
    text-align: center;
    color: var(--text-primary);
}

.month-nav {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    color: var(--text-secondary);
    font-size: 16px;
}

.month-nav:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Calendar */
.attendance-calendar {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 15px;
}

.calendar-header div {
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 14px;
    padding: 10px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    font-size: 14px;
    font-weight: 500;
}

.calendar-day:hover {
    transform: scale(1.05);
    box-shadow: var(--hover-shadow);
}

.calendar-day.empty {
    background: transparent;
    cursor: default;
}

.calendar-day.empty:hover {
    transform: none;
    box-shadow: none;
}

.calendar-day.present {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
}

.calendar-day.absent {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.calendar-day.excused {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.calendar-day.no-class {
    background: #e5e7eb;
    color: var(--text-secondary);
}

.day-number {
    font-size: 16px;
    font-weight: 600;
}

.day-icon {
    font-size: 10px;
    margin-top: 2px;
}

/* Legend */
.calendar-legend {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.legend-dot {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.legend-dot.present {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.legend-dot.absent {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.legend-dot.excused {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.legend-dot.no-class {
    background: #e5e7eb;
}

/* Weekly Summary */
.weekly-summary {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
}

.weekly-summary h3 {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.week-chart {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 150px;
}

.week-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.day-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.bar-container {
    width: 50px;
    height: 80px;
    background: #f3f4f6;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
}

.bar {
    width: 100%;
    border-radius: 8px 8px 0 0;
    transition: height 0.5s;
}

.present-bar {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.absent-bar {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.no-class-bar {
    background: #e5e7eb;
}

.bar-label {
    font-size: 18px;
}

/* Absence Reasons */
.absence-reasons {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
}

.absence-reasons h3 {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.reasons-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.reason-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
}

.date-badge {
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    min-width: 120px;
    display: inline-block;
    text-align: center;
}

.date-badge.absent {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.date-badge.excused {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.reason-detail {
    flex: 1;
}

.reason-detail p {
    color: var(--text-primary);
    font-size: 14px;
}

/* Attendance Action */
.attendance-action {
    text-align: center;
    padding: 20px;
}

.attendance-action .btn-primary {
    padding: 14px 30px;
    font-size: 16px;
}

.demo-note {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
}

/* Red stat icon */
.stat-icon.red {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* Responsive for Attendance */
@media (max-width: 768px) {
    .calendar-day {
        font-size: 11px;
    }
    
    .day-number {
        font-size: 13px;
    }
    
    .calendar-legend {
        gap: 15px;
    }
    
    .week-chart {
        flex-wrap: wrap;
        height: auto;
        gap: 15px;
    }
    
    .bar-container {
        width: 35px;
        height: 60px;
    }
    
    .reason-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}


/* ========== LOGIN PAGE STYLES ==========  royxatdan otish oynasi*/ 

 .login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
} 

/* ------------------  orqa fon rasm css kod boshlanishi ------------------ */
/* .login-page {
    background: url('../rasm/2314.jpg') center/cover no-repeat;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

/* Qorong'ulashtirish effekti (ixtiyoriy) */
 /* .login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 0;
}

.login-page .login-container {
    position: relative;
    z-index: 1; 
}*/
/* -------------  orqa fon rasm css kod tugashi ------------- */

.login-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* login shaffof boshlanish kodi*/
.login-container {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(5px);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* login shaffof tugashi kodi*/

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 32px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.login-logo i {
    font-size: 40px;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
}

.login-tab {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: all 0.3s;
}

.login-tab.active {
    color: var(--primary-color);
}

.login-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

.login-form {
    display: none;
}

.login-form.active {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
}

.form-group label i {
    width: 20px;
    color: var(--primary-color);
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.role-selector {
    margin-top: 5px;
}

.role-buttons {
    display: flex;
    gap: 10px;
}

.role-btn {
    flex: 1;
    padding: 12px;
    background: #f9fafb;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.role-btn i {
    font-size: 16px;
}

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

.login-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    margin-top: 20px;
}

.login-btn:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
}

.demo-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.demo-title {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 15px;
}

.demo-buttons {
    display: flex;
    gap: 10px;
}

.demo-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.demo-btn.student {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
}

.demo-btn.teacher {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

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

.login-footer {
    text-align: center;
    margin-top: 30px;
    color: var(--text-secondary);
    font-size: 12px;
}

/* ========== TEACHER STYLES ========== */

.teacher-sidebar .logo {
    position: relative;
}

.teacher-badge {
    display: block;
    font-size: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    margin-top: 5px;
    text-align: center;
}

.teacher-welcome {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.teacher-welcome h1 {
    color: white;
}

.teacher-welcome p {
    color: rgba(255, 255, 255, 0.9);
}

.teacher-schedule {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
}

.teacher-schedule h3 {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.schedule-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
}

.schedule-time {
    min-width: 120px;
    font-weight: 600;
    color: var(--primary-color);
}

.schedule-info {
    flex: 1;
}

.schedule-info h4 {
    margin-bottom: 4px;
    font-size: 15px;
}

.schedule-info p {
    font-size: 13px;
    color: var(--text-secondary);
}

.teacher-groups-preview {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
}

.groups-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.group-card {
    padding: 20px;
    background: #f9fafb;
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s;
}

.group-card:hover {
    background: white;
    box-shadow: var(--hover-shadow);
}

.group-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 15px;
    background: var(--primary-color);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
}

.group-card h4 {
    margin-bottom: 5px;
    font-size: 15px;
}

.group-card p {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 15px;
}

.group-progress {
    text-align: left;
}

.group-progress span {
    font-size: 12px;
    color: var(--text-secondary);
}

.teacher-activity {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow);
}

.teacher-activity h3 {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    border-radius: 8px;
    transition: background 0.3s;
}

.activity-item:hover {
    background: #f9fafb;
}

.activity-item i {
    font-size: 20px;
}

.activity-item i.green { color: #10b981; }
.activity-item i.blue { color: #3b82f6; }
.activity-item i.purple { color: #8b5cf6; }

.activity-info p {
    margin-bottom: 4px;
    font-size: 14px;
}

.activity-info span {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Responsive Teacher */
@media (max-width: 768px) {
    .groups-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .schedule-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .schedule-time {
        min-width: auto;
    }
}



/* ========== TEACHER GROUPS STYLES ========== */

.actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-tabs {
    display: flex;
    gap: 10px;
}

.filter-tab {
    padding: 8px 20px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.filter-tab:hover {
    background: #f9fafb;
}

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

.groups-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.group-detail-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s;
}

.group-detail-card:hover {
    box-shadow: var(--hover-shadow);
}

.group-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.group-card-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.group-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
}

.group-card-title h3 {
    margin-bottom: 5px;
    font-size: 18px;
}

.group-card-title p {
    color: var(--text-secondary);
    font-size: 13px;
}

.group-card-title p i {
    margin-right: 5px;
    color: var(--primary-color);
}

.group-actions {
    display: flex;
    gap: 10px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #f9fafb;
    border: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.3s;
}

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

.group-stats-row {
    display: flex;
    gap: 30px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.group-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.progress-bar.large {
    height: 10px;
    margin-bottom: 20px;
}

.group-actions-footer {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

/* ========== TEACHER ATTENDANCE STYLES ========== */

.attendance-filters {
    display: flex;
    gap: 20px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: var(--card-shadow);
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.filter-group label i {
    margin-right: 5px;
    color: var(--primary-color);
}

.select-input, .date-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.select-input:focus, .date-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.attendance-stats-preview {
    display: flex;
    gap: 30px;
    padding: 15px 20px;
    background: white;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: var(--card-shadow);
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-item i {
    font-size: 20px;
}

.stat-number {
    font-size: 24px;
    font-weight: bold;
}

.stat-number.present { color: #10b981; }
.stat-number.absent { color: #ef4444; }

.attendance-list-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
}

.attendance-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.attendance-list-header h3 {
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.attendance-actions {
    display: flex;
    gap: 10px;
}

.btn-small {
    padding: 8px 14px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
}

.btn-small:hover {
    background: var(--primary-light);
}

.btn-small.outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-small.outline:hover {
    background: #f9fafb;
}

.btn-small i {
    font-size: 12px;
}

.attendance-table-wrapper {
    overflow-x: auto;
}

.attendance-table {
    width: 100%;
    border-collapse: collapse;
}

.attendance-table th {
    text-align: left;
    padding: 12px;
    background: #f9fafb;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
    border-bottom: 1px solid var(--border-color);
}

.attendance-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.attendance-status {
    display: flex;
    gap: 15px;
}

.attendance-status label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-size: 13px;
}

.attendance-status input[type="radio"] {
    cursor: pointer;
    accent-color: var(--primary-color);
}

.reason-select {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    background: white;
    width: 100%;
    max-width: 200px;
}

.recent-attendance {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
    flex-wrap: wrap;
}

.history-date {
    display: flex;
    flex-direction: column;
    min-width: 90px;
}

.history-date .date {
    font-weight: 600;
    font-size: 14px;
}

.history-date .time {
    font-size: 12px;
    color: var(--text-secondary);
}

.history-info {
    flex: 1;
}

.history-info h4 {
    font-size: 15px;
    margin-bottom: 4px;
}

.history-info p {
    font-size: 13px;
    color: var(--text-secondary);
}

.attendance-save {
    display: flex;
    gap: 15px;
    justify-content: center;
    padding: 20px 0;
}

.btn-primary.large {
    padding: 14px 30px;
    font-size: 16px;
}

/* ========== TEACHER TESTS STYLES ========== */

.tests-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.test-tabs {
    display: flex;
    gap: 5px;
    background: white;
    padding: 4px;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
}

.test-tab {
    padding: 8px 20px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    color: var(--text-secondary);
}

.test-tab:hover {
    background: #f9fafb;
}

.test-tab.active {
    background: var(--primary-color);
    color: white;
}

.search-bar.small {
    width: 200px;
    padding: 8px 15px;
}

.search-filter {
    display: flex;
    gap: 10px;
    align-items: center;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.tests-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.test-management-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.test-management-card:hover {
    box-shadow: var(--hover-shadow);
    transform: translateY(-2px);
}

.test-management-card.create-new {
    border: 2px dashed var(--border-color);
    background: #fafafa;
    box-shadow: none;
    cursor: pointer;
}

.test-management-card.create-new:hover {
    border-color: var(--primary-color);
    background: #f0f4ff;
}

.create-test-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    min-height: 200px;
}

.create-test-content i {
    font-size: 40px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.create-test-content h4 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.create-test-content p {
    color: var(--text-secondary);
    font-size: 13px;
}

.test-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.test-subject-icon {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.test-subject-icon.math { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.test-subject-icon.geometry { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.test-subject-icon.algebra { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }

.test-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

.test-status.published {
    background: #d1fae5;
    color: #065f46;
}

.test-status.draft {
    background: #fef3c7;
    color: #92400e;
}

.test-management-card h4 {
    font-size: 16px;
    margin-bottom: 8px;
}

.test-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.test-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.test-groups {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.test-stats {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 15px;
    font-size: 12px;
}

.test-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
}

.test-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.quick-actions {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow);
}

.quick-actions h3 {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.quick-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.quick-action-card:hover {
    background: white;
    border-color: var(--primary-color);
    box-shadow: var(--hover-shadow);
}

.quick-action-card i {
    font-size: 28px;
    color: var(--primary-color);
}

.quick-action-card span {
    font-size: 13px;
    font-weight: 500;
}

/* ========== TEACHER ANALYTICS STYLES ==========   oqituvchi bolimi dizayni*/

.analytics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.group-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.group-selector label {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-secondary);
    font-size: 14px;
}

.date-range {
    display: flex;
    gap: 5px;
    background: white;
    padding: 4px;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
}

.date-btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
    color: var(--text-secondary);
}

.date-btn:hover {
    background: #f9fafb;
}

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

.top-students-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.top-student-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #f9fafb;
    border-radius: 8px;
}

.student-rank {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    background: #e5e7eb;
    color: var(--text-secondary);
}

.student-rank.gold {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
}

.student-rank.silver {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    color: white;
}

.student-rank.bronze {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: white;
}

.student-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.student-info {
    flex: 1;
}

.student-info h4 {
    font-size: 14px;
    margin-bottom: 2px;
}

.student-info p {
    font-size: 11px;
    color: var(--text-secondary);
}

.student-score {
    font-size: 18px;
    font-weight: bold;
    color: var(--primary-color);
}

.weak-students-table {
    overflow-x: auto;
}

.analytics-table {
    width: 100%;
    border-collapse: collapse;
}

.analytics-table th {
    text-align: left;
    padding: 12px;
    background: #f9fafb;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
    border-bottom: 1px solid var(--border-color);
}

.analytics-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.student-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.student-cell img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
}

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge.danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge.warning {
    background: #fef3c7;
    color: #92400e;
}

.badge.success {
    background: #d1fae5;
    color: #065f46;
}

.subject-performance-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.subject-performance-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.performance-header {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

/* Header Left */
.header-left h1 {
    font-size: 24px;
    color: var(--text-primary);
}

/* Responsive Design for Teacher Pages */
@media (max-width: 1024px) {
    .tests-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .subject-performance-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .tests-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-actions-grid {
        grid-template-columns: 1fr;
    }
    
    .group-stats-row {
        gap: 15px;
    }
    
    .attendance-filters {
        flex-direction: column;
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .analytics-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .group-selector {
        flex-direction: column;
        align-items: stretch;
    }
    
    .date-range {
        justify-content: center;
    }
    
    .top-student-item {
        flex-wrap: wrap;
    }
    
    .student-score {
        margin-left: auto;
    }
}




/* ========== DARK MODE STYLES  tungi rejim uchun dizayn kodi ========== */

body.dark-mode {
    --bg-color: #111827;
    --sidebar-bg: #1f2937;
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --border-color: #374151;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --hover-shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
}

body.dark-mode .sidebar {
    background: #1f2937;
    border-right-color: #374151;
}

body.dark-mode .main-content {
    background: #111827;
}

body.dark-mode .header {
    background: transparent;
}

body.dark-mode .search-bar,
body.dark-mode .stat-card,
body.dark-mode .continue-card,
body.dark-mode .recommend-card,
body.dark-mode .recent-tests,
body.dark-mode .subject-card,
body.dark-mode .analytics-card,
body.dark-mode .group-detail-card,
body.dark-mode .attendance-filters,
body.dark-mode .attendance-list-container,
body.dark-mode .recent-attendance,
body.dark-mode .test-management-card,
body.dark-mode .quick-actions,
body.dark-mode .profile-header,
body.dark-mode .info-card,
body.dark-mode .achievements-card,
body.dark-mode .settings-card,
body.dark-mode .ranking-table-container,
body.dark-mode .weekly-summary,
body.dark-mode .absence-reasons,
body.dark-mode .attendance-calendar,
body.dark-mode .teacher-schedule,
body.dark-mode .teacher-groups-preview,
body.dark-mode .teacher-activity,
body.dark-mode .month-selector h2 {
    background: #1f2937;
    color: #f9fafb;
}

body.dark-mode .stat-info p,
body.dark-mode .test-date,
body.dark-mode .test-count,
body.dark-mode .subject-label,
body.dark-mode .page-header p,
body.dark-mode .welcome-section p {
    color: #9ca3af;
}

body.dark-mode .nav-item:hover a {
    background: #374151;
}

body.dark-mode .nav-item.active a {
    background: #374151;
}

body.dark-mode .progress-bar {
    background: #374151;
}

body.dark-mode .test-item:hover {
    background: #374151;
}

body.dark-mode .modal-content {
    background: #1f2937;
    color: #f9fafb;
}

body.dark-mode .modal-test-item {
    border-color: #374151;
}

body.dark-mode .modal-test-item:hover {
    background: #374151;
}

body.dark-mode .btn-secondary {
    background: #374151;
    color: #f9fafb;
}

body.dark-mode .btn-secondary:hover {
    background: #4b5563;
}

body.dark-mode .btn-subject {
    border-color: #374151;
    color: #f9fafb;
}

body.dark-mode .filter-tab,
body.dark-mode .test-tab,
body.dark-mode .date-btn {
    background: #374151;
    color: #9ca3af;
    border-color: #4b5563;
}

body.dark-mode .filter-tab.active,
body.dark-mode .test-tab.active,
body.dark-mode .date-btn.active {
    background: var(--primary-color);
    color: white;
}

body.dark-mode .select-input,
body.dark-mode .date-input,
body.dark-mode .filter-select,
body.dark-mode .search-bar input,
body.dark-mode .reason-select {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}

body.dark-mode .attendance-table th,
body.dark-mode .analytics-table th,
body.dark-mode .ranking-table th {
    background: #374151;
    color: #9ca3af;
}

body.dark-mode .attendance-table td,
body.dark-mode .analytics-table td,
body.dark-mode .ranking-table td {
    border-bottom-color: #374151;
}

body.dark-mode .history-item,
body.dark-mode .reason-item,
body.dark-mode .top-student-item,
body.dark-mode .calendar-day:not(.present):not(.absent):not(.excused):not(.no-class) {
    background: #374151;
}

body.dark-mode .calendar-day.empty {
    background: transparent;
}

body.dark-mode .calendar-day.no-class {
    background: #4b5563;
    color: #9ca3af;
}

body.dark-mode .quick-action-card {
    background: #374151;
}

body.dark-mode .quick-action-card:hover {
    background: #4b5563;
}

body.dark-mode .test-management-card.create-new {
    background: #1f2937;
    border-color: #4b5563;
}

body.dark-mode .login-container {
    background: #1f2937;
}

body.dark-mode .login-page {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
}

body.dark-mode .form-group input {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}

body.dark-mode .role-btn {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}

body.dark-mode .role-btn.active {
    background: var(--primary-color);
}

body.dark-mode .login-footer,
body.dark-mode .login-subtitle {
    color: #9ca3af;
}

/* Dark mode toggle switch */
body.dark-mode .slider {
    background-color: #4b5563;
}

body.dark-mode input:checked + .slider {
    background-color: var(--primary-color);
}



/* --------------  YORDAM TUGMASI CSS KODI --------------*/

.help-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10000;
}

.help-button {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.4);
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.help-button i {
    font-size: 20px;
}

.help-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(79, 70, 229, 0.5);
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

.help-popup {
    display: none;
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 320px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

.help-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
}

.help-popup-header h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    margin: 0;
}

.help-popup-header h4 i {
    font-size: 18px;
}

.close-popup {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.close-popup:hover {
    background: rgba(255, 255, 255, 0.3);
}

.help-popup-body {
    padding: 8px 0;
}

.help-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 20px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s;
    border-bottom: 1px solid var(--border-color);
}

.help-item:last-child {
    border-bottom: none;
}

.help-item:hover {
    background: #f9fafb;
}

.help-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.help-icon.call {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.help-icon.email {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.help-icon.telegram {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.help-info {
    flex: 1;
}

.help-info h5 {
    font-size: 15px;
    margin-bottom: 4px;
    font-weight: 600;
}

.help-info p {
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 2px;
}

.help-info span {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Dark mode uchun */
body.dark-mode .help-popup {
    background: #1f2937;
}

body.dark-mode .help-item:hover {
    background: #374151;
}

body.dark-mode .help-info h5 {
    color: #f9fafb;
}





/* ========== FORGOT PASSWORD ========== */
.forgot-password {
    text-align: right;
    margin-top: -5px;
    margin-bottom: 15px;
}

.forgot-password a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
}

.forgot-password a i {
    font-size: 12px;
}

.forgot-password a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}






/* ========== VIDEO WIDGET (CHAP PASTKI) ========== */
.video-widget {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 10000;
}

.video-button {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.video-button i {
    font-size: 20px;
}

.video-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(239, 68, 68, 0.5);
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
}

/* Video Modal */
.video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10001;
    align-items: center;
    justify-content: center;
}

.video-modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    overflow: hidden;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.video-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.video-modal-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    margin: 0;
}

.close-modal {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.3);
}

.video-container {
    padding: 0;
    background: #000;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-placeholder {
    width: 100%;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e1e1e 0%, #2d2d2d 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.video-placeholder:hover {
    background: linear-gradient(135deg, #2d2d2d 0%, #3d3d3d 100%);
}

.video-placeholder i {
    font-size: 64px;
    color: #ef4444;
    margin-bottom: 16px;
}

.video-placeholder p {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.video-placeholder span {
    font-size: 14px;
    color: #9ca3af;
}

/* Dark mode uchun */
body.dark-mode .video-modal-content {
    background: #1f2937;
}

body.dark-mode .video-placeholder {
    background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
}









/* ========== CHAT MODAL ========== */
.chat-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.chat-container {
    width: 500px;
    height: 600px;
    background: white;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: chatSlideUp 0.3s ease;
}

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

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
}

.chat-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.chat-user-info h4 {
    font-size: 16px;
    margin-bottom: 2px;
}

.online-status {
    font-size: 12px;
    opacity: 0.9;
}

.online-status::before {
    content: '●';
    color: #10b981;
    margin-right: 4px;
}

.chat-actions {
    display: flex;
    gap: 8px;
}

.chat-action-btn, .chat-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.chat-action-btn:hover, .chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    display: flex;
    gap: 10px;
    max-width: 80%;
}

.message.received {
    align-self: flex-start;
}

.message.sent {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.message-content {
    background: white;
    padding: 10px 14px;
    border-radius: 18px;
    border-top-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.message.sent .message-content {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border-radius: 18px;
    border-top-right-radius: 4px;
}

.message-text {
    font-size: 14px;
    line-height: 1.4;
}

.message-time {
    font-size: 10px;
    opacity: 0.7;
    margin-top: 4px;
    text-align: right;
}

.message.sent .message-time {
    color: rgba(255, 255, 255, 0.8);
}

.message-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 12px;
    margin-top: 5px;
}

.chat-input-area {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.chat-attach-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f3f4f6;
    border: none;
    color: #6b7280;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.chat-attach-btn:hover {
    background: #e5e7eb;
    color: #4f46e5;
}

.chat-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
}

.chat-input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

/* Dark mode uchun */
body.dark-mode .chat-container {
    background: #1f2937;
}

body.dark-mode .chat-messages {
    background: #111827;
}

body.dark-mode .message-content {
    background: #374151;
    color: #f9fafb;
}

body.dark-mode .chat-input-area {
    background: #1f2937;
    border-top-color: #374151;
}

body.dark-mode .chat-input {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}

body.dark-mode .chat-attach-btn {
    background: #374151;
    color: #9ca3af;
}

/* ========== RESPONSIVE ENHANCEMENTS (TABLET + MOBILE) ========== */

/* Tablet: compact but still sidebar-based */
@media (max-width: 1024px) {
    .main-content {
        padding: 16px 18px;
    }

    .content-wrapper {
        max-width: 100%;
    }

    .header {
        gap: 12px;
        margin-bottom: 20px;
    }

    .search-bar {
        width: min(320px, 55vw);
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid,
    .analytics-grid,
    .profile-content {
        grid-template-columns: 1fr;
    }

    .subjects-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tests-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Mobile: remove fixed sidebar pressure and stack everything cleanly */
@media (max-width: 768px) {
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 10px 0;
    }

    .app-container {
        flex-direction: column;
        min-height: auto;
    }

    .sidebar .logo {
        padding: 0 14px 10px;
        font-size: 18px;
        justify-content: center;
    }

    .sidebar .logo i {
        font-size: 22px;
    }

    .sidebar .logo span,
    .nav-item span {
        display: inline;
    }

    .nav-menu {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        padding: 0 10px 8px;
    }

    .nav-item {
        margin-bottom: 0;
    }

    .nav-item a {
        border-left: none;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 8px 10px;
        gap: 8px;
    }

    .nav-item.active a {
        border-left: 1px solid var(--primary-color);
    }

    .main-content {
        margin-left: 0;
        padding: 12px;
    }

    .header {
        flex-direction: column;
        align-items: stretch;
        margin-bottom: 18px;
        gap: 10px;
    }

    .search-bar {
        width: 100%;
        padding: 10px 12px;
    }

    .header-actions {
        justify-content: space-between;
    }

    .user-profile-mini span {
        font-size: 13px;
    }

    .welcome-section h1,
    .page-header h1 {
        font-size: 22px;
    }

    .stats-grid,
    .subjects-grid,
    .tests-grid,
    .quick-actions-grid,
    .groups-grid,
    .subject-performance-grid,
    .achievements-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .ranking-tabs,
    .filter-tabs,
    .test-tabs,
    .date-range {
        overflow-x: auto;
        white-space: nowrap;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .tab-btn,
    .filter-tab,
    .test-tab,
    .date-btn {
        flex: 0 0 auto;
    }

    .podium {
        gap: 10px;
    }

    .podium-item {
        width: 100%;
        min-width: 0;
    }

    .your-rank-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .rank-stats {
        width: 100%;
        justify-content: space-between;
        gap: 10px;
    }

    .ranking-table-container,
    .attendance-list-container,
    .weak-students-table {
        overflow-x: auto;
    }

    .ranking-table,
    .attendance-table,
    .analytics-table {
        min-width: 680px;
    }

    .profile-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
    }

    .profile-avatar-large {
        margin-top: -40px;
    }

    .profile-avatar-large img {
        width: 96px;
        height: 96px;
    }

    .btn-edit-profile {
        width: 100%;
        justify-content: center;
    }

    .chat-container {
        width: calc(100vw - 16px);
        height: min(82vh, 620px);
        border-radius: 12px;
    }

    .video-widget,
    .help-widget {
        bottom: 12px;
    }

    .video-widget {
        left: 12px;
    }

    .help-widget {
        right: 12px;
    }

    .video-button,
    .help-button {
        padding: 10px 14px;
        font-size: 13px;
        gap: 6px;
    }

    .video-button span,
    .help-button span {
        display: none;
    }

    .help-popup {
        right: 0;
        width: min(90vw, 320px);
        bottom: 58px;
    }

    .video-modal-content {
        width: 96%;
    }

    .video-container,
    .video-placeholder {
        min-height: 240px;
    }
}

/* Extra small phones */
@media (max-width: 420px) {
    .main-content {
        padding: 10px;
    }

    .welcome-section h1,
    .page-header h1 {
        font-size: 20px;
    }

    .stat-card,
    .continue-card,
    .recommend-card,
    .recent-tests,
    .subject-card,
    .analytics-card,
    .group-detail-card,
    .test-management-card,
    .info-card,
    .achievements-card,
    .settings-card {
        padding: 14px;
    }

    .chat-messages {
        padding: 12px;
    }

    .chat-input-area {
        padding: 10px;
        gap: 8px;
    }

    .chat-input {
        font-size: 13px;
        padding: 9px 12px;
    }
}






/* ========== VIDEO LESSONS STYLES ========== */

/* Upload Section */
.upload-section {
    margin-bottom: 30px;
}

.upload-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    box-shadow: var(--card-shadow);
    border: 2px dashed var(--border-color);
    transition: all 0.3s;
}

.upload-card:hover {
    border-color: var(--primary-color);
}

.upload-icon {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.upload-card h3 {
    margin-bottom: 8px;
    font-size: 20px;
}

.upload-card p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 500px;
    margin: 0 auto;
}

.video-input, .video-select {
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s;
}

.video-input:focus, .video-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Video Grid */
.video-list-section {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--card-shadow);
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.video-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.3s;
    border: 1px solid var(--border-color);
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--hover-shadow);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-thumbnail .play-icon {
    position: absolute;
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    transition: all 0.3s;
}

.video-card:hover .play-icon {
    background: var(--primary-color);
    transform: scale(1.1);
}

.video-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.video-info {
    padding: 15px;
}

.video-info h4 {
    font-size: 15px;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.video-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.video-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.watched-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #d1fae5;
    color: #065f46;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.unwatched-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #fef3c7;
    color: #92400e;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* Video Progress Bar */
.video-progress-bar {
    background: white;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 25px;
    box-shadow: var(--card-shadow);
}

.video-progress-bar .progress-info {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* Video Player Modal */
.video-player-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10001;
}

.video-player-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.video-player-container {
    position: relative;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 900px;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    z-index: 1;
}

.video-player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: linear-gradient(135deg, #1e1e1e 0%, #2d2d2d 100%);
    color: white;
}

.video-player-header h3 {
    font-size: 16px;
    margin: 0;
}

.video-iframe-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: #000;
}

.video-iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: #f9fafb;
}

.video-views {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: 1fr;
    }
    
    .video-player-container {
        width: 95%;
    }
    
    .upload-form {
        max-width: 100%;
    }
}

/* Dark Mode */
body.dark-mode .upload-card {
    background: #1f2937;
    border-color: #374151;
}

body.dark-mode .video-card {
    background: #1f2937;
    border-color: #374151;
}

body.dark-mode .video-list-section {
    background: #1f2937;
}

body.dark-mode .video-progress-bar {
    background: #1f2937;
}

body.dark-mode .video-actions-bar {
    background: #1f2937;
}

body.dark-mode .video-input,
body.dark-mode .video-select {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}