@import url('https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&family=Outfit:wght@300;400;500;700&family=Tajawal:wght@400;500;700&display=swap');

/* --- 1. FONTS --- */
@font-face {
    font-family: 'HafsSmart';
    src: url('HafsSmart_08.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --primary: #f97316;
    --primary-hover: #ea580c;
    --secondary: #64748b;
    --bg-color: #f8fafc;
    --paper-color: #ffffff;
    --text-color: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -1px rgb(0 0 0 / 0.06);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.05);
    --radius: 12px;
}

body.theme-cream {
    --bg-color: #fdfbf7;
    --paper-color: #fbf6e9;
    /* Warm papyrus-like color */
    --border: #e7e0cf;
    --text-color: #4b3d2a;
    /* Dark brown text for contrast */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
}

body {
    font-family: 'Outfit', 'Tajawal', sans-serif;
    background-color: var(--bg-color);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* --- 2. LAYOUT & CANVAS --- */
.canvas-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    transition: background 0.3s ease;
}

/* Background Patterns */
.canvas-wrapper.bg-dots {
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 40px 40px;
}

.canvas-wrapper.bg-grid {
    background-image:
        linear-gradient(#e2e8f0 1px, transparent 1px),
        linear-gradient(90deg, #e2e8f0 1px, transparent 1px);
    background-size: 40px 40px;
}

.canvas-wrapper.bg-ruled {
    background-image: linear-gradient(#e2e8f0 1px, transparent 1px);
    background-size: 100% 32px;
}

.canvas-wrapper.bg-plain {
    background-image: none;
    background-color: var(--paper-color);
}

/* Dark mode adjustments for patterns */
body.theme-dark .canvas-wrapper.bg-dots {
    background-image: radial-gradient(#334155 1px, transparent 1px);
}

body.theme-dark .canvas-wrapper.bg-grid {
    background-image:
        linear-gradient(#1e293b 1px, transparent 1px),
        linear-gradient(90deg, #1e293b 1px, transparent 1px);
}

body.theme-dark .canvas-wrapper.bg-ruled {
    background-image: linear-gradient(#1e293b 1px, transparent 1px);
}


#whiteboard {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: crosshair;
}

/* --- 3. UI COMPONENTS (Premium Style) --- */
.alignment-controls {
    display: flex;
    gap: 4px;
    background: #f1f5f9;
    padding: 2px;
    border-radius: 8px;
}

.align-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: var(--secondary);
    display: flex;
    /* Ensure icon is centered */
    justify-content: center;
    align-items: center;
    font-size: 18px;
    /* Adjustable icon size */
}

.align-btn:hover {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow);
}

.align-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow);
}

/* Animations */
button {
    font-family: 'Tajawal', sans-serif;
}

/* Global Font for buttons */

/* Inputs */
input[type="text"],
input[type="number"],
select,
textarea {
    font-family: 'Tajawal', sans-serif;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    outline: none;
    transition: all 0.2s;
    background: #f8fafc;
    color: var(--text-color);
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Primary Action Button */
.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

/* --- 4. TOP BAR --- */
.top-bar {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 100;
    pointer-events: none;
}

.top-bar>* {
    pointer-events: auto;
}

/* Allow clicks on children */

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 6px 12px;
    border-radius: 50px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.logo-img {
    height: 32px;
    width: auto;
    display: block;
}

.logo span {
    font-weight: 800;
    font-size: 18px;
    color: var(--primary);
    font-family: 'Outfit', sans-serif;
    /* Ensure English font */
}

.badge {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.top-actions {
    background: white;
    padding: 8px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--secondary);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    transition: 0.2s;
}

.icon-btn:hover {
    background: #f1f5f9;
    color: var(--text-color);
}

.icon-btn.danger:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* --- 5. SIDEBAR & PROPERTIES (Draggable & Orientable) --- */
.main-toolbar,
.properties-bar {
    position: fixed;
    background: var(--paper-color);
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.1);
    border: 1px solid var(--border);
    display: flex;
    gap: 8px;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: visible !important;
    /* Allow hover effects to show */
}

/* Scrollbar Hiding */
.toolbar-scroll-content::-webkit-scrollbar {
    display: none;
}

.toolbar-scroll-content {
    scrollbar-width: none;
    -ms-overflow-style: none;
    overflow-y: auto;
    overflow-x: visible;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    flex: 1;
    width: calc(100% + 16px);
    margin: 0 -8px;
    align-items: center;
}

/* Tooltips are handled by tooltips.js */

.scroll-indicator {
    width: 100%;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--primary);
    font-size: 16px;
    animation: bounceArrow 1.5s infinite;
    cursor: pointer;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.05));
    border-radius: 0 0 12px 12px;
    margin-top: -10px;
    /* Overlap slightly */
    z-index: 10;
}

@keyframes bounceArrow {

    0%,
    100% {
        transform: translateY(0);
        opacity: 0.6;
    }

    50% {
        transform: translateY(5px);
        opacity: 1;
    }
}

/* Custom Scrollbar - Removed per request for hidden style with arrow */

/* Tighter gap for vertical toolbar to fit more items */
.main-toolbar.vertical {
    gap: 0;
    /* Gap handled by inner container */
    padding: 6px;
    /* Slightly reduced padding */
}

/* Auto-hide: Default hidden state */
.main-toolbar {
    transform: translateX(-110%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.properties-bar {
    transform: translateY(110%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

/* Force show during tour */
body.tour-active .main-toolbar,
body.tour-active .properties-bar {
    transform: none !important;
    opacity: 1 !important;
}

/* Auto-show: Only via toggle button (.show class) or dragging */
.main-toolbar.dragging,
.main-toolbar.show {
    transform: translateX(20px) !important;
    opacity: 1;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}

.properties-bar.dragging,
.properties-bar.show {
    transform: translateY(0) translateX(-50%) !important;
    opacity: 1;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}

/* Hover trigger zones */
.main-toolbar::after,
.properties-bar::after {
    content: '';
    position: absolute;
    background: transparent;
}

.main-toolbar::after {
    left: 100%;
    top: 0;
    width: 30px;
    height: 100%;
}

.properties-bar::after {
    bottom: 100%;
    left: 0;
    width: 100%;
    height: 30px;
}

/* Orientation Styles */
.vertical {
    flex-direction: column;
    /* Removed fixed widths to allow content to dictate size properly */
    width: max-content;
    height: auto;
}

.horizontal {
    flex-direction: row;
    align-items: center;
    width: max-content;
    height: auto;
}

/* Default positions (can be overridden by inline styles) */
/* Main Toolbar: Left, Vertical, Centered Vertically */
/* Main Toolbar: Left, Vertical, Top-Aligned (Default) */
#main-toolbar.vertical {
    left: 20px;
    top: 100px;
    transform: none;
    right: auto;
    bottom: auto;
}

@media (max-width: 768px) {
    #main-toolbar {
        flex-direction: column !important;
        width: max-content !important;
        height: auto !important;
        top: 80px !important;
        left: 10px !important;
        transform: none !important;
    }

    .main-toolbar .toolbar-controls {
        flex-direction: column !important;
        border-bottom: 1px solid var(--border);
        border-right: none !important;
        padding-bottom: 8px;
        margin-bottom: 8px;
        width: 100%;
    }
}

/* Main Toolbar: Top, Horizontal (Alternative) */
#main-toolbar.horizontal {
    top: auto;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
}

/* Properties Bar: Bottom, Horizontal, Centered Horizontally (User Requested Separation) */
#properties-bar.horizontal {
    top: auto;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
}

/* Properties Bar: Right, Vertical (Alternative) */
#properties-bar.vertical {
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    left: auto;
    bottom: auto;
}

/* Input Overlay Positioning Fix */
.input-overlay {
    position: fixed;
    z-index: 2000;
}

/* Controls (Drag & Rotate) */
.toolbar-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* Ensure controls adapt to parent orientation */
.vertical .toolbar-controls {
    flex-direction: column;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
    margin-bottom: 8px;
    width: 100%;
}

.horizontal .toolbar-controls {
    flex-direction: row;
    border-right: 1px solid var(--border);
    padding-right: 8px;
    margin-right: 8px;
    height: 100%;
}

.drag-handle {
    background: #e0f2fe;
    color: var(--primary);
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    border: 1px solid #bae6fd;
    cursor: move;
    /* Explicit move cursor */
    font-size: 18px;
}

.drag-handle ion-icon {
    pointer-events: none;
}

.drag-handle:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.drag-handle:active {
    cursor: grabbing;
    background: var(--primary-hover);
}

.rotate-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--secondary);
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.rotate-btn:hover {
    background: #f1f5f9;
    color: var(--primary);
}

/* Dividers */
.toolbar-divider {
    background: var(--border);
}

.vertical .toolbar-divider {
    width: 100%;
    height: 1px;
}

.horizontal .toolbar-divider {
    width: 1px;
    height: 32px;
}

.vertical .separator {
    width: 100%;
    height: 1px;
}

.horizontal .separator {
    width: 1px;
    height: 24px;
}

/* Tool Items */
.tool-item {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: transparent;
    color: var(--secondary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    flex-shrink: 0;
    position: relative;
}

.tool-item:hover {
    background: #f1f5f9;
    color: var(--primary);
    transform: scale(1.1);
}

.tool-item.active {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow:
        0 0 0 3px rgba(249, 115, 22, 0.2),
        0 8px 16px rgba(249, 115, 22, 0.3);
    transform: scale(1.15);
}

.tool-item.active::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    opacity: 0;
    animation: pulseOrange 2s ease-in-out infinite;
}

@keyframes pulseOrange {

    0%,
    100% {
        transform: scale(1);
        opacity: 0;
    }

    50% {
        transform: scale(1.3);
        opacity: 0.3;
    }
}

/* Properties Bar Specifics */
.size-slider {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--secondary);
}

.vertical .size-slider {
    flex-direction: column;
}

.vertical input[type="range"] {
    writing-mode: bt-lr;
    /* IE/Edge */
    -webkit-appearance: slider-vertical;
    /* Webkit */
    appearance: slider-vertical;
    /* Standard */
    width: 8px;
    height: 100px;
}


input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100px;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Colors */
.color-picker {
    display: flex;
    gap: 8px;
    align-items: center;
}

.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.color-swatch:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.color-swatch.active {
    border-color: #f97316;
    box-shadow:
        0 0 0 3px rgba(249, 115, 22, 0.2),
        0 4px 12px rgba(249, 115, 22, 0.3);
    transform: scale(1.2);
}

.color-swatch.active::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #f97316;
    opacity: 0;
    animation: pulseOrange 2s ease-in-out infinite;
}

@keyframes pulseOrange {

    0%,
    100% {
        transform: scale(1);
        opacity: 0;
    }

    50% {
        transform: scale(1.4);
        opacity: 0.4;
    }
}

.custom-color-wrapper {
    position: relative;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    cursor: pointer;
}

.custom-color-wrapper input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.custom-color-wrapper ion-icon {
    font-size: 16px;
    color: var(--text-color);
}

.sticky-swatch {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
}

.sticky-swatch.active {
    border-color: var(--primary);
    transform: scale(1.1);
}

/* --- 6. OVERLAYS (Input, Selection) --- */
#input-wrapper {
    position: fixed;
    z-index: 500;
    display: flex;
    flex-direction: column;
    /* Stack tools on top of input */
    gap: 8px;
    align-items: center;
}

.input-tools {
    display: flex;
    gap: 8px;
    background: white;
    padding: 6px;
    border-radius: 50px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    align-items: center;
}

.input-align-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--secondary);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    transition: 0.2s;
}

.input-align-btn:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.input-align-btn.active {
    background: #e0f2fe;
    color: var(--primary);
}

.separator-v {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 4px;
}

#text-input-overlay,
#sticky-input-overlay {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    border: 2px solid var(--primary);
    padding: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    color: var(--text-color);
    outline: none;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    text-align: right;
    /* Default */
}

#sticky-input-overlay {
    background: #fef3c7;
    border: none;
    font-family: 'Kalam', cursive;
    width: 240px;
    height: 240px;
    resize: none;
    color: #4b5563;
}

#btn-confirm-input {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: 0.2s;
}

#btn-confirm-input:hover {
    transform: scale(1.1);
    background: var(--primary-hover);
}

#selection-menu {
    position: fixed;
    background: white;
    padding: 8px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    display: flex;
    gap: 8px;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.ctx-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-color);
    font-size: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.2s;
}

.ctx-btn:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.delete-btn:hover {
    background: #fee2e2;
    color: #ef4444;
}

.ctx-divider {
    width: 1px;
    background: var(--border);
    margin: 0 2px;
}

/* --- 7. WIDGETS (Mushaf & Timer) --- */
.widget {
    position: fixed;
    top: 100px;
    right: 100px;
    width: 340px;
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    z-index: 200;
    overflow: hidden;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.widget-header {
    background: #f8fafc;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    font-family: 'Tajawal';
    font-weight: 700;
    color: var(--text-color);
    font-size: 15px;
}

/* Tabs */
.mushaf-tabs {
    display: flex;
    gap: 4px;
    background: #f1f5f9;
    padding: 6px;
    border-radius: 12px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.tab-btn {
    flex: 1;
    padding: 8px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    font-family: 'Tajawal';
    transition: 0.2s;
}

.tab-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    font-weight: 700;
}

/* --- Timer Widget Styles --- */
#timer-widget {
    width: 280px;
    overflow: visible;
}

/* Timer Preset Buttons */
.timer-presets {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}

.preset-row {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.preset-btn {
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-color);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Tajawal', sans-serif;
}

.preset-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.05);
}

.preset-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

/* Custom time input row */
.custom-time-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
}

.custom-time-row input[type="number"] {
    width: 45px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    -moz-appearance: textfield;
}

.custom-time-row input[type="number"]::-webkit-outer-spin-button,
.custom-time-row input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.custom-time-row input:focus {
    outline: none;
    border-color: var(--primary);
}

.custom-time-row span {
    font-size: 18px;
    font-weight: 700;
    color: var(--secondary);
}

.custom-time-btn {
    padding: 6px 12px !important;
    font-size: 12px !important;
}

.timer-display {
    font-family: 'Outfit', monospace;
    font-size: 52px;
    font-weight: 700;
    color: var(--text-color);
    text-align: center;
    padding: 20px 0;
    background: white;
    letter-spacing: 2px;
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    background: white;
}

.timer-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: white;
    color: var(--secondary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
}

.timer-btn:hover {
    background: #f1f5f9;
    color: var(--primary);
    border-color: var(--primary);
    transform: scale(1.05);
}

.timer-btn:active {
    transform: scale(0.95);
}

/* Play button - main action */
#timer-start,
.timer-btn.primary {
    width: 52px;
    height: 52px;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

#timer-start:hover,
.timer-btn.primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 6px 16px rgba(249, 115, 22, 0.4);
    transform: scale(1.08);
}

/* Pause button */
#timer-pause {
    color: #64748b;
    background: #f1f5f9;
}

#timer-pause:hover {
    color: var(--primary);
    background: #fff7ed;
    border-color: var(--primary);
}

/* Reset button */
#timer-reset {
    color: #64748b;
}

#timer-reset:hover {
    color: #ef4444;
    background: #fee2e2;
    border-color: #fecaca;
}

/* Reusing Timer Styles for Counter */
/* Counter Widget Premium Redesign */
#counter-widget {
    width: 300px;
    background: white;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: visible;
}

.counter-display {
    font-family: 'Outfit', sans-serif;
    font-size: 84px;
    font-weight: 800;
    color: var(--primary);
    text-align: center;
    padding: 30px 0;
    line-height: 1;
    transition: color 0.3s ease, transform 0.3s ease;
    background: radial-gradient(circle at center, #fff7ed 0%, #fff 70%);
    border-bottom: 1px solid var(--border);
    position: relative;
    /* Decorative ring */
    margin: 20px auto;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(249, 115, 22, 0.15), inset 0 0 20px rgba(249, 115, 22, 0.05);
    border: 4px solid #fff;
    outline: 2px solid #ffedd5;
}

#counter-widget .timer-controls {
    padding: 20px;
    gap: 20px;
}

#counter-widget .timer-btn {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    font-size: 24px;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

/* Specific Button Styles */
#btn-counter-dec {
    /* The big central check button */
    background: var(--primary);
    color: white;
    border: none;
    width: 70px;
    height: 70px;
    font-size: 32px;
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(249, 115, 22, 0.3);
    order: 2;
    /* Center it */
}

#btn-counter-inc {
    order: 3;
    /* Right */
}

#btn-counter-reset {
    order: 1;
    /* Left */
    color: #ef4444;
    background: #fef2f2;
    border-color: #fee2e2;
}

#counter-widget .timer-btn:active {
    transform: scale(0.9);
}

#counter-widget .timer-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.05);
}

#btn-counter-dec:hover {
    box-shadow: 0 15px 30px rgba(249, 115, 22, 0.4);
    transform: translateY(-3px) scale(1.05);
}

#btn-teacher-mode.active {
    background: #fee2e2;
    color: #ef4444;
    border-color: #fca5a5;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}



.timer-btn:hover {
    background: #f1f5f9;
    color: var(--text-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.timer-btn.primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.timer-btn.primary:hover {
    background: var(--primary-hover);
    color: white;
    /* Ensure text/icon stays white */
}

/* Mushaf Content */
.widget-content {
    padding: 20px;
}

.input-group {
    margin-bottom: 12px;
}

.input-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: block;
    font-weight: 500;
}

.row {
    display: flex;
    gap: 10px;
}

/* Stickers Panel */
.popover-panel {
    position: fixed;
    left: 90px;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    padding: 16px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    z-index: 101;
    width: 240px;
    max-height: 400px;
    overflow-y: auto;
}

.sticker {
    font-size: 32px;
    cursor: pointer;
    padding: 12px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.2s;
    background: #f8fafc;
}

.sticker:hover {
    background: #eff6ff;
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* --- 8. UTILS --- */
.hidden {
    display: none !important;
}

#curtain-overlay,
#spotlight-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 900;
}

/* === CURTAIN OVERLAY - Multi-Directional === */
#curtain-overlay {
    background: #0f172a;
    position: fixed;
    /* Not fullscreen anymore - positioned dynamically */
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    z-index: 900;
    transition: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* --- Background Switcher Popover --- */
.bg-popover {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 12px;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    padding: 12px;
    display: none;
    flex-direction: column;
    gap: 8px;
    min-width: 180px;
    z-index: 1001;
    animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.bg-popover.show {
    display: flex;
}

.bg-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Tajawal', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
}

.bg-option:hover {
    background: #f1f5f9;
}

.bg-option.active {
    background: #e0f2fe;
    color: var(--primary);
}

.bg-preview {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.bg-preview.dots {
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 4px 4px;
}

.bg-preview.grid {
    background-image: linear-gradient(#e2e8f0 1px, transparent 1px), linear-gradient(90deg, #e2e8f0 1px, transparent 1px);
    background-size: 6px 6px;
}

.bg-preview.ruled {
    background-image: linear-gradient(#e2e8f0 1px, transparent 1px);
    background-size: 100% 6px;
}

.bg-preview.plain {
    background: white;
}

.curtain-handle {
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    min-width: 200px;
    height: 44px;
    padding: 0 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    border-radius: 0 0 24px 24px;
    cursor: grab;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    color: white;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-top: none;
    font-family: 'Tajawal', sans-serif;
    font-size: 14px;
    user-select: none;
}

.curtain-handle:active {
    cursor: grabbing;
}

.curtain-handle ion-icon {
    font-size: 20px;
}

.curtain-handle .mode-exit-btn {
    background: rgba(239, 68, 68, 0.8);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 10px;
}

.curtain-handle .mode-exit-btn:hover {
    background: #ef4444;
    transform: scale(1.1);
}

.curtain-handle .mode-exit-btn ion-icon {
    font-size: 18px;
    color: white;
}

/* Edge Handles for Resizing */
.curtain-edge {
    position: absolute;
    background: transparent;
    z-index: 10;
}

.curtain-edge-top {
    top: 0;
    left: 20px;
    right: 20px;
    height: 12px;
    cursor: ns-resize;
}

.curtain-edge-bottom {
    bottom: 0;
    left: 20px;
    right: 20px;
    height: 12px;
    cursor: ns-resize;
}

.curtain-edge-left {
    left: 0;
    top: 20px;
    bottom: 20px;
    width: 12px;
    cursor: ew-resize;
}

.curtain-edge-right {
    right: 0;
    top: 20px;
    bottom: 20px;
    width: 12px;
    cursor: ew-resize;
}

/* Visual indicator on hover */
.curtain-edge:hover {
    background: rgba(249, 115, 22, 0.5);
}

/* Corner Handles */
.curtain-corner {
    position: absolute;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    z-index: 11;
    opacity: 0;
    transition: opacity 0.2s;
}

#curtain-overlay:hover .curtain-corner {
    opacity: 1;
}

.curtain-corner-nw {
    top: 4px;
    left: 4px;
    cursor: nw-resize;
}

.curtain-corner-ne {
    top: 4px;
    right: 4px;
    cursor: ne-resize;
}

.curtain-corner-sw {
    bottom: 4px;
    left: 4px;
    cursor: sw-resize;
}

.curtain-corner-se {
    bottom: 4px;
    right: 4px;
    cursor: se-resize;
}

.curtain-corner:hover {
    background: var(--primary);
    transform: scale(1.2);
}

/* Preset Buttons */
.curtain-presets {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 12px;
    z-index: 5;
}

.curtain-preset-btn {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}

.curtain-preset-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4);
}

.curtain-preset-btn ion-icon {
    font-size: 24px;
}

#spotlight-overlay {
    background: rgba(15, 23, 42, 0.98);
    pointer-events: none;
}

/* Hide cursor when spotlight is active */
body.spotlight-active,
body.spotlight-active * {
    cursor: none !important;
}

/* Keep cursor for the exit button only */
body.spotlight-active .floating-exit,
body.spotlight-active .floating-exit * {
    cursor: pointer !important;
}

/* Keep cursor for the side slider */
body.spotlight-active #spotlight-side-slider,
body.spotlight-active #spotlight-side-slider * {
    cursor: pointer !important;
}

.floating-exit {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 20px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    pointer-events: auto;
    display: flex;
    gap: 8px;
    color: white;
    font-family: 'Tajawal';
    cursor: pointer;
    transition: 0.2s;
}

.floating-exit:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Legacy CSS Tooltips removed - now handled by dynamic tooltips.js */

/* --- Tutorial Mascot Overlay --- */
#tutorial-overlay {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    gap: 15px;
    pointer-events: none;
    /* Allow clicking through unless on interactive parts */
    transition: all 0.5s ease;
}

.mascot-container {
    width: 150px;
    height: auto;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.2));
    animation: bounceSlow 3s infinite;
    cursor: pointer;
    pointer-events: auto;
}

.mascot-img {
    width: 100%;
    height: auto;
}

.speech-bubble {
    background: white;
    padding: 20px;
    border-radius: 20px;
    border-bottom-left-radius: 4px;
    /* Tail */
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--primary);
    max-width: 300px;
    font-family: 'Tajawal';
    position: relative;
    pointer-events: auto;
    /* Buttons inside needed */
    animation: popIn 0.3s ease;
}

.speech-text {
    color: var(--text-color);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.speech-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.tut-btn {
    padding: 6px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-family: 'Tajawal';
    font-weight: bold;
    font-size: 13px;
    transition: 0.2s;
}

.tut-btn-primary {
    background: var(--primary);
    color: white;
}

.tut-btn-secondary {
    background: #f1f5f9;
    color: var(--secondary);
}

.tut-btn:hover {
    transform: scale(1.05);
}

@keyframes bounceSlow {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Highlight Target Element */
/* Highlight Target Element with Dark Overlay */
.scout-spotlight {
    position: fixed;
    z-index: 1999;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.85);
    /* Darker overlay */
    border-radius: 12px;
    pointer-events: none;
    transition: all 0.5s ease;
    border: 4px solid var(--primary);
    box-sizing: content-box;
    /* Ensure border doesn't shrink content area */
}

/* Mascot Sizing */
.mascot-container {
    width: 180px;
    /* Slightly larger */
    height: auto;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.4));
    animation: bounceSlow 3s infinite;
    cursor: pointer;
    pointer-events: auto;
    z-index: 2001;
    /* Above spotlight */
}

/* Speech Bubble on Top */
.speech-bubble {
    z-index: 2001;
    position: relative;
    background: white;
    padding: 24px;
    border-radius: 24px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 3px solid var(--primary);
    max-width: 340px;
    font-family: 'Tajawal';
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tut-active-target {
    position: relative;
    z-index: 2002 !important;
    background: white !important;
    box-shadow: 0 0 0 4px #22c55e, 0 0 20px rgba(34, 197, 94, 0.6) !important;
    transform: scale(1.1) !important;
    border-radius: 8px;
    transition: all 0.3s ease;
}

/* --- 7. MODALS (Universal) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    min-width: 320px;
    max-width: 480px;
    width: 90%;
    animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    font-family: 'Tajawal', sans-serif;
}

.close-icon {
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.close-icon:hover {
    color: var(--primary);
}

.modal-body p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 16px;
    line-height: 1.5;
}

.input-group {
    display: flex;
    gap: 8px;
}

.input-group input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--text-color);
    font-family: monospace;
    font-size: 0.9rem;
    outline: none;
}

.input-group input:focus {
    border-color: var(--primary);
}

@keyframes popIn {
    0% {
        transform: scale(0.9);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* PDF Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.pdf-modal-content {
    background: white;
    border-radius: 20px;
    max-width: 90vw;
    max-height: 85vh;
    width: 700px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    animation: popIn 0.3s ease;
    overflow: hidden;
}

.pdf-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-color);
}

.pdf-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}

.pdf-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 10px;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Tajawal', sans-serif;
}

.pdf-action-btn:hover {
    background: #ea580c;
    transform: translateY(-1px);
}

.pdf-page-count {
    color: var(--secondary);
    font-size: 14px;
}

.pdf-pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    padding: 20px;
    overflow-y: auto;
    max-height: 60vh;
}

.pdf-page-thumb {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f1f5f9;
}

.pdf-page-thumb:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.pdf-page-thumb canvas {
    width: 100%;
    height: auto;
    display: block;
}

.pdf-page-number {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    text-align: center;
    padding: 8px 4px 6px;
    font-size: 12px;
    font-weight: 600;
}

.pdf-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--secondary);
}

.pdf-loading ion-icon {
    font-size: 48px;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* PDF Header Actions */
.pdf-header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.pdf-action-btn.secondary {
    background: #64748b;
}

.pdf-action-btn.secondary:hover {
    background: #475569;
}

.pdf-action-btn.small {
    padding: 6px 12px;
    font-size: 12px;
}

/* Book Preview Mode - Native PDF Viewer */
.pdf-book-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    background: #1e293b;
    flex: 1;
    min-height: 60vh;
}

.pdf-book-preview iframe {
    width: 100%;
    flex: 1;
    min-height: 55vh;
    border: none;
    background: white;
}

.pdf-book-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    color: white;
    font-size: 14px;
}

.pdf-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.pdf-nav-btn:hover {
    background: var(--primary);
}

/* Minimized PDF Widget */
.pdf-mini-widget {
    position: fixed;
    right: 20px;
    bottom: 100px;
    width: 200px;
    max-height: 300px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    overflow: hidden;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.pdf-mini-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 13px;
}

.pdf-mini-pages {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 10px;
    max-height: 220px;
    overflow-y: auto;
}

.pdf-mini-pages canvas {
    width: 100%;
    height: auto;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pdf-mini-pages canvas:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Canvas PDF Viewer Element */
.canvas-pdf-viewer {
    position: fixed;
    background: white;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
    border: 1px solid var(--border);
    pointer-events: auto;
}

.pdf-viewer-header {
    background: #f8fafc;
    padding: 10px 15px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    user-select: none;
}

.pdf-viewer-header span {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-color);
}

.pdf-viewer-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pdf-v-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: white;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border);
}

.pdf-v-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pdf-v-btn.danger:hover {
    background: #ef4444;
    border-color: #ef4444;
}

.pdf-v-page {
    font-size: 12px;
    font-weight: 600;
    min-width: 45px;
    text-align: center;
}

.pdf-viewer-content {
    flex: 1;
    overflow: auto;
    background: #f1f5f9;
    display: flex;
    justify-content: center;
    padding: 10px;
}

.pdf-v-canvas {
    max-width: 100%;
    height: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: white;
}

.pdf-viewer-resize {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 20px;
    height: 20px;
    cursor: nwse-resize;
    background: linear-gradient(135deg, transparent 50%, #94a3b8 50%);
    border-radius: 0 0 12px 0;
}