/* ==========================================================================
   MatSim K12 - Temel Tasarım Sistemi ve Değişkenler
   ========================================================================== */
:root {
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-secondary: #475569;
    --color-secondary-hover: #334155;
    --color-success: #16a34a;
    --color-danger: #dc2626;
    --color-warning: #ca8a04;
    --color-info: #0284c7;
    
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #1e293b;
    --bg-sidebar-hover: #334155;
    --bg-sidebar-active: #0f172a;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #f1f5f9;
    
    --border-color: #e2e8f0;
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    --touch-size: 44px;
    --header-height: 44px;
    --sidebar-width: 240px;
}

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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
}

.touch-target {
    min-width: var(--touch-size);
    min-height: var(--touch-size);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* ==========================================================================
   Üst Bar (Topbar)
   ========================================================================== */
.topbar {
    height: var(--header-height);
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0.75rem;
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: var(--shadow-sm);
}

.topbar-left, .topbar-right {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.app-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-left: 0.25rem;
    letter-spacing: -0.02em;
}

.main-container {
    display: flex;
    height: calc(100vh - var(--header-height));
    overflow: hidden;
}

/* ==========================================================================
   Sol Navigasyon (Akordiyon Sidebar)
   ========================================================================== */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

/* STEM Çift Disiplin Geçiş Segmenti */
.discipline-switcher {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    background: #f1f5f9;
    border-radius: 8px;
    margin: 8px 10px 12px 10px;
}

.discipline-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px; /* Dokunmatik hedef standardı */
}

.discipline-btn:hover {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.6);
}

.discipline-btn.active {
    background: #ffffff;
    color: #2563eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sidebar-module-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sidebar-module-list::-webkit-scrollbar { width: 4px; }
.sidebar-module-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.accordion-group {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.accordion-header {
    width: 100%;
    padding: 0.5rem 0.85rem;
    background: transparent;
    color: var(--text-light);
    font-size: 0.825rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 0;
    transition: background-color 0.15s ease;
}

.accordion-header:hover { background-color: var(--bg-sidebar-hover); }

.accordion-header .acc-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.accordion-header .acc-badge {
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #94a3b8;
}

.accordion-header .acc-chevron {
    transition: transform 0.2s ease;
    font-size: 0.75rem;
    opacity: 0.7;
}

.accordion-group.open .accordion-header .acc-chevron {
    transform: rotate(90deg);
}

.accordion-content {
    display: none;
    background-color: rgba(0, 0, 0, 0.15);
    padding: 0.25rem 0;
}

.accordion-group.open .accordion-content { display: block; }

.module-tree-item {
    padding: 0.45rem 0.85rem 0.45rem 1.25rem;
    font-size: 0.825rem;
    color: #cbd5e1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
    white-space: normal;          /* nowrap kaldırıldı: 2 satıra kaymaya izin verir */
    word-break: break-word;       /* Uzun kelimeleri güvenli böler */
    line-height: 1.25;            /* Çok satırlı görünüm için kompakt satır yüksekliği */
    min-height: 38px;             /* Dokunmatik hedef dengesi */
}

.module-tree-item:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

.module-tree-item.active {
    background-color: rgba(37, 99, 235, 0.2);
    border-left-color: var(--color-primary);
    color: #ffffff;
    font-weight: 600;
}

.module-tree-item.planned {
    opacity: 0.55;
    cursor: not-allowed;
}

.item-left {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    overflow: visible;            /* Kesilmeyi engelle */
    white-space: normal;
    flex: 1;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.status-dot.active { background-color: #22c55e; box-shadow: 0 0 6px #22c55e; }
.status-dot.planned { background-color: #64748b; }

/* ==========================================================================
   Sağ Çalışma Alanı (Workspace)
   ========================================================================== */
.workspace {
    flex: 1;
    padding: 0.65rem 1rem;
    overflow-y: auto;
    background-color: var(--bg-main);
    display: flex;
    flex-direction: column;
}

.module-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
    flex-shrink: 0;
}

.module-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    min-width: 0;
}

.module-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.module-badges {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* Sekmeler */
.tabs-nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.4rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-shrink: 0;
}

.tabs-nav::-webkit-scrollbar { display: none; }

.tab-btn {
    flex: 0 0 auto;
    height: 32px;
    padding: 0 0.85rem;
    background-color: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.tab-btn:hover {
    color: var(--color-primary);
    background-color: rgba(37, 99, 235, 0.05);
}

.tab-btn.active {
    color: var(--color-primary);
    background-color: rgba(37, 99, 235, 0.12);
    font-weight: 700;
}

.tabs-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.tab-pane {
    display: none;
    height: 100%;
}

.tab-pane.active {
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   İnteraktif Tuval Alanı
   ========================================================================== */
.canvas-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 0.75rem;
    height: 100%;
    min-height: 0;
}

.canvas-main {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    height: 100%;
    min-height: 0;
}

.canvas-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 280px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.03);
}

#sim-canvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
}

#sim-canvas.cursor-grab {
    cursor: grab;
}

#sim-canvas.cursor-grabbing {
    cursor: grabbing !important;
}

/* Tuval İçi Yüzen Araç Çubuğu (Notebook / Masaüstü) */
.canvas-floating-toolbar {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(6px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 3px 5px;
    box-shadow: var(--shadow-sm);
}

.canvas-floating-toolbar button {
    height: 28px;
    padding: 0 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: var(--radius-sm);
    color: var(--color-secondary);
    background: #f1f5f9;
}

.canvas-floating-toolbar button:hover {
    background: #e2e8f0;
    color: var(--text-main);
}

.zoom-group {
    display: inline-flex;
    align-items: center;
    border-left: 1px solid var(--border-color);
    padding-left: 4px;
    margin-left: 2px;
    gap: 2px;
}

.zoom-group button {
    width: 26px;
    padding: 0;
    justify-content: center;
}

#label-zoom {
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 38px;
    text-align: center;
    color: var(--text-muted);
}

/* Tuval İçi Hedef Şeridi (HUD) & Katlanabilir Pill Modu */
.canvas-hud-challenge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    z-index: 10;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(6px);
    color: #ffffff;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    box-shadow: var(--shadow-md);
    transition: all 0.25s ease;
}

.canvas-hud-challenge.completed {
    background: rgba(22, 163, 74, 0.95);
}

.hud-content {
    display: flex;
    align-items: center;
    min-width: 0;
    overflow: hidden;
}

.hud-title {
    font-weight: 700;
    margin-right: 0.4rem;
    color: #93c5fd;
    white-space: nowrap;
}

.canvas-hud-challenge.completed .hud-title { color: #ffffff; }

#hud-task-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hud-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.hud-toggle-btn {
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.15);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 0.75rem;
    line-height: 1;
    cursor: pointer;
}

/* Küçültülmüş Pill HUD Durumu (Tuvali Kapatmaz) */
.canvas-hud-challenge.minimized {
    left: auto;
    right: 8px;
    bottom: 8px;
    max-width: 170px;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    cursor: pointer;
    background: rgba(15, 23, 42, 0.92);
}

.canvas-hud-challenge.minimized #hud-task-text,
.canvas-hud-challenge.minimized .hud-toggle-btn {
    display: none;
}

.canvas-hud-challenge.minimized .hud-title {
    margin-right: 0.25rem;
}

/* Sağ Kontrol Paneli */
.canvas-sidebar {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
}

.controls-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: normal;
    word-break: break-word;
    gap: 0.5rem;
}

.control-badge {
    background: #e2e8f0;
    padding: 0.1rem 0.45rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--color-primary);
    cursor: pointer;
}

.control-slider {
    width: 100%;
    height: 22px;
    cursor: pointer;
}

.sidebar-action-btn {
    margin-top: 0.6rem;
    flex-shrink: 0;
}

/* ==========================================================================
   Keşif Görevleri Sekmesi
   ========================================================================== */
.challenges-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.challenge-card {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-card);
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.challenge-status-icon {
    font-size: 1.1rem;
    line-height: 1;
    color: var(--text-muted);
}

.challenge-card.completed {
    border-color: #86efac;
    background-color: #f0fdf4;
}

.challenge-card.completed .challenge-status-icon {
    color: var(--color-success);
}

/* ==========================================================================
   Ölçme ve Değerlendirme (Quiz)
   ========================================================================== */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quiz-options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.quiz-option {
    padding: 0.65rem 0.85rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-card);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s;
    min-height: 38px;
    display: flex;
    align-items: center;
}

.quiz-option:hover {
    border-color: var(--color-primary);
    background-color: rgba(37, 99, 235, 0.04);
}

.quiz-option.selected {
    border-color: var(--color-primary);
    background-color: var(--color-primary);
    color: white;
}

.quiz-option.correct {
    border-color: var(--color-success);
    background-color: var(--color-success);
    color: white;
}

.quiz-option.wrong {
    border-color: var(--color-danger);
    background-color: var(--color-danger);
    color: white;
}

.quiz-actions {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
}

.hint-box {
    background-color: #fef9c3;
    border-left: 4px solid var(--color-warning);
    padding: 0.65rem 0.85rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: #854d0e;
    font-size: 0.85rem;
}

.feedback-box {
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.85rem;
}

.feedback-box.success {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.feedback-box.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.score-circle {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background-color: var(--color-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 auto;
    border: 6px solid #bfdbfe;
}

/* ==========================================================================
   Bileşenler
   ========================================================================== */
button {
    border: none;
    background: none;
    font-family: inherit;
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
    transition: background-color 0.15s, transform 0.05s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

button:active { transform: scale(0.98); }

.btn-icon {
    color: var(--text-main);
    width: 34px;
    height: 34px;
    border-radius: 50%;
}

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

.btn-text {
    color: var(--text-main);
    padding: 0 0.65rem;
    height: 34px;
    font-weight: 500;
    gap: 0.35rem;
    font-size: 0.825rem;
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
    padding: 0 1rem;
    height: 34px;
    font-weight: 600;
    gap: 0.35rem;
}
.btn-primary:hover:not(:disabled) { background-color: var(--color-primary-hover); }

.btn-secondary {
    background-color: var(--color-secondary);
    color: white;
    padding: 0 1rem;
    height: 34px;
    font-weight: 600;
    gap: 0.35rem;
}
.btn-secondary:hover:not(:disabled) { background-color: var(--color-secondary-hover); }

.btn-danger {
    background-color: var(--color-danger);
    color: white;
    padding: 0 1rem;
    height: 34px;
    font-weight: 600;
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 9999px;
    font-size: 0.725rem;
    font-weight: 600;
}
.badge-blue { background-color: #dbeafe; color: #1e40af; }
.badge-purple { background-color: #f3e8ff; color: #6b21a8; }
.badge-green { background-color: #dcfce7; color: #166534; }

.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.card h3 {
    margin-bottom: 0.5rem;
    font-size: 1rem;
    color: var(--color-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.35rem;
}

/* Modallar */
.modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal.hidden { display: none; }

.modal-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.modal-content {
    position: relative;
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    width: 90%;
    max-width: 380px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}
.modal-lg { max-width: 720px; }

.modal-header {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h2 { font-size: 1.1rem; color: var(--text-main); }

.btn-close-modal {
    font-size: 1.25rem;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
}

.modal-body { padding: 1rem; overflow-y: auto; }
.modal-footer { padding: 0.85rem 1rem; border-top: 1px solid var(--border-color); }

.form-group { margin-bottom: 0.75rem; }
.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.825rem;
    font-weight: 600;
}

.form-input {
    width: 100%;
    height: 34px;
    padding: 0 0.65rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.hidden { display: none !important; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-lg { font-size: 0.95rem; }
.text-xl { font-size: 1.1rem; }
.leading-relaxed { line-height: 1.5; }
.flex-row { display: flex; gap: 0.5rem; }
.flex-1 { flex: 1; }
.print-only { display: none; }

/* ==========================================================================
   Mobil (9:16 Dikey Ekran - Optimize Split-View ve Kompakt Sliderlar)
   ========================================================================== */
@media (max-width: 768px) {
    :root {
        --touch-size: 44px;
    }

    .topbar { padding: 0 0.5rem; }

    .sidebar {
        position: fixed;
        top: var(--header-height);
        left: 0;
        bottom: 0;
        z-index: 50;
        width: 82%;
        max-width: 310px;
        transform: translateX(-100%);
        box-shadow: 4px 0 16px rgba(0, 0, 0, 0.25);
    }
    .sidebar.open { transform: translateX(0); }

    .workspace {
        padding: 0.4rem 0.5rem;
        height: calc(100vh - var(--header-height));
    }

    .module-header { margin-bottom: 0.25rem; }
    .module-title { font-size: 0.95rem; }

    /* Mobilde Tuval & Kontrol Bölünmesi (Split-View) */
    .canvas-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        gap: 0.4rem;
        height: 100%;
    }

    .canvas-main { flex: 0 0 auto; }

    .canvas-container {
        aspect-ratio: 4 / 3;
        min-height: auto;
        max-height: 40vh;
    }

    /* Mobilde Toolbar Çakışmasını Sıfırlama: Metinler Gizlenir, Sadece İkonlar Kalır */
    .canvas-floating-toolbar {
        top: 5px;
        right: 5px;
        padding: 2px 3px;
        gap: 2px;
        background: rgba(255, 255, 255, 0.95);
    }

    .canvas-floating-toolbar button {
        height: 26px;
        padding: 0 5px;
    }

    .canvas-floating-toolbar button span {
        display: none !important; /* "Gizle" ve "Sıfırla" metinleri mobilde gizlenir */
    }

    .zoom-group {
        padding-left: 2px;
        margin-left: 1px;
        gap: 1px;
    }

    .zoom-group button {
        width: 24px;
        height: 26px;
        font-size: 0.75rem;
    }

    #label-zoom {
        font-size: 0.675rem;
        min-width: 30px;
    }

    .canvas-hud-challenge {
        font-size: 0.725rem;
        padding: 0.25rem 0.5rem;
        bottom: 5px;
        left: 5px;
        right: 5px;
    }

    /* Mobilde Ultra-Kompakt Slider Bölgesi */
    .canvas-sidebar {
        flex: 1;
        overflow-y: auto;
        min-height: 0;
        padding: 0.4rem 0.6rem;
        gap: 0.25rem;
    }

    .canvas-sidebar h3 {
        display: none; /* Mobilde yer kaplayan Parametreler başlığını gizle */
    }

    .controls-list {
        gap: 0.25rem;
    }

    .control-group {
        margin-bottom: 0 !important;
        gap: 0.1rem;
    }

    .control-header {
        font-size: 0.75rem;
    }

    .control-badge {
        font-size: 0.7rem;
        padding: 0 0.35rem;
    }

    .control-slider {
        height: 20px;
        margin: 0;
    }

    .sidebar-action-btn {
        margin-top: 0.3rem;
    }

    .sidebar-action-btn .btn-primary {
        height: 30px;
        font-size: 0.775rem;
    }

    .btn-text span { display: none; }
}

/* ==========================================================================
   A4 Baskı ve Karne Şablonu
   ========================================================================== */
@media print {
    @page { size: A4; margin: 2cm; }
    body { background-color: white; color: black; }
    .no-print, .topbar, .sidebar, .tabs-nav, .canvas-floating-toolbar, .canvas-hud-challenge, .canvas-sidebar, .modal {
        display: none !important;
    }
    .main-container { height: auto; overflow: visible; display: block; }
    .workspace { padding: 0; background-color: white; }
    .print-only { display: block; }
    .print-report-card { font-family: 'Times New Roman', Times, serif; }
    .print-header { text-align: center; border-bottom: 2px solid black; padding-bottom: 1rem; margin-bottom: 1.5rem; }
    .print-header h1 { font-size: 1.4rem; margin-bottom: 0.5rem; }
    .print-student-info { display: flex; justify-content: space-between; font-size: 1rem; }
    .print-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
    .print-table th, .print-table td { border: 1px solid black; padding: 0.6rem; text-align: left; }
    .print-table th { background-color: #f3f4f6 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .canvas-container { border: 1px solid black; box-shadow: none; page-break-inside: avoid; }
}

/* Gelişim Raporu (Dashboard) Yerleşim ve Teşhis Kutuları İyileştirmesi */
#modal-dashboard .modal-content {
    max-width: 680px;
    max-height: 90vh;
}

#modal-dashboard .dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#modal-dashboard .chart-container {
    max-height: 220px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#modal-dashboard #radar-chart {
    max-height: 210px !important;
    max-width: 320px !important;
}

.diagnostic-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem;
}