/* 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;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%) rotate(-30deg);
    width: 50px;
    height: 22px;
    background: linear-gradient(90deg,
            #e85a5a 0%, #d54545 48%,
            #3b6cb5 52%, #2d5aa8 100%);
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow:
        0 3px 6px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

#eraser-cursor::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 48%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 70%;
    background: rgba(0, 0, 0, 0.15);
}

#eraser-cursor::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.25) 0%, transparent 100%);
    border-radius: 3px 3px 0 0;
}

/* Mistake Tool Cursor - Custom DOM Element */
#mistake-cursor {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    width: 32px;
    height: 32px;
    transform: translate(-50%, -50%);
    /* Background removed in favor of inline SVG */
    transition: transform 0.05s linear;
    /* Smoother follow */
}

/* Marching Ants Animation */
.marching-ants {
    animation: march 1s linear infinite;
}

@keyframes march {
    to {
        stroke-dashoffset: -20;
        /* Moves the dashes */
    }
}

/* Remove CSS cursor override, reliance is now on DOM element */
#whiteboard.mistake-tool {
    cursor: none !important;
}

/* 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);
    }
}

/* --- FIX: Ghost Toolbar Interaction --- */
/* Add visibility transition to ensure elements are truly hidden when opacity is 0 */
.main-toolbar,
.properties-bar {
    visibility: hidden;
    pointer-events: none;
    /* Block clicks when hidden */
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, visibility 0s linear 0.4s !important;
}

.main-toolbar.show,
.main-toolbar.dragging,
.properties-bar.show,
.properties-bar.dragging,
body.tour-active .main-toolbar,
body.tour-active .properties-bar {
    visibility: visible;
    pointer-events: auto;
    /* Re-enable clicks when shown */
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease, visibility 0s linear 0s !important;
}

/* =========================================
   ENHANCED STICKER PANEL & ANIMATIONS
   ========================================= */

/* Sticker Panel Container */
#stickers-panel {
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s linear !important;
    transform-origin: bottom center !important;

    /* Default Position */
    position: fixed !important;
    top: 15% !important;
    left: 260px !important;
    bottom: auto !important;

    /* Panel Structure */
    display: flex !important;
    flex-direction: column !important;
    padding: 0 0 16px 0 !important;
    /* Added bottom padding for resize handle */

    /* Size & Shape */
    width: 380px;
    height: 500px;
    min-width: 320px;
    min-height: 400px;
    max-width: 90vw;
    max-height: 80vh;
    resize: both;
    overflow: hidden !important;

    /* Visuals */
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    border-radius: 20px !important;
    box-shadow:
        0 10px 40px -10px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(0, 0, 0, 0.05) !important;
    font-family: 'Outfit', 'Tajawal', sans-serif !important;
    z-index: 500 !important;

    /* UX Fix: Force LTR so resize handle is bottom-right (matches left positioning) */
    direction: ltr !important;
}

/* Restore RTL for content */
#stickers-panel>* {
    direction: rtl;
}

/* Panel Header */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    cursor: grab;
    user-select: none;
    flex-shrink: 0;
}

.panel-header:active {
    cursor: grabbing;
}

.panel-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-title {
    font-weight: 700;
    color: var(--text-color);
    font-size: 15px;
}

.panel-close-btn {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.panel-close-btn:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* Sticker Interface Container */
.sticker-interface {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Search Bar */
.sticker-search-container {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.3);
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    flex-shrink: 0;
}

.sticker-search-container ion-icon {
    font-size: 18px;
    color: #94a3b8;
}

#sticker-search-input {
    flex: 1;
    border: none;
    background: rgba(241, 245, 249, 0.8);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    color: #334155;
    outline: none;
    font-family: inherit;
    transition: all 0.2s;
}

#sticker-search-input:focus {
    background: white;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Tabs */
.sticker-tabs {
    display: flex;
    padding: 0 8px;
    background: #f8fafc;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
    overflow-x: auto;
    scrollbar-width: none;
    /* Hide scrollbar */
}

.sticker-tabs::-webkit-scrollbar {
    display: none;
}

.sticker-tab {
    flex: 1;
    min-width: 50px;
    height: 44px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #64748b;
    position: relative;
    transition: all 0.2s;
}

.sticker-tab:hover {
    background: rgba(0, 0, 0, 0.02);
    color: #334155;
}

.sticker-tab.active {
    color: #3b82f6;
}

.sticker-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    width: 80%;
    height: 3px;
    background: #3b82f6;
    border-radius: 3px 3px 0 0;
}

/* Grid Content */
.sticker-content-area {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 8px;
    align-content: start;
    background: #fdfdfd;
}

/* Scrollbar Style */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* Individual Sticker */
.custom-sticker-item {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    /* Emoji base size */
    cursor: pointer;
    border-radius: 8px;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s;
    user-select: none;
}

.custom-sticker-item:hover {
    background: rgba(0, 0, 0, 0.03);
    transform: scale(1.15);
}

.custom-sticker-item:active {
    transform: scale(0.95);
}

.custom-sticker-item img {
    width: 90%;
    height: 90%;
    object-fit: contain;
    pointer-events: none;
}

/* Loading */
.loading-spinner {
    grid-column: 1 / -1;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner:after {
    content: '';
    width: 24px;
    height: 24px;
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Mobile Adjustment */
@media (max-width: 768px) {
    #stickers-panel {
        width: 100% !important;
        height: 60vh !important;
        /* Larger on mobile */
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        border-radius: 24px 24px 0 0 !important;
        border: none !important;
        transform: translateY(0) !important;
    }

    #stickers-panel.hidden {
        transform: translateY(100%) !important;
    }

    .sticker-content-area {
        grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
    }
}

/* Transitions */
#stickers-panel.hidden {
    opacity: 0 !important;
    transform: translateY(20px) scale(0.95) !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

#stickers-panel:not(.hidden) {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Shake Animation Class */
@keyframes shake-screen {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-6px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(6px);
    }
}

.shake-effect {
    animation: shake-screen 0.4s cubic-bezier(.36, .07, .19, .97) both;
}

/* Confetti Canvas Container */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 99999;
}

/* Sticker Category Headers */
.sticker-category-label {
    grid-column: 1 / -1;
    font-size: 13px;
    font-weight: 700;
    color: var(--secondary);
    margin-top: 10px;
    margin-bottom: 4px;
    text-align: right;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 2px;
}

.sticker-category-label:first-child {
    margin-top: 0;
}

/* --- Donation Feature --- */
.donate-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ec4899, #f43f5e);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(244, 63, 94, 0.4);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: heartPulse 5s infinite ease-in-out;
}

/* RTL Adjustment - Ensure it stays left */
html[dir='rtl'] .donate-btn {
    left: 20px;
    right: auto;
}

.donate-btn:hover {
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 0 8px 25px rgba(244, 63, 94, 0.6);
    animation: none;
}

.donate-btn:active {
    transform: scale(0.95);
}

@keyframes heartPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(244, 63, 94, 0.4);
    }

    5% {
        transform: scale(1.1);
        box-shadow: 0 4px 20px rgba(244, 63, 94, 0.6);
    }

    10% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(244, 63, 94, 0.4);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(244, 63, 94, 0.4);
    }
}

/* Modal Styling */
.donation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.donation-modal.hidden {
    display: none;
}

.donation-modal-content {
    background: rgba(255, 255, 255, 0.95);
    width: 90%;
    max-width: 500px;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.5);
    animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.close-donation-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    background: transparent;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

html[dir='rtl'] .close-donation-btn {
    left: 15px;
    right: auto;
}

.close-donation-btn:hover {
    background: #f1f5f9;
    color: #ef4444;
}

.donation-header {
    margin-bottom: 20px;
}

.donation-heart-wrapper {
    width: 64px;
    height: 64px;
    background: #fee2e2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 32px;
    color: #e11d48;
}

.beating-heart {
    animation: heartBeat 1.2s infinite ease-in-out;
}

@keyframes heartBeat {

    0%,
    100% {
        transform: scale(1);
    }

    15% {
        transform: scale(1.3);
    }

    30% {
        transform: scale(1);
    }

    45% {
        transform: scale(1.15);
    }

    60% {
        transform: scale(1);
    }
}

.donation-header h2 {
    font-family: 'Tajawal', sans-serif;
    color: #1e293b;
    font-size: 24px;
    margin: 0;
}

.donation-text {
    font-family: 'Tajawal', sans-serif;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 30px;
    font-size: 16px;
}

.donation-methods {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.donation-method-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
    border: 1px solid #e2e8f0;
    padding: 15px;
    border-radius: 12px;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.3s ease;
}

.donation-method-card:hover {
    border-color: #f43f5e;
    box-shadow: 0 12px 20px -8px rgba(244, 63, 94, 0.2);
    transform: translateY(-3px);
}

.method-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.wallet-icon {
    background: #e0f2fe;
    color: #0284c7;
}

.instapay-icon {
    background: #f0fdf4;
    color: #16a34a;
}

.method-details {
    flex: 1;
    text-align: right;
}

html[dir='ltr'] .method-details {
    text-align: left;
}

.method-details h3 {
    margin: 0 0 5px;
    font-family: 'Tajawal', sans-serif;
    font-size: 16px;
    color: #334155;
    font-weight: 700;
}

.copy-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px dashed #cbd5e1;
    width: fit-content;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* RTL: Align right inside flex items */
    margin-right: 0;
    margin-left: auto;
}

html[dir='ltr'] .copy-row {
    margin-left: 0;
    margin-right: auto;
}

.copy-row:hover {
    background: #fff1f2;
    border-color: #f43f5e;
    color: #e11d48;
    transform: scale(1.03);
}

.copy-row .number {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.5px;
    direction: ltr;
    /* Always LTR numbers */
}

.copy-row ion-icon {
    font-size: 18px;
    opacity: 0.7;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.paypal-icon {
    background: #ebf8ff;
    color: #003087;
}

/* === NOTIFICATION SYSTEM === */
.notification-wrapper {
    position: relative;
    display: inline-block;
}

#notification-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 50%;
    border: 2px solid white;
    z-index: 10;
}

#notification-badge.hidden {
    display: none;
}

#notification-dropdown {
    position: absolute;
    top: 130%;
    /* Below button */
    right: 0;
    width: 300px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    z-index: 1000;
    overflow: hidden;
    text-align: right;
    direction: rtl;
    opacity: 1;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: translateY(0);
}

#notification-dropdown.hidden {
    display: none;
    opacity: 0;
    transform: translateY(-10px);
}

.notification-header {
    background: #f8fafc;
    padding: 12px 16px;
    font-weight: bold;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.9rem;
}

#notification-list {
    max-height: 320px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    align-items: flex-start;
    transition: background 0.2s;
}

.notification-item:hover {
    background: #f8fafc;
}

.notification-item:last-child {
    border-bottom: none;
}

.notif-icon {
    color: #6366f1;
    font-size: 1.2rem;
    background: #e0e7ff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notif-content {
    flex: 1;
}

.notif-content p {
    margin: 0;
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.5;
    font-weight: 500;
}

.notif-content span {
    display: block;
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 6px;
    font-family: 'Outfit', sans-serif;
}

.notification-empty {
    padding: 40px 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 0.9rem;
}

/* Custom Confirm Modal Styling - Glassmorphism & Elegant */
#custom-confirm-modal .confirm-modal {
    max-width: 420px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border-radius: 24px;
    padding: 0;
    overflow: hidden;
    animation: modalPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
    from {
        transform: scale(0.8) translateY(20px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

#custom-confirm-modal .modal-header {
    background: #fff5f5;
    padding: 24px 24px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 2px solid #fff1f1;
}

#custom-confirm-modal .modal-header h3 {
    margin: 0;
    color: #991b1b;
    font-family: "Tajawal", sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    flex: 1;
}

#custom-confirm-modal .alert-icon {
    font-size: 2.5rem;
    color: #ef4444;
    filter: drop-shadow(0 4px 6px rgba(239, 68, 68, 0.2));
}

#custom-confirm-modal .modal-body {
    padding: 24px;
    text-align: right;
    /* RTL Default */
}

#custom-confirm-modal #confirm-modal-msg {
    font-family: "Tajawal", sans-serif;
    font-size: 1.15rem;
    color: #374151;
    line-height: 1.7;
    margin-bottom: 32px;
}

#custom-confirm-modal .modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

#custom-confirm-modal .modal-actions button {
    flex: 1;
    padding: 14px;
    border-radius: 16px;
    font-weight: 700;
    font-family: "Tajawal", sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#custom-confirm-modal .cancel-btn {
    background: #f3f4f6;
    color: #4b5563;
}

#custom-confirm-modal .cancel-btn:hover {
    background: #e5e7eb;
    color: #1f2937;
}

#custom-confirm-modal .danger-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

#custom-confirm-modal .danger-btn:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(239, 68, 68, 0.3);
}

[dir="ltr"] #custom-confirm-modal .modal-header,
[dir="ltr"] #custom-confirm-modal .modal-body {
    text-align: left;
}