/* Azim — Öğrenci Çalışma ve Takip Sistemi — Arayüz Tasarımı */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Dark Theme Default */
    --bg-base: #0a0813;
    --bg-panel: rgba(20, 18, 38, 0.7);
    --bg-card: rgba(30, 27, 57, 0.55);
    --bg-input: rgba(15, 12, 30, 0.6);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(138, 43, 226, 0.2);

    --text-main: #f3f1f9;
    --text-muted: #9f9cb6;

    --color-primary: #8a2be2;
    --color-primary-rgb: 138, 43, 226;
    --color-secondary: #00d2ff;
    --color-secondary-rgb: 0, 210, 255;
    --color-success: #00e676;
    --color-warning: #ffb300;
    --color-danger: #ff1744;

    /* B4: Şablonlarda kullanılan eski isimler için takma adlar.
       Bunlar tanımsız olduğu için AI paneli ve bazı butonlar temadan kopuktu. */
    --color-card-bg: var(--bg-card);
    --color-body-bg: var(--bg-base);
    --text-color: var(--text-main);

    /* Yüzeylerin tema-duyarlı vurguları (sabit beyaz rgba yerine) */
    --surface-subtle: rgba(255, 255, 255, 0.03);
    --surface-raised: rgba(255, 255, 255, 0.06);

    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --glass-blur: blur(16px);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --bg-base: #f4f6fc;
    --bg-panel: rgba(255, 255, 255, 0.8);
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-input: rgba(240, 242, 249, 0.9);
    --border-color: rgba(0, 0, 0, 0.08);
    --border-glow: rgba(107, 17, 195, 0.15);

    --text-main: #1c1836;
    --text-muted: #67647c;

    --color-primary: #6b11c3;
    --color-primary-rgb: 107, 17, 195;
    --color-secondary: #0094c6;
    --color-secondary-rgb: 0, 148, 198;
    --color-success: #00a854;
    --color-warning: #e65c00;
    --color-danger: #d50000;

    /* D3: aydınlık temada gölgeler yumuşatılır, yüzey vurguları koyulaştırılır */
    --shadow-sm: 0 4px 6px -1px rgba(28, 24, 54, 0.06), 0 2px 4px -1px rgba(28, 24, 54, 0.04);
    --shadow-md: 0 10px 15px -3px rgba(28, 24, 54, 0.08), 0 4px 6px -2px rgba(28, 24, 54, 0.04);
    --shadow-lg: 0 20px 25px -5px rgba(28, 24, 54, 0.1), 0 10px 10px -5px rgba(28, 24, 54, 0.03);

    --surface-subtle: rgba(28, 24, 54, 0.03);
    --surface-raised: rgba(28, 24, 54, 0.06);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.5s ease;
}

/* Background Gradients */
.bg-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--color-primary-rgb), 0.15) 0%, rgba(0,0,0,0) 70%);
    top: -200px;
    right: -200px;
    z-index: -1;
    pointer-events: none;
}

.bg-glow-2 {
    position: fixed;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 210, 255, 0.08) 0%, rgba(0,0,0,0) 70%);
    bottom: -150px;
    left: -150px;
    z-index: -1;
    pointer-events: none;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* Auth Page */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-card {
    background: var(--bg-panel);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: fadeIn 0.6s ease;
}

.auth-header img {
    width: 64px;
    margin-bottom: 16px;
}

.auth-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--text-main) 30%, var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 30px;
}

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

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

.input-wrapper {
    position: relative;
}

.input-wrapper input, .input-wrapper select {
    width: 100%;
    padding: 14px 16px 14px 44px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 15px;
    outline: none;
    transition: var(--transition-smooth);
}

.input-wrapper input:focus, .input-wrapper select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--border-glow);
}

.input-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--color-primary), #b32bf5);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(var(--color-primary-rgb), 0.3);
    transition: var(--transition-smooth);
    margin-top: 10px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--color-primary-rgb), 0.5);
}

.auth-footer {
    margin-top: 24px;
    font-size: 13px;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--color-secondary);
    text-decoration: none;
    font-weight: 500;
}

/* App Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-panel);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--border-color);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    transition: var(--transition-smooth);
    z-index: 100;
}

.sidebar.collapsed {
    width: 80px;
    padding: 30px 10px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    padding-left: 10px;
    overflow: hidden;
}

.sidebar-brand i {
    font-size: 28px;
    color: var(--color-secondary);
    min-width: 32px;
}

.sidebar-brand span {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.5px;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.sidebar.collapsed .sidebar-brand span {
    opacity: 0;
    width: 0;
    pointer-events: none;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
    white-space: nowrap;
}

.menu-item i {
    font-size: 20px;
    min-width: 24px;
    text-align: center;
}

.menu-item span {
    transition: opacity 0.2s;
}

.sidebar.collapsed .menu-item span {
    opacity: 0;
    width: 0;
    pointer-events: none;
}

.menu-item:hover, .menu-item.active {
    background: rgba(var(--color-primary-rgb), 0.1);
    color: var(--text-main);
}

.menu-item.active {
    background: linear-gradient(135deg, rgba(var(--color-primary-rgb), 0.2), rgba(var(--color-primary-rgb), 0.05));
    border-left: 4px solid var(--color-primary);
    padding-left: 12px;
}

.sidebar-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 16px;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
}

.sidebar.collapsed .sidebar-user {
    padding: 5px;
}

.sidebar.collapsed .user-info {
    display: none;
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Top Navigation */
.top-nav {
    height: 80px;
    background: rgba(var(--color-primary-rgb), 0.01);
    border-bottom: 1px solid var(--border-color);
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 22px;
    cursor: pointer;
}

.page-title h2 {
    font-size: 22px;
    font-weight: 700;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.theme-toggle, .btn-action {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: var(--transition-smooth);
}

.theme-toggle:hover, .btn-action:hover {
    background: var(--border-color);
    border-color: var(--color-primary);
}

/* Page Panels */
.panel {
    flex: 1;
    padding: 40px;
    display: none;
    animation: fadeIn 0.4s ease;
    overflow-y: auto;
}

.panel.active {
    display: block;
}

/* Dashboard Cards Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    transition: var(--transition-smooth);
}

.card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-lg);
}

/* Card Sizes */
.col-12 { grid-column: span 12; }
.col-8 { grid-column: span 8; }
.col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; }
.col-3 { grid-column: span 3; }

/* Stat Card */
.stat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.primary { background: rgba(138, 43, 226, 0.15); color: #c07dff; }
.stat-icon.secondary { background: rgba(0, 210, 255, 0.15); color: #00d2ff; }
.stat-icon.success { background: rgba(0, 230, 118, 0.15); color: #00e676; }
.stat-icon.warning { background: rgba(255, 179, 0, 0.15); color: #ffb300; }

.stat-details h3 {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 6px;
}

.stat-details .value {
    font-size: 26px;
    font-weight: 700;
}

.stat-details .sub {
    font-size: 12px;
    color: var(--color-success);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Profile Progress Wrapper */
.level-badge {
    display: inline-block;
    padding: 6px 12px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 12px;
}

.xp-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin: 12px 0 6px 0;
    overflow: hidden;
    position: relative;
}

.xp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    width: 0%;
    border-radius: 10px;
    transition: width 1s ease;
}

/* Timer Card Styling */
.timer-container {
    text-align: center;
    padding: 20px 0;
}

.timer-display {
    font-size: 64px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    margin: 20px 0;
    background: linear-gradient(135deg, var(--text-main), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
}

.btn-timer {
    padding: 12px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    border: none;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-timer.start {
    background: var(--color-success);
    color: #053319;
    box-shadow: 0 4px 12px rgba(0, 230, 118, 0.3);
}

.btn-timer.pause {
    background: var(--color-warning);
    color: #3b2000;
    box-shadow: 0 4px 12px rgba(255, 179, 0, 0.3);
}

.btn-timer.stop {
    background: var(--color-danger);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 23, 68, 0.3);
}

.btn-timer:disabled {
    background: var(--bg-input);
    color: var(--text-muted);
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.6;
}

.timer-status {
    color: var(--text-muted);
    font-size: 14px;
}

/* Badges Showcase */
.badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 16px;
    margin-top: 15px;
}

.badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    opacity: 0.4;
    filter: grayscale(100%);
    transition: var(--transition-smooth);
}

.badge-item.unlocked {
    opacity: 1;
    filter: grayscale(0%);
    border-color: rgba(var(--color-primary-rgb), 0.3);
    background: rgba(var(--color-primary-rgb), 0.05);
}

.badge-icon {
    font-size: 32px;
    margin-bottom: 8px;
    transition: transform 0.3s;
}

.badge-item.unlocked:hover .badge-icon {
    transform: scale(1.2) rotate(10deg);
}

.badge-item span {
    font-size: 11px;
    font-weight: 600;
}

/* Leaderboard */
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}

.leaderboard-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    transition: var(--transition-smooth);
}

.leaderboard-row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.leaderboard-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.rank {
    width: 28px;
    font-weight: 800;
    color: var(--text-muted);
}

.leaderboard-row:nth-child(1) .rank { color: var(--color-warning); font-size: 18px; }
.leaderboard-row:nth-child(2) .rank { color: #cccccc; font-size: 16px; }
.leaderboard-row:nth-child(3) .rank { color: #b87333; font-size: 15px; }

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

.leaderboard-user-name {
    font-weight: 600;
    font-size: 14px;
}

.leaderboard-points {
    font-weight: 700;
    color: var(--color-secondary);
}

/* Admin Styles */
.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
}

.search-box {
    position: relative;
    max-width: 320px;
    width: 100%;
}

.search-box input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-main);
    outline: none;
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

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

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
}

td {
    font-size: 14px;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

.badge-role {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-role.admin {
    background: rgba(255, 23, 68, 0.15);
    color: var(--color-danger);
}

.badge-role.student {
    background: rgba(0, 210, 255, 0.15);
    color: var(--color-secondary);
}

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

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-panel);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--color-primary);
    border-left: 5px solid var(--color-primary);
    border-radius: 10px;
    padding: 16px 20px;
    color: var(--text-main);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    animation: slideIn 0.3s ease forwards;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
    40% { transform: translateY(-8px); opacity: 1; }
}

/* AI Assistant Markdown Body Styles */
.markdown-body h2 { font-size: 18px; font-weight: 700; margin: 18px 0 8px; }
.markdown-body h3 { font-size: 16px; font-weight: 700; margin: 14px 0 6px; color: var(--color-primary); }
.markdown-body h4 { font-size: 14px; font-weight: 700; margin: 12px 0 4px; }
.markdown-body ul { list-style: disc inside; padding: 0; margin: 8px 0; }
.markdown-body li { margin-left: 16px; margin-bottom: 4px; }
.markdown-body strong { font-weight: 700; }
.markdown-body em { font-style: italic; }
.markdown-body hr { border: none; border-top: 1px solid var(--border-color); margin: 12px 0; }

/* Responsive Media Queries */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .col-8, .col-4, .col-6, .col-3 {
        grid-column: span 12;
    }
}

@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    .sidebar.collapsed {
        width: 100%;
    }
    .sidebar-menu {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    .sidebar-user {
        display: none;
    }
    .top-nav {
        padding: 0 20px;
    }
    .panel {
        padding: 20px;
    }
}

/* Game Panel Styles */
.btn-game-tab {
    padding: 10px 20px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: none;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-smooth);
}

.btn-game-tab:hover {
    border-color: var(--color-primary);
    color: var(--text-main);
}
.btn-game-tab.active {
    border-color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.08);
    color: var(--color-primary);
}

/* Memory Game Styles */
.memory-grid {
    display: grid;
    gap: 12px;
    margin: 0 auto 20px auto;
}
.memory-grid.grid-16 {
    grid-template-columns: repeat(4, 1fr);
    max-width: 340px;
}
.memory-grid.grid-32 {
    grid-template-columns: repeat(8, 1fr);
    max-width: 680px;
}
@media (max-width: 768px) {
    .memory-grid.grid-32 {
        grid-template-columns: repeat(4, 1fr);
        max-width: 340px;
    }
}

.memory-card {
    height: 72px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    transition: var(--transition-smooth);
}
.memory-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
}
.memory-card.revealed {
    background: rgba(var(--color-primary-rgb), 0.15);
    border-color: var(--color-primary);
    transform: scale(1.05);
}
.memory-card.matched {
    background: rgba(0, 230, 118, 0.12);
    border-color: #00e676;
    opacity: 0.6;
    cursor: default;
    transform: none;
}

/* Word Match Game Styles */
.word-match-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    max-width: 500px;
    margin: 0 auto;
}
.word-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.word-btn {
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-main);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-align: center;
    user-select: none;
}
.word-btn:hover {
    border-color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.02);
}
.word-btn.selected {
    border-color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.15);
    box-shadow: 0 0 0 2px var(--color-primary);
}
.word-btn.correct {
    border-color: #00e676;
    background: rgba(0, 230, 118, 0.12);
    color: #00e676;
    pointer-events: none;
}
.word-btn.wrong {
    border-color: var(--color-danger);
    background: rgba(255, 23, 68, 0.12);
    color: var(--color-danger);
}

.badge-bonus-tag {
    color: var(--color-warning);
    font-size: 10px;
    font-weight: 700;
}

/* ==========================================================================
   D1/D7: Ortak durum blokları, sınıfa çekilen inline stiller, yeni bileşenler
   ========================================================================== */

/* Yükleniyor / boş durum / hata blokları */
.state-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 28px 16px;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}
.state-block i { font-size: 26px; opacity: 0.5; }
.state-block p { margin: 0; max-width: 320px; line-height: 1.5; }

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(var(--color-primary-rgb), 0.2);
    border-left-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast kapatma butonu */
.toast-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.6;
    padding: 0 0 0 8px;
}
.toast-close:hover { opacity: 1; }

/* D7: eksik olan .btn-secondary tanımı (tamamen inline stille idare ediliyordu) */
.btn-secondary {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 12px;
    font-weight: 600;
    padding: 10px 16px;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.btn-secondary:hover { border-color: var(--color-primary); color: var(--color-primary); }

.btn-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: none;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition-smooth);
}
.btn-icon.edit { border-color: var(--color-primary); color: var(--color-primary); }
.btn-icon.warn { border-color: var(--color-warning); color: var(--color-warning); }
.btn-icon.danger { border-color: var(--color-danger); color: var(--color-danger); }
.btn-icon:hover { filter: brightness(1.3); }
.btn-icon:disabled { opacity: 0.5; cursor: not-allowed; }

.row-actions { display: flex; gap: 6px; justify-content: center; }
.centered { text-align: center; }
.muted { color: var(--text-muted); }
.strong { font-weight: 600; }

.table-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0 auto;
}
.user-avatar.small { width: 32px; height: 32px; font-size: 12px; }
.user-avatar.centered { margin: 0 auto; }
.avatar-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.course-tag { color: var(--color-secondary); font-weight: 600; }

.pill {
    display: inline-block;
    background: rgba(var(--color-primary-rgb), 0.12);
    color: var(--color-primary);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}
.pill.danger { background: rgba(255, 23, 68, 0.12); color: var(--color-danger); }

.field-hint {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-muted);
}

/* Kart başlıkları (tekrar eden inline stiller yerine) */
.card-head { margin-bottom: 18px; }
.card-head h3 { font-size: 16px; font-weight: 700; }
.card-head p { color: var(--text-muted); font-size: 12px; margin-top: 2px; }

.chart-box { position: relative; height: 240px; }
.chart-box.tall { height: 300px; }
.chart-box.centered-flex { display: flex; align-items: center; justify-content: center; }

/* E1: tarih aralığı seçici */
.range-picker { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.btn-range {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.btn-range:hover { color: var(--color-primary); }
.btn-range.active {
    border-color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.08);
    color: var(--color-primary);
}

/* E2: çalışma ısı haritası */
.heatmap-grid {
    display: grid;
    grid-template-rows: repeat(7, 1fr);
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 3px;
    min-height: 120px;
}
.heat-cell {
    aspect-ratio: 1;
    min-width: 10px;
    border-radius: 3px;
    background: var(--surface-subtle);
}
.heat-0 { background: var(--surface-subtle); }
.heat-1 { background: rgba(var(--color-primary-rgb), 0.25); }
.heat-2 { background: rgba(var(--color-primary-rgb), 0.45); }
.heat-3 { background: rgba(var(--color-primary-rgb), 0.7); }
.heat-4 { background: var(--color-primary); }

.heatmap-legend {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 12px;
    font-size: 11px;
    color: var(--text-muted);
}
.heatmap-legend .heat-cell { width: 11px; height: 11px; aspect-ratio: auto; }

/* E3: risk grubu listesi */
.risk-list { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; }
.risk-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--surface-subtle);
}
.risk-row strong { display: block; font-size: 13px; }
.risk-meta { font-size: 11px; color: var(--text-muted); }

/* Oyun skor listesi */
.score-row {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-radius: 8px;
    background: var(--surface-subtle);
    border: 1px solid var(--border-color);
    font-size: 13px;
}
.score-value { color: var(--color-warning); font-weight: 700; }

/* Liderlik */
.leaderboard-row.is-me {
    border-color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.06);
}
.my-rank { text-align: center; color: var(--text-muted); font-size: 13px; margin-bottom: 12px; }

/* Rozet kartı */
.badge-name { font-weight: 700; margin-bottom: 4px; }
.badge-desc { font-size: 10px; color: var(--text-muted); line-height: 1.4; }

/* B1: kaydedilemeyen çalışma bandı */
.retry-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 12px;
    background: rgba(255, 179, 0, 0.1);
    border: 1px solid var(--color-warning);
    color: var(--text-main);
    font-size: 13px;
    text-align: left;
}
.retry-banner .btn-primary { width: auto; margin: 0; padding: 8px 16px; }

/* D3: günlük hedef düzenleme butonu */
.goal-edit-btn {
    margin-top: 8px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-primary);
    font-weight: 600;
    font-family: inherit;
}

/* AI paneli */
.ai-chat-card {
    padding: 0;
    overflow: hidden;
    height: 550px;
    flex-direction: column;
}
.ai-banner {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.6;
}
.ai-banner.warn {
    background: rgba(255, 179, 0, 0.12);
    border: 1px solid var(--color-warning);
    color: var(--text-main);
}
.ai-banner small { display: block; margin-top: 4px; opacity: 0.8; }

.chat-row { display: flex; gap: 12px; align-items: flex-start; max-width: 80%; }
.chat-row.user { align-self: flex-end; flex-direction: row-reverse; }
.chat-avatar { width: 36px; height: 36px; flex-shrink: 0; }
.chat-row.bot .chat-avatar { background: var(--color-primary); }
.chat-row.user .chat-avatar { background: var(--color-secondary); }

.chat-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.6;
    border: 1px solid var(--border-color);
}
.chat-bubble.bot { background: var(--bg-base); border-top-left-radius: 0; }
.chat-bubble.user {
    background: var(--color-primary);
    color: #fff;
    border-top-right-radius: 0;
    border-color: transparent;
}
.chat-bubble.typing { display: flex; gap: 5px; align-items: center; }
.chat-bubble.typing .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: bounce 1.2s infinite;
}
.chat-bubble.typing .dot:nth-child(2) { animation-delay: 0.2s; }
.chat-bubble.typing .dot:nth-child(3) { animation-delay: 0.4s; }

/* AI sekme butonları (D7: cssText yığmak yerine sınıf) */
#btnAiTabReport.active,
#btnAiTabChat.active {
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-primary);
}

/* F3: Haftalık görevler */
.quest-list { display: flex; flex-direction: column; gap: 14px; }
.quest-card {
    padding: 16px 18px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--surface-subtle);
    transition: var(--transition-smooth);
}
.quest-card.completed {
    border-color: var(--color-success);
    background: rgba(0, 230, 118, 0.08);
}
.quest-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}
.quest-title { font-weight: 700; font-size: 15px; }
.quest-desc { color: var(--text-muted); font-size: 13px; margin-bottom: 10px; line-height: 1.5; }
.quest-progress-bar {
    height: 8px;
    border-radius: 4px;
    background: var(--surface-raised);
    overflow: hidden;
    margin: 8px 0 6px;
}
.quest-progress-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--color-secondary), var(--color-primary));
    transition: width 0.4s ease;
}
.quest-meta { font-size: 12px; color: var(--text-muted); }
.quest-card.admin .quest-meta { margin-top: 4px; }

/* F4: Bildirim merkezi */
.notif-wrap { position: relative; display: inline-block; }
.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: var(--color-danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.notif-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 340px;
    max-width: 90vw;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    z-index: 100;
    overflow: hidden;
}
.notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    font-size: 14px;
}
.notif-mark-all {
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.notif-list { max-height: 400px; overflow-y: auto; }
.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition-smooth);
}
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: rgba(var(--color-primary-rgb), 0.06); }
.notif-ico { font-size: 20px; flex-shrink: 0; }
.notif-body { min-width: 0; }
.notif-title { font-weight: 600; font-size: 13px; line-height: 1.4; }
.notif-text { font-size: 12px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; opacity: 0.7; }

/* F6: Çalışma planı */
.plan-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.plan-form .form-group { flex: 1; min-width: 130px; margin: 0; }
.plan-form .btn-primary { width: auto; margin: 0; padding: 12px 24px; }

.plan-board {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}
.plan-day {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    background: var(--surface-subtle);
    min-height: 90px;
}
.plan-day.today {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary);
}
.plan-day-name {
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 10px;
    color: var(--color-primary);
}
.plan-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 8px;
}
.plan-item.done { border-color: var(--color-success); }
.plan-item-head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}
.plan-course { font-weight: 600; font-size: 12px; flex: 1; }
.plan-target { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.plan-del { width: 22px; height: 22px; flex-shrink: 0; }
.plan-del i { font-size: 10px; }
.plan-bar {
    height: 5px;
    border-radius: 3px;
    background: var(--surface-raised);
    overflow: hidden;
}
.plan-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--color-secondary), var(--color-primary));
    transition: width 0.4s ease;
}
.plan-empty { color: var(--text-muted); font-size: 12px; text-align: center; opacity: 0.5; }

/* D4: küçük ekran kırılımı (480px altı için ayrı kırılım yoktu) */
@media (max-width: 480px) {
    .timer-display { font-size: 40px; }
    .card { padding: 16px; }
    .range-picker { justify-content: center; }
    .heat-cell { min-width: 7px; }
    th, td { padding: 10px 8px; font-size: 12px; }
    .chart-box, .chart-box.tall { height: 220px; }
    .ai-chat-card { height: 480px; }
    .chat-row { max-width: 95%; }
}
