/* CSS Variables */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --background: #f8fafc;
    --background-warm: #fefefe;
    --surface: #ffffff;
    --surface-hover: #f1f5f9;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --radius-lg: 12px;
    --header-height: 60px;
    --sidebar-width: 280px;
}

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

/* Base */
html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background:
        repeating-linear-gradient(
            90deg,
            rgba(102, 126, 234, 0.08) 0px,
            rgba(102, 126, 234, 0.08) 2px,
            transparent 2px,
            transparent 8px
        ),
        var(--background);
    -webkit-font-smoothing: antialiased;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.logo-image {
    height: 54px;
    width: auto;
    max-width: 200px;
    display: block;
    object-fit: contain;
}

.top-header-logo {
    height: 54px;
    width: auto;
    max-width: 200px;
    display: block;
    object-fit: contain;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn svg {
    width: 18px;
    height: 18px;
}

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

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

.btn-install {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    border: 2px solid transparent;
}

.btn-install:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
}

/* When PWA is ready to install */
.btn-install.ready {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    animation: pulse-install 2s infinite;
}

.btn-install.ready:hover {
    background: linear-gradient(135deg, #16a34a, #15803d);
}

@keyframes pulse-install {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface-hover);
}

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

.btn-large {
    padding: 12px 24px;
    font-size: 1rem;
}

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

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

.icon-btn svg {
    width: 20px;
    height: 20px;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s;
    z-index: 90;
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.book-list {
    padding: 8px;
}

.book-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.book-item:hover {
    background: var(--surface-hover);
}

.book-item.active {
    background: var(--primary);
    color: white;
}

.book-item-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-light);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-item.active .book-item-icon {
    background: rgba(255, 255, 255, 0.2);
}

.book-item-icon svg {
    width: 20px;
    height: 20px;
    color: white;
}

.book-item-info {
    flex: 1;
    min-width: 0;
}

.book-item-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-item-pages {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.book-item.active .book-item-pages {
    color: rgba(255, 255, 255, 0.7);
}

.book-item-actions {
    display: flex;
    gap: 4px;
}

.book-item-actions .icon-btn {
    width: 32px;
    height: 32px;
}

.book-item-actions .icon-btn svg {
    width: 16px;
    height: 16px;
}

.book-item-actions .export-book-btn {
    background: var(--success);
    color: white;
    border-radius: 6px;
}

.book-item-actions .export-book-btn:hover {
    background: #16a34a;
}

.book-item-actions .delete-book-btn {
    color: var(--danger);
}

.book-item-actions .delete-book-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Main Content */
.main-content {
    margin-top: var(--header-height);
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Welcome Screen */
.welcome-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px;
}

.welcome-icon {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.welcome-icon svg {
    width: 60px;
    height: 60px;
    color: white;
}

.welcome-screen h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.welcome-screen p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    max-width: 400px;
}

/* Book Viewer */
.book-viewer {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.viewer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    gap: 16px;
    flex-wrap: wrap;
}

.toolbar-left, .toolbar-center, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-info {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.page-info input {
    width: 50px;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    font-size: 0.875rem;
}

.zoom-level {
    font-size: 0.875rem;
    color: var(--text-secondary);
    min-width: 50px;
    text-align: center;
}

.viewer-container {
    flex: 1;
    /* auto (not hidden): if a tall page slightly overflows the fit, it stays
       reachable via scroll instead of being cropped from the bottom. */
    overflow: auto;
    background: transparent;
    display: flex;
    justify-content: center;
    /* center horizontally, but align to top vertically so tall pages are not
       pushed up and cropped — the fit scale already keeps them inside. */
    align-items: flex-start;
    padding: 0;
}

/* Vertically center the page only when it fits; auto margins keep it centered
   within the flex container without causing top/bottom cropping. */
.viewer-container > * {
    margin: auto;
}

.page-container {
    position: relative;
    box-shadow: var(--shadow-lg);
    background: white;
    flex-shrink: 0;
    overflow: hidden;
}

#pdfCanvas, #pdfCanvas2 {
    display: block;
}

.questions-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

/* Question buttons - separate floating buttons */
.question-buttons {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    pointer-events: auto;
    z-index: 25;
}

.question-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.5),
                0 0 0 1px rgba(255, 255, 255, 0.3);
    color: #f97316;
}

.question-btn:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: scale(1.05);
    color: #ea580c;
}

.question-btn:active {
    transform: scale(0.95);
}

.question-btn svg {
    width: 13px;
    height: 13px;
}

.question-btn.zoom-btn {
    color: #f97316;
}

.question-btn.zoom-btn:hover {
    color: #ea580c;
}

.question-btn.answer-btn {
    color: #f97316;
}

.question-btn.answer-btn:hover {
    color: #ea580c;
}

.question-btn.answer-btn.active {
    color: #dc2626;
}

.question-btn.activity-btn {
    color: #f97316;
}

.question-btn.activity-btn:hover {
    color: #ea580c;
}

.question-btn.solution-btn {
    color: #f97316;
}

.question-btn.solution-btn:hover {
    color: #ea580c;
}

.question-btn.info-btn {
    color: #f97316;
}

.question-btn.info-btn:hover {
    color: #ea580c;
}

/* Question menu popup */
.question-menu {
    position: absolute;
    top: 54px;
    left: 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15),
                0 0 0 1px rgba(0, 0, 0, 0.05);
    padding: 4px;
    z-index: 1000;
    min-width: 130px;
    animation: menuSlideIn 0.15s ease-out;
}

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

.question-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    text-align: left;
}

.question-menu-item:hover {
    background: #fff7ed;
    color: #ea580c;
}

.question-menu-item:active {
    transform: scale(0.98);
}

.question-menu-item svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: #f97316;
}

.question-menu-item:hover svg {
    color: #ea580c;
}

.question-menu-item span {
    flex: 1;
}

/* Hidden bounding box for answer overlay */
.question-box {
    position: absolute;
    border: none;
    background: transparent;
    pointer-events: none;
}

.question-box-header {
    display: none;
}

.question-box-label {
    display: none;
}

.question-box-btn {
    display: none;
}

/* Question index box */
.question-index-box {
    position: absolute;
    border: none;
    background: transparent;
    pointer-events: none;
}

/* Shared info box */
.shared-info-box {
    position: absolute;
    border: none;
    background: transparent;
    pointer-events: none;
}

/* Answer Overlay on Question Box - no border */
.answer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    z-index: 20;
    cursor: pointer;
    pointer-events: auto;
}

.answer-overlay.hidden {
    display: none;
}

/* Question Zoom Modal */
.zoom-modal-content {
    max-width: 95vw;
    max-height: 95vh;
    width: auto;
    height: auto;
}

.zoom-view {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: auto;
    max-height: 80vh;
    padding: 20px;
    background: var(--background);
}

.zoom-view canvas {
    max-width: 100%;
    box-shadow: var(--shadow-lg);
}

/* Answer Crop Modal */
.answer-crop-view {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: auto;
    max-height: 80vh;
    padding: 20px;
    background: var(--background);
}

.answer-crop-view canvas {
    max-width: 100%;
    box-shadow: var(--shadow-lg);
}

/* Area Selection Popup Modal */
.area-select-modal-content {
    max-width: 98vw;
    max-height: 98vh;
    width: auto;
    height: auto;
    min-width: 60vw;
    min-height: 50vh;
}

.area-select-view {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    max-height: 90vh;
    min-height: 45vh;
    padding: 24px;
    background: var(--background);
}

.area-select-view canvas {
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
    max-width: 100%;
    max-height: calc(90vh - 48px);
    width: auto;
    height: auto;
    object-fit: contain;
    image-rendering: auto;
}

/* Questions Panel */
.questions-panel {
    position: fixed;
    top: var(--header-height);
    right: -320px;
    bottom: 0;
    width: 320px;
    background: var(--surface);
    border-left: 1px solid var(--border);
    transition: right 0.3s;
    z-index: 80;
    display: flex;
    flex-direction: column;
}

.questions-panel.open {
    right: 0;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.panel-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.questions-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.question-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.question-item:hover {
    background: var(--surface-hover);
}

.question-num {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
}

.question-info {
    flex: 1;
}

.question-label {
    font-weight: 500;
}

.question-page {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.question-answer-btn {
    padding: 4px 12px;
    font-size: 0.75rem;
}

/* Modals */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-large {
    max-width: 800px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

/* Content Modal (Activities/Solutions) */
.content-modal-content {
    max-width: 700px;
    max-height: 85vh;
}

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

.content-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.content-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    background: var(--background);
    transition: background 0.2s;
}

.content-item-header:hover {
    background: var(--surface-hover);
}

.content-item-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.content-item-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: 0.875rem;
    font-weight: 600;
}

.content-item-toggle {
    transition: transform 0.2s;
}

.content-item.expanded .content-item-toggle {
    transform: rotate(180deg);
}

.content-item-body {
    display: none;
    padding: 16px;
    border-top: 1px solid var(--border);
}

.content-item.expanded .content-item-body {
    display: block;
}

.empty-content {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

/* Nav Badge */
.nav-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bottom-nav-btn {
    position: relative;
}

/* Form Elements */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
}

.form-group input[type="text"],
.form-group input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.file-upload {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.file-upload:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.file-upload.has-file {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.05);
}

.file-upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.file-upload svg {
    width: 32px;
    height: 32px;
    color: var(--text-muted);
}

.file-upload span {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Answer View */
.answer-view {
    display: flex;
    justify-content: center;
    overflow: auto;
    max-height: 60vh;
}

.answer-view canvas {
    max-width: 100%;
    height: auto;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 300;
}

.loading-overlay.hidden {
    display: none;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Toast */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 400;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    background: var(--text);
    color: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

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

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive */
@media (min-width: 768px) {
    .sidebar {
        transform: translateX(0);
    }

    .main-content {
        margin-left: var(--sidebar-width);
    }

    #menuBtn {
        display: none;
    }
}

@media (max-width: 767px) {
    .toolbar-center {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .btn span {
        display: none;
    }

    .header .btn span {
        display: inline;
    }
}

/* ==========================================
   DRAWING TOOLS - Smart Board Style
   ========================================== */

/* Drawing Canvas */
.drawing-canvas {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 15;
    cursor: default;
}

.drawing-canvas.active {
    pointer-events: auto;
    cursor: crosshair;
}

.drawing-canvas.temp-canvas {
    display: none;
    z-index: 16;
}

body.drawing-mode .questions-overlay {
    pointer-events: none;
}

/* Question buttons always active in ALL modes */
body.drawing-mode .question-buttons,
body.move-mode .question-buttons,
body.select-mode .question-buttons,
.question-buttons {
    pointer-events: auto !important;
    z-index: 25 !important;
}

body.drawing-mode .question-btn,
body.move-mode .question-btn,
body.select-mode .question-btn,
.question-btn {
    pointer-events: auto !important;
}

/* Move mode - pan cursor */
body.move-mode .viewer-container {
    cursor: grab;
}

body.move-mode .viewer-container:active {
    cursor: grabbing;
}

/* Select mode - crosshair cursor */
body.select-mode .viewer-container {
    cursor: crosshair;
}

/* Selection rectangle for area select */
.selection-rect {
    position: absolute;
    border: 2px dashed #6366f1;
    background: rgba(99, 102, 241, 0.15);
    pointer-events: none;
    z-index: 50;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5);
}

/* Content overlay interactive elements - above drawing canvas */
#fullContentOverlay #fullOverlayBody button,
#fullContentOverlay #fullOverlayBody a,
#fullContentOverlay #fullOverlayBody input,
#fullContentOverlay #fullOverlayBody select,
#fullContentOverlay #fullOverlayBody textarea,
#fullContentOverlay #fullOverlayBody [draggable="true"],
#fullContentOverlay #fullOverlayBody .draggable,
#fullContentOverlay #fullOverlayBody .clickable,
#fullContentOverlay #fullOverlayBody .matching-item,
#fullContentOverlay #fullOverlayBody .ordering-item,
#fullContentOverlay #fullOverlayBody .dragdrop-item,
#fullContentOverlay #fullOverlayBody .dragdrop-zone,
#fullContentOverlay #fullOverlayBody .sorting-item,
#fullContentOverlay #fullOverlayBody .sort-item-pro,
#fullContentOverlay #fullContentBody button,
#fullContentOverlay #fullContentBody a,
#fullContentOverlay #fullContentBody input,
#fullContentOverlay #fullContentBody select,
#fullContentOverlay #fullContentBody textarea,
#fullContentOverlay #fullContentBody [draggable="true"],
#fullContentOverlay #fullContentBody .draggable,
#fullContentOverlay #fullContentBody .clickable,
#fullContentOverlay #fullContentBody .matching-item,
#fullContentOverlay #fullContentBody .ordering-item,
#fullContentOverlay #fullContentBody .dragdrop-item,
#fullContentOverlay #fullContentBody .dragdrop-zone,
#fullContentOverlay #fullContentBody .sorting-item,
#fullContentOverlay #fullContentBody .sort-item-pro {
    position: relative;
    z-index: 20;
    pointer-events: auto !important;
}

/* Drawing Toolbar - Smart Board Style */
.drawing-toolbar {
    position: fixed;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: #ebe7f5;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 200000;
    width: 180px;
    min-height: 550px;
    height: auto;
    max-height: 90vh;
    overflow-y: visible;
    overflow-x: visible;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    resize: none;
}

/* When toolbar is being dragged, remove transform */
.drawing-toolbar.dragging {
    transition: none;
    transform: none !important;
}

/* Drag Handle */
.toolbar-drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: grab;
    padding: 6px 8px;
    margin: -4px -2px 2px -2px;
    border-radius: 12px 12px 0 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(129, 140, 248, 0.08) 100%);
    transition: all 0.2s;
    user-select: none;
    touch-action: none;
    min-height: 40px;
    flex-shrink: 0;
}

.toolbar-drag-handle:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(129, 140, 248, 0.15) 100%);
}

.toolbar-drag-handle:active {
    cursor: grabbing;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(129, 140, 248, 0.2) 100%);
}

/* Toolbar Logo */
.toolbar-logo {
    max-width: 100%;
    max-height: 35px;
    width: auto;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
    transition: all 0.2s;
    object-fit: contain;
}

.toolbar-drag-handle:hover .toolbar-logo {
    box-shadow: 0 3px 10px rgba(99, 102, 241, 0.4);
    transform: scale(1.05);
}

/* Drag dots */
.drag-dots {
    font-size: 14px;
    color: #9ca3af;
    letter-spacing: -2px;
    opacity: 0.7;
}

.toolbar-drag-handle:hover .drag-dots {
    opacity: 1;
    color: #6366f1;
}

/* 2-Column Grid Layout */
.toolbar-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    flex: 1;
    overflow: visible;
    align-content: start;
}

/* Toolbar Item Buttons */
.toolbar-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 4px;
    border: none;
    background: transparent;
    color: #5a5a7a;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: clamp(0.5rem, 1.5vw, 0.7rem);
    font-weight: 500;
    min-height: 0;
    overflow: visible;
}

.toolbar-item:hover {
    background: rgba(255, 255, 255, 0.6);
}

.toolbar-item.active {
    background: rgba(99, 102, 241, 0.15);
    color: #6366f1;
}

.toolbar-item.active svg {
    filter: drop-shadow(0 0 2px rgba(99, 102, 241, 0.5));
}

.toolbar-item:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.toolbar-item svg {
    width: 45%;
    height: 45%;
    flex-shrink: 0;
}

.toolbar-item span {
    font-size: clamp(0.55rem, 1.2vw, 0.75rem);
    font-weight: 500;
    white-space: nowrap;
    color: #5a5a7a;
    overflow: visible;
    text-overflow: clip;
    max-width: 100%;
}

/* Color Indicator */
.color-indicator {
    width: clamp(12px, 4vw, 20px);
    height: clamp(12px, 4vw, 20px);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

/* Size Indicator */
.size-indicator {
    width: clamp(14px, 4.5vw, 24px);
    height: clamp(14px, 4.5vw, 24px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.size-dot-display {
    width: clamp(5px, 1.5vw, 8px);
    height: clamp(5px, 1.5vw, 8px);
    background: #5a5a7a;
    border-radius: 50%;
}

.toolbar-item.active .size-dot-display {
    background: #6366f1;
}

/* Navigation Bar */
.toolbar-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding-top: 4px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    margin-top: 4px;
    flex-shrink: 0;
}

.nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: clamp(24px, 5vh, 36px);
    padding: 4px;
    border: none;
    background: rgba(255, 255, 255, 0.3);
    color: #5a5a7a;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    z-index: 1;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.6);
}

.nav-btn svg {
    width: 33px;
    height: 33px;
    position: relative;
    z-index: 2;
}

/* Popup Dialogs */
.toolbar-popup {
    position: absolute;
    left: -170px;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    min-width: 150px;
    display: none;
}

.toolbar-popup.active {
    display: block;
}

.popup-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #4a4a6a;
    margin-bottom: 10px;
    text-align: center;
}

/* Color Grid in Popup */
.color-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}

.color-option {
    width: 26px;
    height: 26px;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.color-option:hover {
    transform: scale(1.15);
}

.color-option.active {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.4);
}

/* Size Grid in Popup */
.size-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.size-option {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    border: none;
    background: #f3f4f6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.size-option:hover {
    background: #e5e7eb;
}

.size-option.active {
    background: #6366f1;
}

.size-option.active .size-preview {
    background: white;
}

.size-preview {
    background: #4a4a6a;
    border-radius: 50%;
}

/* Shapes Grid in Popup */
.shapes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.shape-option {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    border: none;
    background: #f3f4f6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: #4a4a6a;
}

.shape-option:hover {
    background: #e5e7eb;
}

.shape-option.active {
    background: #6366f1;
    color: white;
}

.shape-option svg {
    width: 22px;
    height: 22px;
}

/* Responsive Drawing Toolbar */
@media (max-width: 767px) {
    .drawing-toolbar {
        right: 8px;
        top: auto;
        bottom: 16px;
        transform: none;
        width: 150px;
        min-height: 500px;
        height: auto;
        max-height: 85vh;
        overflow-y: visible;
        overflow-x: visible;
        padding: 8px 6px;
        gap: 10px;
        resize: none;
    }

    .toolbar-drag-handle {
        padding: 4px 6px;
        margin: -3px -2px 2px -2px;
        gap: 3px;
        min-height: 35px;
    }

    .toolbar-logo {
        max-height: 30px;
        border-radius: 6px;
    }

    .drag-dots {
        font-size: 11px;
    }

    .toolbar-grid {
        gap: 8px;
        overflow: visible;
    }

    .toolbar-item {
        padding: 6px 3px;
        min-height: 0;
        gap: 3px;
    }

    .toolbar-item svg {
        width: 45%;
        height: 45%;
        max-width: 30px;
        max-height: 30px;
    }

    .toolbar-item span {
        font-size: clamp(0.4rem, 1vw, 0.6rem);
    }

    .toolbar-nav {
        gap: 3px;
        padding-top: 3px;
        margin-top: 3px;
    }

    .nav-btn {
        height: clamp(20px, 4vh, 30px);
        padding: 3px;
    }

    .nav-btn svg {
        width: 27px;
        height: 27px;
    }

    .toolbar-popup {
        left: auto;
        right: 130px;
    }
}

/* ==========================================
   EXPORT BUTTON & VIEW-ONLY MODE
   ========================================== */

/* Export Button */
.btn-export {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: 2px solid transparent;
}

.btn-export:hover {
    background: linear-gradient(135deg, #059669, #047857);
}

/* Automation Button */
.btn-automation {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    border: 2px solid transparent;
}

.btn-automation:hover {
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
}

/* View-only mode - hide admin elements */
body.view-only-mode .admin-only {
    display: none !important;
}

/* In view-only mode, hide delete buttons in book list */
body.view-only-mode .delete-book-btn {
    display: none !important;
}

/* View-only welcome screen message */
.welcome-screen.view-only h2 {
    color: var(--primary);
}

.welcome-screen.view-only p {
    max-width: 500px;
}

/* ==========================================
   STANDALONE VIEWER MODE (Single HTML Export)
   ========================================== */

/* Top Header Bar */
.top-header {
    position: fixed;
    top: 10px;
    left: 16px;
    right: 16px;
    height: 54px;
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(248,250,252,0.98) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px 0 20px;
    z-index: 1001;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    border: 1px solid rgba(102, 126, 234, 0.15);
    overflow: hidden;
}

.top-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    right: 0;
    background: repeating-linear-gradient(
        90deg,
        rgba(102, 126, 234, 0.08) 0px,
        rgba(102, 126, 234, 0.08) 2px,
        transparent 2px,
        transparent 8px
    );
    border-radius: 16px;
}

.top-header::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px 0 0 16px;
}

.top-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.top-header-accent {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-header-accent-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.top-header-accent-icon svg {
    width: 18px;
    height: 18px;
    color: white;
}

.top-header-logo {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.top-header-center {
    display: flex;
    align-items: center;
    gap: 12px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

.top-header-check {
    width: 24px;
    height: 24px;
    color: #667eea;
    flex-shrink: 0;
}

.top-header-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 50vw;
    letter-spacing: -0.01em;
}

.top-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.top-header-close {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.top-header-close:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.45);
}

.top-header-close svg {
    width: 20px;
    height: 20px;
}

/* Standalone mode styling */
body.standalone-mode {
    padding: 0;
    margin: 0;
    overflow: hidden;
    background:
        repeating-linear-gradient(
            90deg,
            rgba(102, 126, 234, 0.08) 0px,
            rgba(102, 126, 234, 0.08) 2px,
            transparent 2px,
            transparent 8px
        ),
        linear-gradient(180deg, #f0ede8 0%, #e8e4de 100%);
}

/* Hide header completely */
body.standalone-mode .header {
    display: none !important;
}

/* Hide sidebar completely */
body.standalone-mode .sidebar {
    display: none !important;
}

/* Main content positioning */
body.standalone-mode .main-content {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 84px;
    margin: 0 !important;
    overflow: hidden;
}

/* Hide welcome screen in standalone */
body.standalone-mode .welcome-screen {
    display: none !important;
}

/* Hide viewer toolbar (page nav is in drawing toolbar) */
body.standalone-mode .viewer-toolbar {
    display: none !important;
}

/* Make book viewer full screen */
body.standalone-mode .book-viewer {
    display: flex !important;
    width: 100%;
    height: 100%;
}

/* Full width viewer container */
body.standalone-mode .viewer-container {
    padding: 2px 0;
    background: transparent;
    width: 100%;
    height: 100%;
    /* auto: if the page is a hair taller than the area, it stays reachable
       instead of being cropped at the bottom. */
    overflow: auto;
    display: flex;
    /* top-align so a slightly-too-tall page is not pushed up and cropped;
       margin:auto on the child still centers it when it fits. */
    align-items: flex-start;
    justify-content: center;
}

body.standalone-mode .viewer-container > * {
    margin: auto;
}

body.standalone-mode .page-container {
    padding: 0;
    flex: 0 0 auto;
    max-width: 100%;
    max-height: 100%;
    overflow: visible;
    background: transparent;
}

/* Hide questions panel */
body.standalone-mode .questions-panel {
    display: none !important;
}

/* Hide all modals except zoom, area select and content modal */
body.standalone-mode .modal:not(#zoomModal):not(#areaSelectModal):not(#contentModal):not(#fullContentModal) {
    display: none !important;
}

/* Content modal should only show when not hidden */
body.standalone-mode #contentModal.hidden {
    display: none !important;
}

body.standalone-mode #contentModal:not(.hidden) {
    display: flex !important;
}

/* ==========================================
   BOTTOM NAVIGATION BAR
   ========================================== */

.bottom-nav {
    position: fixed;
    bottom: 10px;
    left: 16px;
    right: 16px;
    height: 64px;
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(248,250,252,0.98) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(102, 126, 234, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    overflow: hidden;
}

.bottom-nav::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    right: 0;
    background: repeating-linear-gradient(
        90deg,
        rgba(102, 126, 234, 0.08) 0px,
        rgba(102, 126, 234, 0.08) 2px,
        transparent 2px,
        transparent 8px
    );
    border-radius: 16px;
}

/* Bottom nav sections */
.bottom-nav-left,
.bottom-nav-center,
.bottom-nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

/* Bottom nav logo - hidden */
.bottom-nav-logo {
    display: none;
}

.bottom-nav-logo:hover {
    transform: scale(1.1) rotate(2deg);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.35);
}

.bottom-nav-logo svg,
.bottom-nav-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bottom-nav-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    gap: 12px;
}

/* Bottom nav buttons */
.bottom-nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    background: linear-gradient(145deg, #f8fafc 0%, #e2e8f0 100%);
    color: #475569;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.bottom-nav-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.bottom-nav-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.bottom-nav-btn svg {
    width: 20px;
    height: 20px;
}

/* Dual page button in center */
.bottom-nav-btn.dual-page-btn {
    padding: 10px 14px;
    border-radius: 14px;
}

.bottom-nav-btn.dual-page-btn.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* Zoom buttons */
.bottom-nav-btn.zoom-btn {
    padding: 10px 14px;
}

/* Page indicator */
.page-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--primary);
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    box-shadow: var(--shadow);
}

.page-indicator input {
    width: 45px;
    border: none;
    background: rgba(255, 255, 255, 0.25);
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    border-radius: 8px;
    padding: 4px 6px;
}

.page-indicator input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.4);
}

.page-indicator span {
    font-weight: 600;
    font-size: 1rem;
}

/* Go to page button */
.go-to-page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 4px;
}

.go-to-page-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.go-to-page-btn svg {
    width: 18px;
    height: 18px;
}

/* Navigation arrows */
.nav-arrow {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.nav-arrow:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 18px rgba(102, 126, 234, 0.5);
}

.nav-arrow:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.2);
}

.nav-arrow:disabled:hover {
    transform: none;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.2);
}

.nav-arrow svg {
    width: 24px;
    height: 24px;
}

/* Divider - hidden now */
.bottom-nav-divider {
    display: none;
}

/* Whiteboard mode */
body.whiteboard-mode .page-container canvas#pdfCanvas {
    display: none !important;
}

body.whiteboard-mode .page-container {
    background: white;
    min-height: calc(100vh - 120px);
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    position: relative;
}

body.whiteboard-mode .questions-overlay {
    display: none !important;
}

body.whiteboard-mode .page-container canvas#drawingCanvas {
    display: block !important;
    position: relative !important;
    background: white !important;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Ensure drawing toolbar is always visible above all overlays */
.drawing-toolbar {
    z-index: 999999 !important;
}

/* Show drawing toolbar in whiteboard mode */
body.whiteboard-mode .drawing-toolbar {
    display: flex !important;
}

/* Dual page mode */
body.dual-page-mode .viewer-container {
    flex-direction: row;
    gap: 10px;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: nowrap;
}

body.dual-page-mode .page-container {
    max-width: none;
    flex-shrink: 0;
}

/* Second page container - always hidden (dual page uses single canvas) */
.page-container.second-page {
    display: none !important;
}


/* Contents panel (sidebar) */
.contents-panel {
    position: fixed;
    left: -300px;
    top: 0;
    bottom: 70px;
    width: 300px;
    background: white;
    border-right: 1px solid #e2e8f0;
    z-index: 999;
    transition: left 0.3s;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
}

.contents-panel.open {
    left: 0;
}

.contents-panel-header {
    padding: 16px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.contents-panel-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.contents-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.contents-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.contents-item:hover {
    background: #f1f5f9;
}

.contents-item.active {
    background: rgba(99, 102, 241, 0.1);
}

.contents-item-num {
    width: 32px;
    height: 32px;
    background: #6366f1;
    color: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
}

.contents-item-text {
    font-size: 0.875rem;
    color: #1e293b;
}

/* Responsive bottom nav */
@media (max-width: 900px) {
    .bottom-nav {
        height: 65px;
        padding: 0 12px;
    }

    .bottom-nav-logo {
        width: 36px;
        height: 36px;
        border-radius: 8px;
    }

    .logo-image,
    .top-header-logo {
        height: 44px;
        max-width: 160px;
    }

    .bottom-nav-btn span {
        display: none;
    }

    .bottom-nav-btn {
        padding: 10px 12px;
    }

    .bottom-nav-btn svg {
        width: 20px;
        height: 20px;
    }

    .page-indicator {
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    .page-indicator input {
        width: 40px;
    }

    .nav-arrow {
        width: 42px;
        height: 42px;
    }

    .nav-arrow svg {
        width: 20px;
        height: 20px;
    }

    body.standalone-mode .main-content {
        top: 45px;
        bottom: 65px;
    }

    .top-header {
        height: 45px;
        padding: 0 12px;
    }

    .top-header-logo {
        width: 32px;
        height: 32px;
    }

    .top-header-title {
        font-size: 0.9rem;
        max-width: 45vw;
    }

    .top-header-check {
        width: 18px;
        height: 18px;
    }

    .top-header-close {
        width: 32px;
        height: 32px;
    }

    body.standalone-mode {
        padding-top: 45px;
    }

    body.standalone-mode .book-viewer {
        height: calc(100vh - 45px);
    }
}

@media (max-width: 600px) {
    .bottom-nav {
        height: 60px;
        padding: 0 8px;
    }

    .bottom-nav-logo {
        width: 32px;
        height: 32px;
        border-radius: 6px;
    }

    .logo-image,
    .top-header-logo {
        height: 36px;
        max-width: 140px;
    }

    .bottom-nav-left {
        gap: 4px;
    }

    .bottom-nav-center {
        gap: 6px;
    }

    .bottom-nav-right {
        gap: 4px;
    }

    .bottom-nav-btn {
        padding: 8px 10px;
    }

    .bottom-nav-btn svg {
        width: 18px;
        height: 18px;
    }

    .page-indicator {
        padding: 6px 10px;
        font-size: 0.8rem;
        gap: 6px;
    }

    .page-indicator input {
        width: 35px;
        font-size: 0.85rem;
        padding: 2px 4px;
    }

    .go-to-page-btn {
        width: 26px;
        height: 26px;
    }

    .go-to-page-btn svg {
        width: 14px;
        height: 14px;
    }

    .nav-arrow {
        width: 38px;
        height: 38px;
    }

    .nav-arrow svg {
        width: 18px;
        height: 18px;
    }

    body.standalone-mode .main-content {
        top: 42px;
        bottom: 60px;
    }

    /* Dual page on mobile - stack vertically */
    body.dual-page-mode .viewer-container {
        flex-direction: column;
        gap: 10px;
    }

    body.dual-page-mode .page-container {
        max-width: 100%;
    }

    .top-header {
        height: 42px;
        padding: 0 10px;
    }

    .top-header-logo {
        width: 28px;
        height: 28px;
        border-radius: 6px;
    }

    .top-header-title {
        font-size: 0.8rem;
        max-width: 40vw;
    }

    .top-header-check {
        width: 16px;
        height: 16px;
    }

    .top-header-center {
        gap: 6px;
    }

    .top-header-close {
        width: 28px;
        height: 28px;
    }

    .top-header-close svg {
        width: 16px;
        height: 16px;
    }

    body.standalone-mode {
        padding-top: 42px;
    }

    body.standalone-mode .book-viewer {
        height: calc(100vh - 42px);
    }
}

/* ==========================================
   FULL SCREEN QUESTION ZOOM VIEW
   ========================================== */

.question-zoom-view {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    display: flex;
    flex-direction: column;
}

.question-zoom-view.hidden {
    display: none;
}

.question-zoom-view.showing-answer {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

/* Top Header - Taller to fit answer button */
.question-zoom-top-header {
    min-height: 90px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    box-shadow: 0 2px 10px rgba(34, 197, 94, 0.3);
    flex-shrink: 0;
}

.question-zoom-view.showing-answer .question-zoom-top-header {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.3);
}

.question-zoom-top-left,
.question-zoom-top-right {
    display: flex;
    align-items: center;
    align-self: flex-start;
    padding-top: 4px;
}

.question-zoom-top-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.question-zoom-title-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.question-zoom-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.question-zoom-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.question-zoom-check {
    width: 22px;
    height: 22px;
    color: white;
    flex-shrink: 0;
}

.question-zoom-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
}

.question-zoom-close-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.question-zoom-close-btn:hover {
    background: #ef4444;
    transform: scale(1.05);
}

.question-zoom-close-btn svg {
    width: 20px;
    height: 20px;
}


/* Body */
.question-zoom-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
}

.question-zoom-container {
    position: relative;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    padding: 20px;
    max-width: 95vw;
    max-height: calc(100vh - 140px);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.question-zoom-container canvas {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 200px);
    width: auto;
    height: auto;
    object-fit: contain;
}

.question-zoom-drawing-canvas {
    position: absolute;
    top: 20px;
    left: 20px;
    pointer-events: auto;
    touch-action: none;
}

/* Answer button on zoom image - like main page */
.question-zoom-img-answer-btn {
    position: absolute;
    top: 25px;
    left: 25px;
    z-index: 20;
    width: 24px;
    height: 24px;
    pointer-events: auto;
}

.question-zoom-img-answer-btn svg {
    width: 14px;
    height: 14px;
}

.question-zoom-img-answer-btn.hidden {
    display: none !important;
}

/* Responsive styles */
@media (max-width: 768px) {
    .question-zoom-top-header {
        min-height: 80px;
        padding: 10px 12px;
    }

    .question-zoom-logo {
        width: 32px;
        height: 32px;
    }

    .question-zoom-check {
        width: 18px;
        height: 18px;
    }

    .question-zoom-title {
        font-size: 1rem;
    }

    .question-zoom-title-group {
        gap: 6px;
    }

    .question-zoom-answer-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .question-zoom-answer-btn svg {
        width: 16px;
        height: 16px;
    }

    .question-zoom-close-btn {
        width: 32px;
        height: 32px;
    }

    .question-zoom-close-btn svg {
        width: 18px;
        height: 18px;
    }

    .question-zoom-body {
        padding: 12px;
    }

    .question-zoom-container {
        padding: 12px;
        border-radius: 12px;
        max-height: calc(100vh - 110px);
    }

    .question-zoom-drawing-canvas {
        top: 12px;
        left: 12px;
    }
}

@media (max-width: 480px) {
    .question-zoom-top-header {
        min-height: 70px;
        padding: 8px 10px;
    }

    .question-zoom-logo {
        width: 28px;
        height: 28px;
    }

    .question-zoom-title-row {
        gap: 6px;
    }

    .question-zoom-title-group {
        gap: 5px;
    }

    .question-zoom-check {
        width: 16px;
        height: 16px;
    }

    .question-zoom-title {
        font-size: 0.9rem;
    }

    .question-zoom-answer-btn {
        padding: 5px 10px;
        font-size: 0.8rem;
        gap: 4px;
    }

    .question-zoom-answer-btn svg {
        width: 14px;
        height: 14px;
    }

    .question-zoom-close-btn {
        width: 28px;
        height: 28px;
    }

    .question-zoom-body {
        padding: 8px;
    }

    .question-zoom-container {
        padding: 8px;
        max-height: calc(100vh - 95px);
    }

    .question-zoom-drawing-canvas {
        top: 8px;
        left: 8px;
    }
}

/* Question Zoom Bottom Navigation */
.question-zoom-bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: linear-gradient(to bottom, #fefdfb, #f5f3ef);
    border-top: 3px solid #22c55e;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 2001;
    box-shadow: 0 -6px 25px rgba(34, 197, 94, 0.15);
}

.question-zoom-view.showing-answer .question-zoom-bottom-nav {
    border-top-color: #f59e0b;
    box-shadow: 0 -6px 25px rgba(245, 158, 11, 0.15);
}

.question-zoom-bottom-left,
.question-zoom-bottom-center,
.question-zoom-bottom-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.question-zoom-bottom-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.zoom-level-display {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1a1a2e;
    min-width: 50px;
    text-align: center;
    padding: 0 8px;
}

/* Adjust body for bottom nav */
.question-zoom-view .question-zoom-body {
    padding-bottom: 80px;
}

.question-zoom-view .question-zoom-container {
    max-height: calc(100vh - 180px);
}

.question-zoom-view .question-zoom-container canvas {
    max-height: calc(100vh - 220px);
}

@media (max-width: 768px) {
    .question-zoom-bottom-nav {
        height: 60px;
        padding: 0 12px;
    }

    .question-zoom-view .question-zoom-body {
        padding-bottom: 70px;
    }

    .question-zoom-view .question-zoom-container {
        max-height: calc(100vh - 160px);
    }

    .question-zoom-view .question-zoom-container canvas {
        max-height: calc(100vh - 200px);
    }
}

@media (max-width: 480px) {
    .question-zoom-bottom-nav {
        height: 55px;
        padding: 0 10px;
    }

    .question-zoom-view .question-zoom-body {
        padding-bottom: 65px;
    }

    .question-zoom-view .question-zoom-container {
        max-height: calc(100vh - 140px);
    }

    .question-zoom-view .question-zoom-container canvas {
        max-height: calc(100vh - 180px);
    }

    .question-zoom-bottom-nav .bottom-nav-btn span {
        display: none;
    }
}

/* ========================================
   Gemini Content Modal
   ======================================== */

.gemini-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.gemini-modal.hidden {
    display: none;
}

.gemini-modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.gemini-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px 16px 0 0;
}

.gemini-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
}

.gemini-modal-title svg {
    width: 28px;
    height: 28px;
    stroke: white;
}

.gemini-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.gemini-modal-close svg {
    width: 20px;
    height: 20px;
    stroke: white;
}

.gemini-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    min-height: 300px;
}

/* Loading state */
.gemini-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 250px;
    gap: 20px;
}

.gemini-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.gemini-loading p {
    color: var(--text-light);
    font-size: 1rem;
}

.gemini-loading.hidden {
    display: none;
}

/* Content */
.gemini-content {
    line-height: 1.7;
    color: var(--text);
}

.gemini-content.hidden {
    display: none;
}

.gemini-content h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 24px 0 16px;
    color: #1e293b;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 8px;
}

.gemini-content h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 20px 0 12px;
    color: #334155;
}

.gemini-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 16px 0 8px;
    color: #475569;
}

.gemini-content p {
    margin: 12px 0;
}

.gemini-content ul, .gemini-content ol {
    margin: 12px 0;
    padding-left: 24px;
}

.gemini-content li {
    margin: 8px 0;
}

.gemini-content strong {
    color: #1e293b;
}

.gemini-content code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #7c3aed;
}

.gemini-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 16px 0;
}

.gemini-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* Error state */
.gemini-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
    color: var(--danger);
}

.gemini-error svg {
    width: 48px;
    height: 48px;
    stroke: var(--danger);
    margin-bottom: 16px;
}

.gemini-error .error-message {
    background: #fef2f2;
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 12px;
    font-size: 0.9rem;
}

/* Footer */
.gemini-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: #f8fafc;
    border-radius: 0 0 16px 16px;
}

.gemini-modal-footer .btn {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gemini-modal-footer .btn svg {
    width: 18px;
    height: 18px;
}

/* Responsive */
@media (max-width: 768px) {
    .gemini-modal {
        padding: 10px;
    }

    .gemini-modal-content {
        max-height: 95vh;
        border-radius: 12px;
    }

    .gemini-modal-header {
        padding: 16px 20px;
        border-radius: 12px 12px 0 0;
    }

    .gemini-modal-title {
        font-size: 1.1rem;
    }

    .gemini-modal-body {
        padding: 16px;
    }

    .gemini-modal-footer {
        padding: 12px 16px;
        border-radius: 0 0 12px 12px;
        flex-wrap: wrap;
    }

    .gemini-modal-footer .btn {
        flex: 1;
        justify-content: center;
    }
}

/* Gemini Batch Modal Styles */
.gemini-modal-batch {
    max-width: 900px;
    max-height: 90vh;
}

.gemini-progress {
    padding: 20px;
    text-align: center;
}

.gemini-progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.gemini-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #6366f1);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.gemini-progress p {
    color: #666;
    font-size: 14px;
    margin: 0;
}

.gemini-progress.hidden {
    display: none;
}

/* Gemini Tabs */
.gemini-tabs {
    border-bottom: 1px solid #e0e0e0;
    padding: 0 16px;
    background: #f8f9fa;
}

.gemini-tabs.hidden {
    display: none;
}

.gemini-tab-buttons {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 0;
    scrollbar-width: thin;
}

.gemini-tab-buttons::-webkit-scrollbar {
    height: 4px;
}

.gemini-tab-buttons::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

.gemini-tab-btn {
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s ease;
}

.gemini-tab-btn:hover {
    color: #333;
    background: rgba(99, 102, 241, 0.05);
}

.gemini-tab-btn.active {
    color: #6366f1;
    border-bottom-color: #6366f1;
    background: white;
}

.gemini-tab-btn.loading {
    color: #999;
}

.gemini-tab-btn.loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    border: 2px solid #ccc;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.gemini-tab-btn.error {
    color: #ef4444;
}

.gemini-tab-btn.success {
    color: #22c55e;
}

/* Tab content panels */
.gemini-tab-panel {
    display: none;
}

.gemini-tab-panel.active {
    display: block;
}

/* Batch content container */
.gemini-batch-content {
    padding: 16px;
}

.gemini-question-result {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e0e0e0;
}

.gemini-question-result:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.gemini-question-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
}

.gemini-question-number {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.gemini-question-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

@media (max-width: 768px) {
    .gemini-modal-batch {
        max-width: 100%;
        margin: 0;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .gemini-tab-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* ==========================================
   INTERACTIVE ACTIVITIES STYLES
   ========================================== */

/* Activity Block Container */
.activity-block {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

.activity-title {
    font-size: 20px;
    font-weight: 700;
    color: #6366f1;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 10px;
}

.activity-title::before {
    content: "📚";
    font-size: 24px;
}

.activity-instruction {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e9ecef 100%);
    border-radius: 8px;
    border-left: 4px solid #6366f1;
}

/* ==========================================
   MATCHING ACTIVITY (Eşleştirme)
   ========================================== */
.matching-activity {
    margin-bottom: 24px;
}

.matching-columns {
    display: flex;
    gap: 40px;
    justify-content: center;
    flex-wrap: wrap;
}

.matching-left,
.matching-right {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 200px;
}

.matching-item {
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
}

.matching-item.left-item {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.matching-item.left-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.matching-item.right-item {
    background: #f8f9fa;
    border: 2px dashed #d1d5db;
    color: #374151;
}

.matching-item.right-item:hover {
    border-color: #6366f1;
    background: #f3f4ff;
}

.matching-item.right-item.drag-over {
    border-color: #22c55e;
    background: #f0fdf4;
    transform: scale(1.05);
}

.matching-item.left-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.matching-item.matched {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    border: none;
}

.matching-item.matched.correct {
    animation: pulse-correct 0.5s ease;
}

.matching-item.matched.incorrect {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* ==========================================
   TRUE/FALSE ACTIVITY (Doğru/Yanlış)
   ========================================== */
.truefalse-activity {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.truefalse-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    flex-wrap: wrap;
}

.truefalse-item.correct {
    background: #f0fdf4;
    border-color: #22c55e;
}

.truefalse-item.incorrect {
    background: #fef2f2;
    border-color: #ef4444;
}

.truefalse-text {
    flex: 1;
    font-size: 15px;
    color: #374151;
    min-width: 200px;
}

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

.tf-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.tf-btn svg {
    width: 18px;
    height: 18px;
}

.tf-btn.tf-true {
    color: #22c55e;
}

.tf-btn.tf-true:hover,
.tf-btn.tf-true.selected {
    background: #22c55e;
    border-color: #22c55e;
    color: white;
}

.tf-btn.tf-false {
    color: #ef4444;
}

.tf-btn.tf-false:hover,
.tf-btn.tf-false.selected {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
}

.result-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    border-radius: 50%;
}

.truefalse-item.correct .result-icon {
    background: #22c55e;
    color: white;
}

.truefalse-item.incorrect .result-icon {
    background: #ef4444;
    color: white;
}

/* ==========================================
   FILL IN THE BLANK (Boşluk Doldurma)
   ========================================== */
.fillblank-activity {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.fillblank-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    flex-wrap: wrap;
}

.fillblank-item.correct {
    background: #f0fdf4;
    border-color: #22c55e;
}

.fillblank-item.incorrect {
    background: #fef2f2;
    border-color: #ef4444;
}

.fillblank-number {
    font-weight: 700;
    color: #6366f1;
    font-size: 16px;
    min-width: 30px;
}

.fillblank-text {
    flex: 1;
    font-size: 15px;
    color: #374151;
    line-height: 2;
}

.fillblank-input {
    display: inline-block;
    width: 100px;
    padding: 8px 14px;
    border: 2px solid #6366f1;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    background: white;
    color: #374151;
    transition: all 0.3s ease;
    margin: 0 4px;
}

.fillblank-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    border-color: #4f46e5;
}

.fillblank-input.correct {
    border-color: #22c55e;
    background: #f0fdf4;
    color: #22c55e;
}

.fillblank-input.incorrect {
    border-color: #ef4444;
    background: #fef2f2;
    color: #ef4444;
}

/* ==========================================
   MULTIPLE CHOICE (Çoktan Seçmeli)
   ========================================== */
.multiplechoice-activity {
    margin-bottom: 24px;
}

.mc-question {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.mc-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mc-option {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.mc-option:hover {
    border-color: #6366f1;
    background: #f5f3ff;
    transform: translateX(4px);
}

.mc-option.selected {
    border-color: #6366f1;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.mc-option.correct {
    border-color: #22c55e;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
}

.mc-option.incorrect {
    border-color: #ef4444;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.mc-option.show-correct {
    border-color: #22c55e;
    background: #f0fdf4;
    color: #22c55e;
}

/* ==========================================
   ORDERING ACTIVITY (Sıralama)
   ========================================== */
.ordering-activity {
    margin-bottom: 24px;
}

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

.ordering-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    cursor: grab;
    transition: all 0.3s ease;
    user-select: none;
}

.ordering-item:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.ordering-item.dragging {
    opacity: 0.5;
    transform: scale(0.98);
    background: #f3f4ff;
}

.ordering-item.drag-over {
    border-color: #22c55e;
    background: #f0fdf4;
    transform: scale(1.02);
}

.ordering-item.correct {
    border-color: #22c55e;
    background: #f0fdf4;
}

.ordering-item.incorrect {
    border-color: #ef4444;
    background: #fef2f2;
}

.drag-handle {
    font-size: 20px;
    color: #9ca3af;
    letter-spacing: 2px;
    cursor: grab;
    padding: 4px 8px;
    border-radius: 4px;
    background: #f3f4f6;
}

.drag-handle:hover {
    background: #e5e7eb;
    color: #6366f1;
}

.ordering-text {
    flex: 1;
    color: #374151;
    font-weight: 500;
}

/* ==========================================
   TEXT ACTIVITY (Fallback Text Display)
   ========================================== */
.text-activity {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    margin-bottom: 16px;
}

.text-activity p {
    color: #374151;
    font-size: 15px;
    line-height: 1.7;
    margin: 0;
}

/* Activity Error Message */
.activity-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 16px 20px;
    color: #b91c1c;
    font-size: 14px;
    text-align: center;
}

/* ==========================================
   DRAG & DROP CATEGORY (Kategoriye Sürükle)
   ========================================== */
.dragdrop-activity {
    margin-bottom: 24px;
}

.dragdrop-pool {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 20px;
    min-height: 80px;
    border: 2px dashed #d1d5db;
}

.dragdrop-item {
    padding: 12px 20px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: grab;
    transition: all 0.3s ease;
    user-select: none;
    box-shadow: 0 3px 10px rgba(99, 102, 241, 0.3);
}

.dragdrop-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
}

.dragdrop-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.dragdrop-item.correct {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.dragdrop-item.incorrect {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.dragdrop-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.dragdrop-zone {
    background: white;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 16px;
    min-height: 150px;
    transition: all 0.3s ease;
}

.dragdrop-zone.drag-over {
    border-color: #6366f1;
    background: #f5f3ff;
    transform: scale(1.02);
}

.zone-title {
    font-weight: 700;
    font-size: 16px;
    color: #6366f1;
    text-align: center;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 2px solid #e9ecef;
}

.zone-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.zone-items .dragdrop-item {
    width: 100%;
    text-align: center;
}

/* ==========================================
   CHECK ANSWERS BUTTON
   ========================================== */
.check-answers-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 32px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
    margin-top: 24px;
}

.check-answers-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

.check-answers-btn:active {
    transform: translateY(0);
}

.check-answers-btn svg {
    width: 24px;
    height: 24px;
}

/* Score Display */
.score-display {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    border-radius: 12px;
    margin-top: 20px;
}

.score-text {
    font-size: 24px;
    font-weight: 700;
    color: #6366f1;
}

.score-percentage {
    font-size: 16px;
    color: #64748b;
    margin-top: 8px;
}

/* ==========================================
   ANIMATIONS
   ========================================== */
@keyframes pulse-correct {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shake-incorrect {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ==========================================
   RESPONSIVE - Interactive Activities
   ========================================== */
@media (max-width: 768px) {
    .activity-block {
        padding: 16px;
        margin-bottom: 16px;
    }

    .activity-title {
        font-size: 18px;
    }

    .activity-instruction {
        font-size: 14px;
        padding: 10px 14px;
    }

    .matching-columns {
        flex-direction: column;
        gap: 20px;
    }

    .matching-left,
    .matching-right {
        width: 100%;
    }

    .truefalse-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .truefalse-buttons {
        width: 100%;
        justify-content: center;
    }

    .fillblank-input {
        width: 80px;
        padding: 6px 10px;
    }

    .mc-option {
        padding: 14px 16px;
        font-size: 14px;
    }

    .ordering-item {
        padding: 12px 14px;
        font-size: 14px;
    }

    .dragdrop-pool {
        padding: 16px;
    }

    .dragdrop-item {
        padding: 10px 16px;
        font-size: 13px;
    }

    .dragdrop-categories {
        grid-template-columns: 1fr;
    }

    .check-answers-btn {
        font-size: 16px;
        padding: 14px 24px;
    }
}

/* ==========================================
   SOLUTION CARDS STYLES
   ========================================== */

.solution-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 8px 0;
}

.solution-card {
    display: flex;
    gap: 16px;
    padding: 20px;
    border-radius: 16px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.solution-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.solution-card-icon {
    font-size: 32px;
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 12px;
}

.solution-card-content {
    flex: 1;
}

.solution-card-content h3 {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.solution-card-content p {
    font-size: 15px;
    color: #374151;
    line-height: 1.6;
    margin: 0;
}

/* Summary Card */
.summary-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #f1f5f9 100%);
    border-color: #e2e8f0;
}

.summary-card .solution-card-icon {
    background: white;
}

/* Answer Card - Prominent */
.answer-card {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 2px solid #10b981;
    order: -1;
}

.answer-card .solution-card-icon {
    background: #10b981;
    color: white;
    font-size: 28px;
}

.answer-card .solution-card-content h3 {
    color: #059669;
}

.answer-value {
    font-size: 28px;
    font-weight: 700;
    color: #047857;
    margin-bottom: 8px;
}

.answer-detail {
    font-size: 14px;
    color: #065f46;
    font-style: italic;
}

/* Steps Title */
.solution-steps-title {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin: 24px 0 16px 0;
}

/* ==========================================
   MATH TOOLS STYLES
   ========================================== */

/* Math Tool Modal (Calculator) */
.math-tool-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 300000;
}

.calculator-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 20px;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.math-tool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 2px solid #e2e8f0;
    user-select: none;
}

.math-tool-header span {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
}

.math-tool-close {
    background: #fee2e2;
    color: #991b1b;
    border: none;
    border-radius: 6px;
    width: 30px;
    height: 30px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.math-tool-close:hover {
    background: #fecaca;
}

.calculator-display {
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    text-align: right;
    font-size: 24px;
    font-weight: 600;
    color: #1e293b;
    min-height: 50px;
    font-family: 'Courier New', monospace;
}

.calculator-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.calculator-buttons button {
    padding: 16px;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    background: #f8fafc;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.calculator-buttons button:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.calculator-buttons button:active {
    transform: translateY(0);
}

.calculator-buttons button[onclick*="calcClear"],
.calculator-buttons button[onclick*="calcDelete"] {
    background: #fef3c7;
    color: #92400e;
}

.calculator-buttons button[onclick*="calcClear"]:hover,
.calculator-buttons button[onclick*="calcDelete"]:hover {
    background: #fde68a;
}

.calculator-buttons button[onclick*="calcAppend('/'"],
.calculator-buttons button[onclick*="calcAppend('*')"],
.calculator-buttons button[onclick*="calcAppend('-')"],
.calculator-buttons button[onclick*="calcAppend('+')"] {
    background: #dbeafe;
    color: #1e40af;
}

.calculator-buttons button[onclick*="calcAppend('/']:hover,
.calculator-buttons button[onclick*="calcAppend('*')":hover,
.calculator-buttons button[onclick*="calcAppend('-')":hover,
.calculator-buttons button[onclick*="calcAppend('+')":hover {
    background: #bfdbfe;
}

.calculator-buttons button[onclick*="calcEquals"] {
    background: #10b981;
    color: white;
    grid-column: span 1;
    grid-row: span 2;
}

.calculator-buttons button[onclick*="calcEquals"]:hover {
    background: #059669;
}

/* Protractor Tool Overlay */
.tool-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    pointer-events: none;
}

.tool-overlay > * {
    pointer-events: auto;
}

.protractor-tool {
    position: absolute;
    cursor: move;
    user-select: none;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    padding: 10px;
    transition: transform 0.3s ease;
}

.protractor-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #fee2e2;
    color: #991b1b;
    border: none;
    border-radius: 6px;
    width: 30px;
    height: 30px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.protractor-close:hover {
    background: #fecaca;
}

.protractor-rotate-controls {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.protractor-rotate-controls button {
    background: #dbeafe;
    color: #1e40af;
    border: none;
    border-radius: 6px;
    width: 40px;
    height: 40px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.protractor-rotate-controls button:hover {
    background: #bfdbfe;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.protractor-rotate-controls button:active {
    transform: translateY(0);
}

.steps-icon {
    font-size: 24px;
}

/* Steps Container */
.solution-steps {
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
    padding-left: 20px;
    margin-top: 20px;
    margin-bottom: 24px;
}

.solution-steps::before {
    content: '';
    position: absolute;
    left: 24px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, #6366f1, #8b5cf6);
    border-radius: 3px;
}

/* Step Card */
.step-card {
    background: #ffffff;
    border-left: 4px solid #6366f1;
    position: relative;
    margin-left: 20px;
    padding: 20px 24px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    border: 1px solid #f0f0f0;
}

.step-card::before {
    content: '';
    position: absolute;
    left: -32px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #6366f1;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 2px #6366f1;
}

.step-number {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.step-title {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.step-explanation {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 10px;
}

.step-operation {
    font-family: 'Courier New', monospace;
    font-size: 15px;
    font-weight: 600;
    color: #4f46e5;
    background: #f5f3ff;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.step-result {
    font-size: 15px;
    font-weight: 600;
    color: #059669;
    padding: 8px 12px;
    background: #ecfdf5;
    border-radius: 8px;
    display: inline-block;
}

/* Tip Card */
.tip-card {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #f59e0b;
}

.tip-card .solution-card-icon {
    background: #f59e0b;
    font-size: 28px;
}

.tip-card .solution-card-content h3 {
    color: #b45309;
}

.tip-card .solution-card-content p {
    color: #92400e;
}

/* Explanation Card */
.explanation-card {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #7dd3fc;
    margin-top: 16px;
}

.explanation-card .solution-card-icon {
    background: #0ea5e9;
    color: white;
    font-size: 24px;
}

.explanation-card .solution-card-content h3 {
    color: #0369a1;
}

.explanation-card .solution-card-content p {
    color: #075985;
    line-height: 1.7;
}

/* ==========================================
   RESPONSIVE - Solution Cards
   ========================================== */
@media (max-width: 768px) {
    .solution-card {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
    }

    .solution-card-icon {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .answer-value {
        font-size: 22px;
    }

    .solution-steps {
        padding-left: 10px;
    }

    .solution-steps::before {
        left: 14px;
    }

    .step-card {
        margin-left: 10px;
    }

    .step-card::before {
        left: -22px;
        width: 10px;
        height: 10px;
    }

    .step-number {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }

    .step-title {
        font-size: 15px;
    }

    .step-operation {
        font-size: 14px;
        padding: 8px 12px;
    }
}

/* ==========================================
   BOTTOM PANEL STYLES
   ========================================== */

#bottomPanel,
.bottom-panel {
    position: fixed !important;
    bottom: 10px !important;
    left: 16px !important;
    right: 16px !important;
    height: 320px !important;
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(248,250,252,0.98) 100%) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(102, 126, 234, 0.15) !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    border-radius: 16px !important;
    z-index: 90 !important;
    display: flex !important;
    flex-direction: column !important;
    transition: transform 0.3s ease !important;
    overflow: hidden !important;
}

#bottomPanel::before,
.bottom-panel::before {
    content: '' !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    right: 0 !important;
    background: repeating-linear-gradient(
        90deg,
        rgba(102, 126, 234, 0.08) 0px,
        rgba(102, 126, 234, 0.08) 2px,
        transparent 2px,
        transparent 8px
    ) !important;
    border-radius: 16px !important;
    pointer-events: none !important;
}

.bottom-panel.collapsed {
    transform: translateY(calc(100% - 48px));
}

#bottomPanel .bottom-panel-tabs,
.bottom-panel-tabs {
    display: flex !important;
    background: rgba(255, 255, 255, 0.7) !important;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1) !important;
    border-top: none !important;
    padding: 8px 12px !important;
    flex-shrink: 0 !important;
    gap: 8px !important;
    position: relative !important;
    z-index: 1 !important;
}

#bottomPanel .bottom-tab,
.bottom-tab {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 10px 16px !important;
    border: none !important;
    background: linear-gradient(145deg, #f8fafc 0%, #e2e8f0 100%) !important;
    color: var(--text-secondary) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    border-radius: 10px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    white-space: nowrap !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05) !important;
}

#bottomPanel .bottom-tab:hover,
.bottom-tab:hover {
    color: var(--primary) !important;
    background: linear-gradient(145deg, #eef2ff 0%, #e0e7ff 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2) !important;
}

#bottomPanel .bottom-tab.active,
.bottom-tab.active {
    color: white !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4) !important;
    border-bottom: none !important;
}

.bottom-tab svg {
    flex-shrink: 0;
}

.bottom-panel-content {
    flex: 1;
    overflow: hidden;
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.5);
}

.bottom-tab-content {
    display: none;
    height: 100%;
    overflow-y: auto;
    padding: 16px;
    position: relative;
    z-index: 1;
}

.bottom-tab-content.active {
    display: block;
}

.tab-placeholder {
    display: none;
}

.tab-placeholder svg {
    opacity: 0.5;
}

.tab-placeholder p {
    font-size: 14px;
    max-width: 300px;
}

.toggle-panel-btn {
    position: absolute;
    top: -32px;
    right: 16px;
    width: 64px;
    height: 32px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.toggle-panel-btn:hover {
    background: #f8f9fa;
    color: var(--primary);
}

.bottom-panel.collapsed .toggle-panel-btn svg {
    transform: rotate(180deg);
}

/* Content List in Panel */
.content-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.content-item {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.content-item:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

.content-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #f1f5f9 100%);
    cursor: pointer;
}

.content-item-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--text);
}

.content-item-number {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.content-item-toggle {
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.content-item.expanded .content-item-toggle {
    transform: rotate(180deg);
}

.content-item-body {
    display: none;
    padding: 16px;
    border-top: 1px solid var(--border);
    max-height: 400px;
    overflow-y: auto;
}

.content-item.expanded .content-item-body {
    display: block;
}

/* Badge for count */
.tab-badge {
    background: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 4px;
}

/* Responsive */
@media (max-width: 767px) {
    .bottom-panel {
        left: 16px;
        height: 280px;
    }

    .bottom-tab {
        padding: 8px 12px;
        font-size: 12px;
    }

    .bottom-tab span {
        display: none;
    }

    .bottom-tab svg {
        width: 18px;
        height: 18px;
    }
}

/* ==========================================
   BOTTOM NAV EDITOR (Editör Modu Alt Bar)
   ========================================== */

.bottom-nav-editor {
    position: fixed;
    bottom: 10px;
    left: 16px;
    right: 16px;
    height: 64px;
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(248,250,252,0.98) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(102, 126, 234, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 0 20px;
    z-index: 999;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    overflow: hidden;
}

.bottom-nav-editor::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    right: 0;
    background: repeating-linear-gradient(
        90deg,
        rgba(102, 126, 234, 0.08) 0px,
        rgba(102, 126, 234, 0.08) 2px,
        transparent 2px,
        transparent 8px
    );
    border-radius: 16px;
}

.bottom-nav-editor.hidden {
    display: none;
}

.bottom-nav-editor-btn {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(145deg, #f8fafc 0%, #e2e8f0 100%);
    color: #475569;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.bottom-nav-editor-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.bottom-nav-editor-btn svg {
    width: 20px;
    height: 20px;
}

/* ==========================================
   CONTENT MODAL - LARGE (Büyük Modal)
   ========================================== */

.content-modal-content-large {
    max-width: 1200px;
    width: 95vw;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.content-modal-content-large .modal-body {
    overflow-y: auto;
    padding: 20px;
}

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

/* LIST ITEMS (Clickable) */
.content-list-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: pointer;
}

.content-list-item:hover {
    border-color: #6366f1;
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
}

.content-list-item-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #6366f1;
    color: white;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.content-list-item-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.content-list-item-title {
    font-weight: 600;
    font-size: 1rem;
    color: #1e293b;
}

.content-list-item-subtitle {
    font-size: 0.875rem;
    color: #64748b;
}

.content-list-item-arrow {
    width: 20px;
    height: 20px;
    color: #94a3b8;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.content-list-item:hover .content-list-item-arrow {
    color: #6366f1;
    transform: translateX(4px);
}

/* FULL CONTENT MODAL (Large popup) */
.full-content-modal {
    max-width: 85vw;
    width: 85vw;
    max-height: 90vh;
    height: auto;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.full-content-modal .modal-body {
    overflow-y: auto;
    padding: 20px;
    flex: 1;
    font-size: 0.95rem;
}

.full-content-modal .question-image {
    width: 100%;
    max-width: 600px;
    margin: 0 auto 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: block;
}

.empty-content {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.empty-content p {
    font-size: 1.1rem;
}

/* Fallback styles for raw content */
.solution-fallback,
.activity-fallback {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
}

.solution-fallback pre,
.activity-fallback pre {
    background: #ffffff;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.6;
    color: #334155;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
    border: 1px solid #e2e8f0;
}

/* Modal improvements for standalone */
body.standalone-mode .modal-content {
    background: #ffffff !important;
}

body.standalone-mode .modal-body {
    background: #f8fafc;
    color: #1e293b;
}

body.standalone-mode .full-content-modal .modal-body {
    background: #ffffff;
}

@media (max-width: 768px) {
    .bottom-nav-editor {
        height: 55px;
        gap: 8px;
        padding: 0 12px;
    }

    .bottom-nav-editor-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .bottom-nav-editor-btn span:first-of-type {
        display: none;
    }

    .content-modal-content-large {
        width: 95vw;
        max-height: 90vh;
    }
}

/* Center Page Button */
.center-page-btn {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    z-index: 10001;
    transition: all 0.3s ease;
    visibility: visible;
    opacity: 1;
}

.center-page-btn:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    background: var(--primary-dark);
}

.center-page-btn:active {
    transform: translateX(-50%) translateY(0);
}

.center-page-btn .center-icon {
    font-size: 20px;
    line-height: 1;
}

.center-page-btn.hidden {
    display: none;
}

@media (max-width: 767px) {
    .center-page-btn {
        bottom: 70px;
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .center-page-btn .center-icon {
        font-size: 18px;
    }
}

/* Page container - only show grab cursor when move tool is active */
.page-container {
    cursor: default;
}

body.move-mode .page-container {
    cursor: grab;
}

body.move-mode .page-container.dragging {
    cursor: grabbing;
}

/* Page Number Button */
.page-number-btn {
    background: white;
    border: 2px solid var(--border);
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 12px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    min-width: 80px;
    justify-content: center;
}

.page-number-btn:hover {
    background: var(--background-secondary);
    border-color: var(--primary);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.page-number-btn:active {
    transform: scale(0.97);
}

.page-number-btn #currentPageDisplay {
    color: var(--primary);
    font-weight: 700;
}

/* Go To Page Modal */
.goto-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.goto-modal.hidden {
    display: none;
}

.goto-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.goto-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.goto-modal-content h3 {
    margin: 0 0 20px 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
}

.goto-modal-content input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1.1rem;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

.goto-modal-content input:focus {
    outline: none;
    border-color: var(--primary);
}

.goto-modal-buttons {
    display: flex;
    gap: 12px;
}

.goto-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.goto-btn-cancel {
    background: var(--background-secondary);
    color: var(--text);
}

.goto-btn-cancel:hover {
    background: var(--border);
}

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

.goto-btn-confirm:hover {
    background: var(--primary-dark);
}

.goto-btn:active {
    transform: scale(0.95);
}

/* ===== Video Solution Modal ===== */
.video-solution-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.video-solution-modal.hidden {
    display: none;
}

.video-solution-modal-content {
    background: var(--background);
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.video-solution-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.video-solution-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.video-solution-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-solution-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.video-solution-close svg {
    width: 20px;
    height: 20px;
    stroke: white;
}

.video-solution-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.video-solution-body video {
    width: 100%;
    max-height: 600px;
    border-radius: 12px;
    background: #000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.video-solution-info {
    display: flex;
    gap: 16px;
    padding: 12px 16px;
    background: var(--background-secondary);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.video-solution-info span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Responsive design */
@media (max-width: 768px) {
    .video-solution-modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .video-solution-body video {
        max-height: 400px;
    }
}

/* ==========================================
   Automation Panel Styles
   ========================================== */

.automation-panel {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
}

.automation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.automation-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
}

.status-dot.online {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.status-dot.offline {
    background: #ef4444;
}

.automation-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.automation-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    text-align: center;
    color: var(--text-muted);
    gap: 12px;
}

.automation-empty svg {
    opacity: 0.5;
}

.automation-empty code {
    background: var(--surface-hover);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    color: var(--primary);
}

.automation-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 32px;
    color: var(--text-secondary);
}

.automation-loading .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.automation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.automation-item:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.automation-item.processed {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.05) 0%, rgba(34, 197, 94, 0.02) 100%);
    border-color: rgba(34, 197, 94, 0.3);
}

.automation-item-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.automation-item.processed .automation-item-icon {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.automation-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.automation-item-name {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.automation-item-status {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #22c55e;
}

.automation-process-btn {
    flex-shrink: 0;
}

.automation-process-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Selected state */
.automation-item.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(99, 102, 241, 0.03) 100%);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

.automation-item.selected .automation-item-icon {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

/* Toolbar */
.automation-toolbar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.automation-toolbar.hidden {
    display: none;
}

.automation-selected-file {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.automation-selected-file svg {
    color: var(--primary);
}

.automation-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.automation-actions .btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    padding: 6px 12px;
}

.automation-actions .btn svg {
    flex-shrink: 0;
}

.automation-actions .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.automation-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 4px;
}

.btn-success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    border: none;
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

/* Progress */
.automation-progress {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    margin-top: auto;
}

.automation-progress.hidden {
    display: none;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
}

.progress-stage {
    font-weight: 600;
    color: var(--primary);
}

.progress-percent {
    color: var(--text-secondary);
}

.progress-bar {
    height: 8px;
    background: var(--surface-hover);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-message {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

/* Full Automation Panel */
.automation-panel.full-auto {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
}

.automation-panel.full-auto .automation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

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

.automation-stats {
    display: flex;
    gap: 12px;
}

.stat-card {
    flex: 1;
    text-align: center;
    padding: 16px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.stat-card.pending {
    border-color: rgba(245, 158, 11, 0.3);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(245, 158, 11, 0.02) 100%);
}

.stat-card.completed {
    border-color: rgba(34, 197, 94, 0.3);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08) 0%, rgba(34, 197, 94, 0.02) 100%);
}

.stat-card.total {
    border-color: rgba(99, 102, 241, 0.3);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(99, 102, 241, 0.02) 100%);
}

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

.stat-card.pending .stat-value {
    color: #f59e0b;
}

.stat-card.completed .stat-value {
    color: #22c55e;
}

.stat-card.total .stat-value {
    color: #6366f1;
}

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

.automation-panel.full-auto .automation-progress {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
}

.automation-panel.full-auto .progress-bar {
    margin-bottom: 8px;
}

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

.automation-log {
    flex: 1;
    min-height: 120px;
    max-height: 200px;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    font-family: monospace;
    font-size: 12px;
}

/* Boş Sayfa View */
.blank-page-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #e5e7eb;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.blank-page-view.active {
    opacity: 1;
    visibility: visible;
}

.blank-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 10;
    position: relative;
}

.blank-page-back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.blank-page-back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.blank-page-back-btn svg {
    width: 20px;
    height: 20px;
}

.blank-page-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.blank-page-spacer {
    width: 120px;
}

.blank-page-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: hidden;
}

.blank-page-canvas {
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    cursor: crosshair;
    border-radius: 4px;
}

@media (max-width: 768px) {
    .blank-page-header {
        padding: 10px 15px;
    }

    .blank-page-back-btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    .blank-page-back-btn span {
        display: none;
    }

    .blank-page-title {
        font-size: 16px;
    }

    .blank-page-spacer {
        width: 40px;
    }
}

/* Tools Grid (Araçlar Popup) */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 8px;
}

.tools-grid .shape-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    cursor: pointer;
    transition: all 0.2s;
}

.tools-grid .shape-option:hover {
    background: var(--hover);
    border-color: var(--primary);
}

.tools-grid .shape-option.active {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary);
}

.tools-grid .shape-option svg {
    width: 24px;
    height: 24px;
}

.tools-grid .shape-option span {
    font-size: 10px;
    color: var(--text-secondary);
    text-align: center;
}

