/* Enhanced Cursor Styles for Tools */

/* Spotlight Exit Button - Always Visible */
#btn-close-spotlight {
    position: fixed !important;
    top: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 10000 !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    padding: 12px 24px !important;
    border-radius: 50px !important;
    border: 2px solid #ef4444 !important;
    color: #ef4444 !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

#btn-close-spotlight:hover {
    background: #ef4444 !important;
    color: white !important;
    transform: translateX(-50%) scale(1.05) !important;
    box-shadow: 0 15px 50px rgba(239, 68, 68, 0.4) !important;
}

/* Eraser Cursor - Dynamic Circle */
#whiteboard.eraser-tool {
    cursor: none !important;
}

#eraser-cursor {
    position: fixed;
    border: 2px solid #ef4444;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    background: rgba(239, 68, 68, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.1s, height 0.1s;
}

/* Highlighter Shape Swatches */
.shape-swatch {
    width: 36px !important;
    height: 36px !important;
    border-radius: 8px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--secondary);
    background: transparent;
    border: 2px solid transparent !important;
    transition: all 0.2s;
}

.shape-swatch:hover {
    background: #f1f5f9 !important;
    color: var(--primary);
}

.shape-swatch.active {
    background: #e0f2fe !important;
    color: var(--primary);
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2) !important;
}

/* Text Editor Panel */
#text-editor-panel {
    position: fixed;
    background: white;
    padding: 16px;
    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);
    border: 1px solid var(--border);
    z-index: 1000;
    min-width: 320px;
    animation: fadeIn 0.2s ease;
}

.text-editor-group {
    margin-bottom: 12px;
}

.text-editor-group:last-child {
    margin-bottom: 0;
}

.text-editor-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: block;
}

.text-editor-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.font-selector {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: 'Tajawal', sans-serif;
    font-size: 13px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.font-selector:hover,
.font-selector:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.text-size-input {
    width: 80px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
}

.text-weight-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: white;
    cursor: pointer;
    font-weight: 700;
    color: var(--secondary);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.text-weight-btn:hover {
    background: #f1f5f9;
    color: var(--primary);
    border-color: var(--primary);
}

.text-weight-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.text-color-swatch {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 2px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
}

.text-color-swatch:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.text-color-swatch.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.tajweed-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Spotlight Side Slider - Hand Indicator */
#spotlight-side-slider {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10001;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

#spotlight-side-slider.visible {
    display: flex;
}

/* Vertical Slider Track */
.spotlight-slider-track {
    width: 8px;
    height: 300px;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

/* Hand Indicator */
.spotlight-hand-indicator {
    position: absolute;
    right: -25px;
    font-size: 40px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    user-select: none;
}

.spotlight-hand-indicator:hover {
    transform: scale(1.15);
}

.spotlight-hand-indicator:active {
    animation: bounce 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounce {

    0%,
    100% {
        transform: scale(1);
    }

    25% {
        transform: scale(0.9) rotate(-5deg);
    }

    50% {
        transform: scale(1.2) rotate(5deg);
    }

    75% {
        transform: scale(0.95) rotate(-2deg);
    }
}

/* Size Labels */
.spotlight-size-label {
    color: white;
    font-size: 14px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    padding: 4px 12px;
    background: rgba(249, 115, 22, 0.9);
    border-radius: 20px;
    backdrop-filter: blur(5px);
}

/* Progress Fill */
.spotlight-slider-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, #f97316, #fb923c);
    border-radius: 10px;
    transition: height 0.1s ease-out;
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.5);
}

/* ===== RESPONSIVE ===== */

/* Mobile */
@media (max-width: 768px) {
    /* Enable auto-hide on mobile too */
    /* Removed the always-visible override */

    /* Larger tap zones for mobile */
    .main-toolbar::after {
        width: 50px !important;
        /* Wider tap zone */
    }

    .properties-bar::after {
        height: 50px !important;
        /* Taller tap zone */
    }

    /* Smaller elements */
    .tool-item {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .color-swatch {
        width: 28px;
        height: 28px;
    }

    /* Hide spotlight slider on mobile */
    #spotlight-side-slider {
        display: none !important;
    }

    /* Add visual hint for hidden toolbars on mobile */
    .main-toolbar,
    .properties-bar {
        box-shadow: 0 0 20px rgba(249, 115, 22, 0.3) !important;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .tool-item {
        width: 38px;
        height: 38px;
    }

    .color-swatch {
        width: 30px;
        height: 30px;
    }
}/* Spinner for Tajweed Widget */
.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: var(--primary);
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
