:root {
    --excel-blue: #4472C4;
    /* Official Excel Header Blue */
    --excel-border: #BFBFBF;
    /* Standard Excel Grid Color */
    --excel-row-alt: #D9E1F2;
    /* Standard Excel Banded Row */
    --excel-header-text: #FFFFFF;
    --primary-color: #4361ee;
    --text-dark: #000000;
    --glass-bg: rgba(255, 255, 255, 0.95);
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: #f0f2f5;
    color: var(--text-dark);
}

/* Coin Animation */
.coin-animation {
    display: inline-block;
    animation: coinFlip 3s infinite linear;
    transform-style: preserve-3d;
}

@keyframes coinFlip {
    0% {
        transform: rotateY(0deg);
    }

    100% {
        transform: rotateY(360deg);
    }
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px !important;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
    display: flex;
    flex-direction: column;
}

/* Excel Style Table */
.table-responsive {
    max-height: calc(100vh - 180px);
    /* Tall viewport for table */
    overflow: auto;
    border: 1px solid var(--excel-border);
}

#data-table {
    border-collapse: separate;
    /* Required for robust sticky headers */
    border-spacing: 0;
    width: max-content;
    /* Allow table to grow/shrink based on columns */
    min-width: 100%;
    table-layout: fixed;
    /* Column widths are respected */
    background-color: white;
}

#data-table thead tr#excel-letters th.col-letter {
    background-color: #e6e6e6;
    color: #444;
    font-size: 11px;
    /* Smaller font */
    text-align: center;
    border-right: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
    font-weight: normal;
    padding: 0 0;
    /* Minimal padding */
    position: sticky;
    top: 0;
    z-index: 101;
    background-clip: padding-box;
    height: 15px;
    /* Reduced height to raise the blue row */
}

/* Header with Blue Background (Row 1 style) */
#data-table thead tr#table-head th {
    background-color: var(--excel-blue);
    color: var(--excel-header-text);
    border-right: 1px solid #bfbfbf;
    border-bottom: 1px solid #bfbfbf;
    padding: 2px 18px 2px 4px;
    /* Very compact padding, right space for icon */
    text-align: center;
    font-family: 'Segoe UI', 'Calibri', 'Cairo', sans-serif;
    font-size: 12px;
    /* Excel standard is ~11-12px */
    font-weight: 600;
    min-width: 80px;
    /* Smaller min-width */
    position: sticky;
    /* Sits right below the 25px letter row */
    top: 0px;
    /* Sticky under the letters row */
    z-index: 100;
    background-clip: padding-box;
    white-space: nowrap;
    cursor: pointer;
    height: 35px;
    /* Reduced height */
    overflow: hidden;
    text-overflow: ellipsis;
}


#data-table tbody td {
    border-right: 1px solid var(--excel-border);
    border-bottom: 1px solid var(--excel-border);
    padding: 2px 4px;
    /* Excel-like tight padding */
    font-size: 12px;
    font-family: 'Segoe UI', 'Calibri', 'Cairo', sans-serif;
    text-align: center;
    color: #000;
    background-clip: padding-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    max-width: 1px;
    height: 20px;
    /* Force rows to be compact */
}

/* Light blue alternating rows */
#data-table tbody tr:nth-child(even) td {
    background-color: var(--excel-row-alt);
}

/* gray index column on the left (for LTR) */
#data-table tbody td.row-num,
#data-table thead th.row-num {
    background-color: #f3f3f3 !important;
    /* Lighter grey for row numbers */
    color: #333;
    font-weight: normal;
    font-size: 13px;
    width: 25px;
    /* Much smaller width as requested */
    min-width: 25px;
    max-width: none;
    /* Removed hard max-width to allow JS auto-fit to expand it if data exceeds 100 rows */
    border-right: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
    position: sticky;
    left: 0;
    z-index: 30;
    /* Keep it above everything */
    white-space: nowrap;
    overflow: hidden;
    padding: 0;
    background-clip: padding-box;
    line-height: 20px;
}

#data-table thead th.row-num {
    top: 0;
    line-height: normal;
}

#data-table thead tr#table-head th.row-num {
    top: 0px;
    height: 35px;
    line-height: 35px;
}

/* Hover effect */
#data-table tbody tr:hover td:not(.row-num) {
    background-color: #fff2cc !important;
}

/* Upload Area */
.upload-area {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px dashed #94b3d8;
    background-color: #f8fbff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.upload-area:hover {
    border-color: var(--excel-blue) !important;
    background-color: #eff6ff;
}

.fadeIn {
    animation: fadeIn 0.8s ease-in-out;
}

/* Onboarding Tutorial Styles */
.tutorial-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #dee2e6;
    transition: all 0.3s ease;
}
.tutorial-dot.active {
    background: var(--primary-color);
    width: 25px;
    border-radius: 10px;
}
.tutorial-card img {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.tutorial-card img.changing {
    transform: scale(0.9) opacity(0);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #94b3d8;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--excel-blue);
}

.btn-success {
    background-color: #27ae60;
    border: none;
}

/* Column Resizer Handle */
.resizer {
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    cursor: col-resize;
    user-select: none;
    height: 100%;
    z-index: 40;
}

.resizer:hover,
.resizer.resizing {
    background-color: var(--primary-color);
    opacity: 0.5;
}

/* Filter Dropdown Styling */
.filter-icon {
    display: inline-block;
    margin-left: 5px;
    color: #fff;
    font-size: 0.7rem;
    opacity: 0.7;
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
}

.filter-icon:hover {
    opacity: 1;
}

.filter-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ccc;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    min-width: 200px;
    max-height: 300px;
    overflow-y: auto;
    border-radius: 4px;
    padding: 5px 0;
    text-align: right;
    font-weight: normal;
    color: #333;
}

.filter-menu-item {
    padding: 4px 10px;
    display: block;
    cursor: pointer;
    font-size: 0.9rem;
}

.filter-menu-item:hover {
    background-color: #f0f0f0;
}

.filter-menu-actions {
    border-top: 1px solid #eee;
    padding: 8px;
    display: flex;
    justify-content: space-between;
    position: sticky;
    bottom: 0;
    background: white;
}

/* Visual Chart Selector */
.chart-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.chart-type-card {
    border: 2px solid #eee;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.chart-type-card:hover {
    border-color: var(--primary-color);
    background-color: #f8fbff;
    transform: translateY(-3px);
}

.chart-type-card.active {
    border-color: var(--primary-color);
    background-color: #eff6ff;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.15);
}

.chart-type-card i {
    font-size: 24px;
    color: #666;
    transition: color 0.2s ease;
}

.chart-type-card.active i {
    color: var(--primary-color);
}

.chart-type-card span {
    font-size: 13px;
    font-weight: 600;
    color: #444;
}

.chart-type-card.active span {
    color: var(--primary-color);
}

/* Premium Animations */
#generate-dashboard {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

#generate-dashboard:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(67, 97, 238, 0.3);
}

.pulse-btn {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(67, 97, 238, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(67, 97, 238, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(67, 97, 238, 0);
    }
}

/* Chat & Insights UI */
.insights-scroll {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
}

.insight-item {
    background: #fff;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 12px;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
}

.insight-item:hover {
    transform: translateX(-5px);
    background-color: #f8fbff;
}

.insight-chart-preview {
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.03);
    overflow: hidden;
}

.insight-item:hover .insight-chart-preview {
    border-color: var(--primary-color);
    background: white !important;
}

.chat-container {
    height: 600px;
}

.chat-messages {
    overflow-y: auto;
    background: #f8f9fa;
    max-height: 500px;
    min-height: 420px;
}

.chat-bubble {
    max-width: 85%;
    padding: 12px 18px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.6;
    position: relative;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.ai-bubble {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}

.user-bubble {
    background: var(--primary-color);
    color: white;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
    margin-right: 0;
    margin-left: auto;
}

#chat-messages {
    display: flex;
    flex-direction: column;
}

.typing-indicator {
    padding: 10px;
    background: #eee;
    border-radius: 10px;
    display: inline-block;
    font-size: 11px;
    color: #777;
    margin-bottom: 10px;
}

.text-purple {
    color: #8e44ad;
}

.text-orange {
    color: #e67e22;
}

/* Chat Chart Selector */
.chat-chart-selector-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.chat-chart-option {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chat-chart-option:hover {
    border-color: var(--primary-color);
    background: #f0f4ff;
    transform: scale(1.05);
}

.preview-chart-mini {
    width: 60px;
    height: 60px;
    margin-bottom: 5px;
}

.chat-chart-option span {
    font-size: 10px;
    font-weight: bold;
    color: #555;
}

/* Toast Notification Styles */
#toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.custom-toast {
    background: #27ae60;
    color: white;
    padding: 15px 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastIn 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
    font-weight: 600;
}

@keyframes toastIn {
    from {
        transform: translateX(120%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-out {
    animation: toastOut 0.5s ease forwards;
}

@keyframes toastOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

/* Metric Cards Styling (New) */
#dashboard-content-row {
    display: flex;
    flex-wrap: wrap;
    /* Changed from overflow-x to wrap */
    padding-bottom: 15px;
    gap: 0;
    /* Use Bootstrap gutter instead */
}

.metric-card-wrapper {
    min-width: 200px;
    transition: transform 0.1s ease-out;
    /* Smooth but responsive */
}

.metric-card-wrapper.transforming,
#dashboard-content-row .col-md-6.transforming {
    z-index: 1000 !important;
    cursor: grabbing !important;
}

.metric-card-wrapper.transforming .metric-card,
.col-md-6.transforming .glass-card {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2) !important;
    opacity: 0.9;
}

.metric-card {
    border-radius: 12px;
    padding: 16px;
    color: white;
    text-align: right;
    /* Set to right alignment if it's an Arabic dashboard */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: none;
    position: relative;
    overflow: hidden;
    height: 100%;
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.metric-card .metric-title {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.85;
    margin-bottom: 8px;
    display: block;
}

.metric-card .metric-value {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
    display: block;
}

.metric-card .metric-change {
    font-size: 12px;
    font-weight: 600;
    opacity: 0.9;
}

/* Specific Gradeints from user image */
.bg-metric-1 {
    background: linear-gradient(135deg, #7b70e2 0%, #5e51d9 100%);
}

.bg-metric-2 {
    background: linear-gradient(135deg, #0d5fa9 0%, #084c8c 100%);
}

.bg-metric-3 {
    background: linear-gradient(135deg, #0686c1 0%, #046fac 100%);
}

.bg-metric-4 {
    background: linear-gradient(105deg, #09a37e 0%, #07d195 100%);
}

.bg-metric-5 {
    background: linear-gradient(135deg, #d14d7c 0%, #ed6663 100%);
}

.bg-metric-6 {
    background: linear-gradient(135deg, #6d4da9 0%, #8e59ce 100%);
}

[dir="ltr"] .metric-card {
    text-align: left;
}

#dashboard-content-row::-webkit-scrollbar {
    display: none;
    /* Hide since we wrap now */
}

/* Edit Mode Styles */
.edit-mode-active .metric-card,
.edit-mode-active .glass-card {
    outline: 2px dashed var(--primary-color) !important;
    cursor: move;
    user-select: none;
    transition: none !important;
}

.edit-btn-hide {
    display: none !important;
}

.edit-mode-active .edit-btn-hide {
    display: inline-block !important;
}

.edit-mode-active [contenteditable="true"] {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    padding: 2px 4px;
    cursor: text;
}


.edit-controls {
    display: none;
    position: absolute;
    top: 5px;
    left: 5px;
    gap: 5px;
    z-index: 1000;
}

.edit-mode-active .edit-controls {
    display: flex;
}

.edit-mode-active .metric-card .edit-controls {
    top: 5px;
    left: 5px;
}

.edit-btn {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    color: #333;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.edit-btn:hover {
    background: var(--primary-color);
    color: white;
}

.edit-btn.delete-btn:hover {
    background: #e74c3c;
    color: white;
}

.resize-grip {
    display: none;
}

/* Hide old grip */

/* New Edge Resize Handles */
.resize-handle {
    position: absolute;
    display: none;
    z-index: 1001;
}

.edit-mode-active .resize-handle {
    display: block;
}

.resize-handle-r {
    top: 10%;
    right: 0;
    width: 8px;
    height: 80%;
    cursor: e-resize;
    background: transparent;
}

.resize-handle-r:hover {
    background: rgba(67, 97, 238, 0.2);
}

.resize-handle-b {
    bottom: 0;
    left: 10%;
    width: 80%;
    height: 8px;
    cursor: s-resize;
    background: transparent;
}

.resize-handle-b:hover {
    background: rgba(67, 97, 238, 0.2);
}

.resize-handle-br {
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    cursor: se-resize;
    background: linear-gradient(135deg, transparent 50%, var(--primary-color) 50%);
    opacity: 0.3;
}

.resize-handle-br:hover {
    opacity: 0.8;
}

.rotate-handle {
    cursor: grab;
}

.rotate-handle:active {
    cursor: grabbing;
}

/* Make cards easier to transform */
.dashboard-item,
.metric-card-wrapper {
    position: relative !important;
    z-index: 1;
}

.edit-mode-active #dashboard-section {
    background: rgba(67, 97, 238, 0.02);
    border-radius: 15px;
    padding: 10px;
}

/* Sheet Selection Modal Styles */
.overlay-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

#auth-modal {
    z-index: 3000; /* Ensure auth modal is above other modals */
}

.sheet-option {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
}

.sheet-option:hover {
    border-color: var(--primary-color);
    background: #f8fbff;
    transform: translateY(-2px);
}

.sheet-option.selected {
    border-color: var(--primary-color);
    background: #eff6ff;
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.15);
}

.sheet-option input[type="radio"] {
    width: 22px;
    height: 22px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

/* Empty Cell Highlight - Much more visible */
td.empty-highlight {
    background-color: #ffe0b2 !important;
    /* Stronger peach/orange background */
    position: relative;
    transition: all 0.3s ease;
    box-shadow: inset 0 0 8px rgba(255, 152, 0, 0.4);
}

td.empty-highlight:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 3px solid #f44336;
    /* Thick Red Border */
    pointer-events: none;
    animation: pulse-border-intense 1.5s infinite;
}

@keyframes pulse-border-intense {
    0% {
        opacity: 0.4;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(0.98);
    }

    100% {
        opacity: 0.4;
        transform: scale(1);
    }
}

td.empty-highlight:focus {
    background-color: #fff !important;
    box-shadow: 0 0 10px rgba(67, 97, 238, 0.5);
    outline: none;
}

/* Custom Centered Alert Modal */
.alert-card {
    width: 90%;
    max-width: 450px;
    border-radius: 20px !important;
    border: none;
    background: rgba(255, 255, 255, 0.98);
}

.alert-icon-wrapper {
    width: 80px;
    height: 80px;
    background: rgba(255, 193, 7, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.fadeInScale {
    animation: fadeInScale 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Back to Top Button */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    transform: translateY(20px);
}

#back-to-top.show {
    opacity: 1;
    transform: translateY(0);
    display: flex;
}

#back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(67, 97, 238, 0.3) !important;
    background-color: #3f37c9;
}

/* AI Side Panel Styles (Updated for Chat) */
.ai-side-panel {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    height: 100vh;
    background: #f8f9fa;
    z-index: 2000;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    direction: rtl;
    /* Ensure RTL for Arabic language */
}

.ai-side-panel.open {
    right: 0;
}

.side-panel-header {
    background: var(--primary-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.side-panel-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.side-panel-footer {
    background: white;
}

/* Chat Message Styles */
.chat-msg {
    max-width: 90%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.4;
    position: relative;
    word-wrap: break-word;
    text-align: right;
}

.chat-msg.ai {
    align-self: flex-start;
    background: white;
    color: #333;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    text-align: right;
}

[dir="rtl"] .chat-msg.ai {
    border-bottom-right-radius: 12px;
    border-bottom-left-radius: 4px;
}

.chat-msg.user {
    align-self: flex-end;
    background: var(--primary-color);
    color: white;
    border-bottom-left-radius: 4px;
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.2);
}

[dir="rtl"] .chat-msg.user {
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 4px;
}

.typing-indicator {
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 15px;
    width: fit-content;
    font-style: italic;
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 8px;
}

.col-highlight {
    background-color: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: bold;
    display: inline-block;
    margin: 1px 0;
}


.side-panel-footer {
    background: white;
    padding: 10px 15px !important;
}

.side-panel-footer .input-group .form-control {
    font-size: 0.85rem;
    padding: 8px 12px;
}

/* User Menu Styles */
.user-menu-container {
    position: relative;
    cursor: pointer;
    margin-right: 15px;
}

.user-icon {
    font-size: 1.8rem;
    color: #fff;
    transition: transform 0.2s ease;
}

.user-icon:hover {
    transform: scale(1.1);
}

.user-dropdown {
    position: absolute;
    top: 50px;
    right: 0;
    background-color: white;
    background: white;
    min-width: 200px;
    border-radius: 12px;
    padding: 8px 0;
    z-index: 2050;
    direction: rtl;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.dropdown-item-custom {
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #333 !important;
    font-weight: 500;
    transition: background 0.2s;
}

.dropdown-item-custom:hover {
    background: #f8f9fa;
}

.dropdown-item-custom span {
    display: flex;
    align-items: center;
}

.arrow-icon {
    font-size: 0.8rem;
    color: var(--primary-color);
    transition: transform 0.3s cubic-bezier(0.1, 0.7, 1.0, 0.1);
}

.arrow-rotate {
    transform: rotate(180deg);
}

.submenu {
    background: #f8f9fa;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.submenu-item {
    padding: 10px 40px;
    font-size: 0.9rem;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
}

.submenu-item:hover {
    background: #e9ecef;
    color: var(--primary-color);
    padding-right: 45px;
}

/* Themes Implementation */
body.dark-theme {
    background-color: #121212 !important;
    color: #e0e0e0 !important;
}

body.dark-theme .glass-card,
body.dark-theme .card,
body.dark-theme .modal-content,
body.dark-theme .bg-white {
    background-color: #1e1e1e !important;
    color: #e0e0e0 !important;
    border-color: #333 !important;
}

/* Fix for Excel Data Table in Dark Theme */
body.dark-theme #data-table,
body.custom-theme #data-table {
    background-color: #1e1e1e !important;
}

body.dark-theme #data-table tbody td,
body.custom-theme #data-table tbody td {
    color: #eee !important;
    background-color: #1e1e1e !important;
    border-color: #333 !important;
}

/* Alternating rows for dark theme */
body.dark-theme #data-table tbody tr:nth-child(even) td,
body.custom-theme #data-table tbody tr:nth-child(even) td {
    background-color: #252525 !important;
}

body.dark-theme #data-table thead tr#excel-letters th.col-letter,
body.custom-theme #data-table thead tr#excel-letters th.col-letter {
    background-color: #333 !important;
    color: #aaa !important;
    border-color: #444 !important;
}

body.dark-theme #data-table tbody td.row-num,
body.dark-theme #data-table thead th.row-num,
body.custom-theme #data-table tbody td.row-num,
body.custom-theme #data-table thead th.row-num {
    background-color: #2a2a2a !important;
    color: #888 !important;
    border-color: #444 !important;
}

/* Hover effect improvement for dark theme */
body.dark-theme #data-table tbody tr:hover td:not(.row-num),
body.custom-theme #data-table tbody tr:hover td:not(.row-num) {
    background-color: rgba(67, 97, 238, 0.25) !important;
    color: #fff !important;
}

body.dark-theme .table,
body.dark-theme .table-light {
    background-color: #252525 !important;
    color: #fff !important;
    border-color: #444 !important;
}

body.dark-theme .table td,
body.dark-theme .table th {
    color: #ccc !important;
    border-color: #333 !important;
}

body.custom-theme {
    background-color: #1b2735 !important;
    color: #ffffff !important;
}

body.custom-theme .glass-card,
body.custom-theme .card,
body.custom-theme .bg-white {
    background-color: #243447 !important;
    color: #ffffff !important;
    border-color: #34495e !important;
}

body.custom-theme .navbar {
    background-color: #162431 !important;
}

body.light-theme {
    background-color: #f0f2f5 !important;
    color: #000000 !important;
}

/* Fix for dropdown in dark mode to stay readable */
body.dark-theme .user-dropdown,
body.custom-theme .user-dropdown {
    background-color: #222 !important;
    border-color: #444 !important;
}

body.dark-theme .dropdown-item-custom,
body.custom-theme .dropdown-item-custom,
body.dark-theme .dropdown-item-custom a,
body.custom-theme .dropdown-item-custom a {
    color: #eee !important;
}

body.dark-theme .dropdown-item-custom:hover,
body.custom-theme .dropdown-item-custom:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
}

body.dark-theme .submenu,
body.custom-theme .submenu {
    background-color: #2a2a2a !important;
    border-color: #444 !important;
}

body.dark-theme .submenu-item,
body.custom-theme .submenu-item {
    color: #bbb !important;
}

body.dark-theme .submenu-item:hover,
body.custom-theme .submenu-item:hover {
    background: #444;
    color: #fff;
}

/* Theme adaptation for Upload Area and other UI elements */
/* Fix for Chat Interface in Dark Themes */
body.dark-theme .chat-messages {
    background-color: #1a1a1a !important;
}

body.dark-theme .ai-bubble {
    background-color: #2d2d2d !important;
    color: #eee !important;
    border-color: #444 !important;
}

body.dark-theme .user-bubble,
body.custom-theme .user-bubble {
    background-color: var(--primary-color) !important;
    color: #fff !important;
}

body.dark-theme .chat-input-area {
    background-color: #222 !important;
    border-top-color: #333 !important;
}

body.dark-theme .chat-input-area .form-control {
    background-color: #333 !important;
    color: #fff !important;
}

body.dark-theme .chat-container .card-header {
    background-color: #252525 !important;
    border-bottom-color: #333 !important;
}

body.dark-theme .insights-scroll {
    background-color: #1a1a1a !important;
}

body.dark-theme .insight-item {
    background-color: #252525 !important;
    color: #eee !important;
    border-left-color: var(--primary-color) !important;
}

body.dark-theme .insight-item:hover {
    background-color: #333 !important;
}

/* Custom Theme specific Chat adjustments - Navy Blue Style */
body.custom-theme .chat-messages {
    background-color: #0f172a !important;
}

body.custom-theme .ai-bubble {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
    border-color: #334155 !important;
}

body.custom-theme .chat-input-area {
    background-color: #162431 !important;
    border-top-color: #334155 !important;
}

body.custom-theme .chat-input-area .form-control {
    background-color: #1e293b !important;
    color: #fff !important;
}

body.custom-theme .chat-input-area .form-control::placeholder {
    color: #94a3b8 !important;
}

body.custom-theme .chat-container .card-header {
    background-color: #162431 !important;
    border-bottom-color: #334155 !important;
}

body.custom-theme .insights-scroll {
    background-color: #0f172a !important;
}

body.custom-theme .insight-item {
    background-color: #1e2a3a !important;
    color: #f1f5f9 !important;
}

body.custom-theme .insight-item:hover {
    background-color: #243447 !important;
}

body.dark-theme .upload-area,
body.custom-theme .upload-area {
    background-color: rgba(255, 255, 255, 0.03) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #e0e0e0 !important;
}

body.dark-theme .upload-area:hover,
body.custom-theme .upload-area:hover {
    background-color: rgba(255, 255, 255, 0.07) !important;
    border-color: var(--primary-color) !important;
}

body.dark-theme .upload-area p,
body.custom-theme .upload-area p {
    color: #aaa !important;
}

body.dark-theme .bg-light,
body.custom-theme .bg-light,
body.dark-theme .card-header,
body.custom-theme .card-header,
body.dark-theme .card-footer,
body.custom-theme .card-footer {
    background-color: rgba(255, 255, 255, 0.02) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #e0e0e0 !important;
}

body.dark-theme .form-control,
body.custom-theme .form-control,
body.dark-theme .form-select,
body.custom-theme .form-select {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
}

/* Fix for Select Options in some browsers */
body.dark-theme .form-select option,
body.custom-theme .form-select option {
    background-color: #252525 !important;
    color: #fff !important;
}

/* Adjust Chart Selection Cards in Dark Themes */
body.dark-theme .chart-type-card,
body.custom-theme .chart-type-card {
    background-color: rgba(255, 255, 255, 0.03) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #ccc !important;
}

body.dark-theme .chart-type-card span,
body.custom-theme .chart-type-card span {
    color: #ccc !important;
}

body.dark-theme .chart-type-card i,
body.custom-theme .chart-type-card i {
    color: #888 !important;
}

body.dark-theme .chart-type-card:hover,
body.custom-theme .chart-type-card:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--primary-color) !important;
}

body.dark-theme .chart-type-card.active,
body.custom-theme .chart-type-card.active {
    background-color: rgba(67, 97, 238, 0.15) !important;
    border-color: var(--primary-color) !important;
}



/* English Language Support (Force LTR for content in an RTL environment) */
.en-lang section,
.en-lang .card,
.en-lang .modal,
.en-lang #ai-side-panel,
.en-lang .dataTables_wrapper {
    direction: ltr !important;
    text-align: left !important;
}

.en-lang .card-title,
.en-lang .card-body,
.en-lang .form-label,
.en-lang .form-check-label {
    text-align: left !important;
}

.en-lang .upload-area {
    text-align: center !important;
    align-items: center !important;
}


.en-lang .navbar-nav {
    flex-direction: row !important;
    /* Keep items horizontal */
}

.en-lang .ms-2 {
    margin-right: 0.5rem !important;
    margin-left: 0 !important;
}

.en-lang .me-2 {
    margin-left: 0.5rem !important;
    margin-right: 0 !important;
}

/* Navbar Typewriter Animation Styles */
.navbar-brand-container {
    min-width: 280px;
    /* Fixed width to prevent jumping */
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

#typewriter-text {
    border-right: 2px solid var(--primary-color);
    padding-right: 5px;
    white-space: nowrap;
    overflow: hidden;
}

/* Cursor blinking effect */
.cursor-blink {
    border-right-color: transparent !important;
    animation: blink 0.7s infinite;
}

@keyframes blink {
    50% {
        border-right-color: var(--primary-color);
    }
}

/* Hover effect for navigation links */
.navbar-nav .nav-link:hover {
    color: #4cc9f0 !important;
    /* Modern bright blue */
    transition: color 0.3s ease;
}

.navbar-nav .nav-link.active {
    color: var(--primary-color) !important;
}

/* Hover effect for sections/cards */
.glass-card {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    border-color: var(--primary-color) !important;
    box-shadow: 0 8px 30px rgba(67, 97, 238, 0.15) !important;
}

/* Dashboard Image Wrapper */
.dashboard-image-wrapper {
    position: absolute;
    z-index: 200;
    width: 300px;
    height: 200px;
    border: 2px dashed transparent;
    transition: border-color 0.2s;
    cursor: move;
}

.edit-mode-active .dashboard-image-wrapper {
    border-color: rgba(67, 97, 238, 0.2);
}

.edit-mode-active .dashboard-image-wrapper:hover {
    border-color: var(--primary-color);
}

.dashboard-image-wrapper .edit-controls {
    position: absolute;
    top: -12px;
    right: -12px;
    z-index: 201;
    display: none !important;
    gap: 5px;
}

.edit-mode-active .dashboard-image-wrapper .edit-controls {
    display: flex !important;
}

.dashboard-image-wrapper .resize-handle {
    opacity: 0;
}

.edit-mode-active .dashboard-image-wrapper .resize-handle {
    opacity: 1;
}

/* Slicer Buttons Styles */
.slicer-card {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(67, 97, 238, 0.1);
    border-radius: 12px !important;
    padding: 15px !important;
    margin-bottom: 20px;
}

.slicer-buttons-container {
    max-height: 120px;
    overflow-y: auto;
    padding: 5px;
}

.slicer-buttons-container::-webkit-scrollbar {
    width: 4px;
}

.slicer-buttons-container .btn {
    border-radius: 20px;
    font-size: 13px;
    padding: 5px 15px;
    transition: all 0.2s;
}

.slicer-buttons-container .btn-outline-primary.active {
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.2);
}


/* Table Control Buttons (Add/Remove Row/Col) */
.table-control-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.2px solid #ccc;
    background: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin: 0 1px;
    color: #555;
    vertical-align: middle;
}

.table-control-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.table-control-btn.add-btn {
    color: #2b78ff;
    border-color: #2b78ff;
}

.table-control-btn.add-btn:hover {
    background-color: #2b78ff;
    color: white;
    border-color: transparent;
}

.table-control-btn.remove-btn {
    color: #ef4444;
    border-color: #ef4444;
}

.table-control-btn.remove-btn:hover {
    background-color: #ef4444;
    color: white;
    border-color: transparent;
}

#data-table thead tr.controls-row th {
    background-color: #f1f3f4;
    padding: 2px 0;
    text-align: center;
    border-bottom: 1px solid #ddd;
    border-right: 1px solid #ddd;
    height: 32px;
    z-index: 105;
    position: sticky;
    top: 0;
}

#data-table td.row-controls {
    background-color: #f8f9fa !important;
    border-left: 1px solid #ddd;
    padding: 0 4px;
    text-align: center;
    min-width: 60px;
}

[dir="rtl"] #data-table td.row-controls {
    border-left: none;
    border-right: 1px solid #ddd;
}


.navbar-brand {
    display: inline-flex !important;
    align-items: center !important;
    vertical-align: middle;
}

.navbar-brand i {
    transform: translateY(-2px);
    /* Lift the icon slightly */
    display: inline-flex;
    align-items: center;
}

/* Excel Formula Bar styling */
.formula-bar {
    background-color: #fdfdfd;
    font-size: 14px;
    z-index: 10;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.formula-bar:focus-within {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 1px rgba(67, 97, 238, 0.1);
}

.formula-label {
    background-color: #f3f3f3;
    display: flex !important;
    align-self: stretch;
    align-items: center;
    justify-content: center;
    min-width: 45px;
    color: var(--excel-blue);
    font-style: italic;
    border-right: 1px solid #ddd;
    border-radius: 0;
    user-select: none;
}

[dir="rtl"] .formula-label {
    border-right: none;
    border-left: 1px solid #ddd;
}

#formula-input {
    resize: vertical;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    font-family: 'Segoe UI', Calibri, 'Cairo', sans-serif;
    padding: 8px 12px !important;
    min-height: 38px;
    background-color: transparent !important;
    overflow-y: auto;
    width: 100%;
}

#formula-input:focus {
    background-color: #fff !important;
}

#formula-input:empty::before {
    content: attr(data-placeholder);
    color: #999;
    pointer-events: none;
}

.cell-ref {
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    padding: 2px 5px;
    background-color: #f3f3f3;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
    margin: 0 2px;
}

.cell-ref:hover {
    background-color: #e4e4e4;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ref-0 {
    color: #1a73e8;
}

.ref-1 {
    color: #d93025;
}

.ref-2 {
    color: #188038;
}

.ref-3 {
    color: #e37400;
}

.ref-4 {
    color: #a142f4;
}

.bg-ref-0 {
    background-color: rgba(26, 115, 232, 0.15) !important;
    box-shadow: inset 0 0 0 2px #1a73e8 !important;
    transition: all 0.3s ease;
}

.bg-ref-1 {
    background-color: rgba(217, 48, 37, 0.15) !important;
    box-shadow: inset 0 0 0 2px #d93025 !important;
    transition: all 0.3s ease;
}

.bg-ref-2 {
    background-color: rgba(24, 128, 56, 0.15) !important;
    box-shadow: inset 0 0 0 2px #188038 !important;
    transition: all 0.3s ease;
}

.bg-ref-3 {
    background-color: rgba(227, 116, 0, 0.15) !important;
    box-shadow: inset 0 0 0 2px #e37400 !important;
    transition: all 0.3s ease;
}

.bg-ref-4 {
    background-color: rgba(161, 66, 244, 0.15) !important;
    box-shadow: inset 0 0 0 2px #a142f4 !important;
    transition: all 0.3s ease;
}

/* =========================================
   HISTORY PANEL STYLES
   ========================================= */

/* History submenu items inside the dropdown */
.history-submenu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
    gap: 8px;
}

.history-submenu-item:last-child {
    border-bottom: none;
}

.history-submenu-item:hover {
    background-color: #eff6ff;
}

.history-submenu-item .history-item-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
}

.history-submenu-item .history-item-badge {
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    padding: 1px 8px;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
}

.history-submenu-item .history-item-date {
    font-size: 10px;
    color: #999;
    flex-shrink: 0;
}

/* History Slide-in Panel */
.history-panel {
    position: fixed;
    inset: 0;
    z-index: 9990;
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
}

.history-panel.d-none {
    display: none !important;
}

.history-panel-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(3px);
    animation: backdropIn 0.25s ease;
}

@keyframes backdropIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.history-panel-content {
    position: relative;
    width: 400px;
    max-width: 95vw;
    background: white;
    display: flex;
    flex-direction: column;
    animation: panelSlideIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 1;
    overflow: hidden;
}

@keyframes panelSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.history-panel-header {
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    flex-shrink: 0;
}

.history-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px !important;
}

/* History Entry Cards */
.history-card {
    border: 1px solid #e8ecf4;
    border-radius: 12px;
    padding: 6px 10px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.25s ease;
    background: #fff;
    position: relative;
    overflow: hidden;
}

.history-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #4361ee, #4cc9f0);
    border-radius: 4px 0 0 4px;
}

.history-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 6px 20px rgba(67, 97, 238, 0.15);
    transform: translateY(-2px);
}

.history-card-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0px;
}

.history-card-meta {
    font-size: 9.5px;
    color: #888;
    margin-bottom: 4px;
}

.history-card-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.history-stat {
    background: #f0f4ff;
    border-radius: 20px;
    padding: 0px 8px;
    font-size: 9px;
    color: #4361ee;
    font-weight: 600;
}

.history-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    justify-content: flex-end;
}

.history-arrow-icon {
    transition: transform 0.25s ease;
}

.history-arrow-icon.rotated {
    transform: rotate(180deg);
}

/* History toggle arrow in dropdown */
#history-arrow {
    transition: transform 0.25s ease;
}

#history-arrow.open {
    transform: rotate(180deg);
}

/* Custom Alert Styles */
.custom-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.custom-alert-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    padding: 35px;
    border-radius: 28px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
    max-width: 420px;
    width: 90%;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.6);
    position: relative;
    overflow: hidden;
}

.custom-alert-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(to right, var(--primary-color), #6366f1);
}

.custom-alert-icon {
    font-size: 50px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.fadeInDown {
    animation: fadeInDown 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.custom-alert-card h5 {
    color: #2c3e50;
    font-size: 1.25rem;
}

.custom-alert-card p {
    font-size: 1rem;
    line-height: 1.5;
}

/* Animations for closing (Optional, implemented via JS) */
.fadeOutUp {
    animation: fadeOutUp 0.3s ease-in forwards;
}

@keyframes fadeOutUp {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
}

/* Color Mode Styles */
.color-mode-active .color-trigger-btn {
    display: flex !important;
}

.color-trigger-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: white;
    border: 1px solid #ddd;
    color: var(--primary-color);
    display: none;
    /* Only show in color mode */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1002;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.color-trigger-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.color-mode-active .glass-card,
.color-mode-active .metric-card {
    cursor: crosshair;
}

.color-mode-active canvas {
    cursor: cell !important;
}

/* Pulse animation for the trigger to make it noticeable */
.color-mode-active .color-trigger-btn {
    animation: triggerPulse 2s infinite;
}

@keyframes triggerPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(67, 97, 238, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(67, 97, 238, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(67, 97, 238, 0);
    }
}

pointer-events: none;
}

/* Pulse animation for the trigger to make it noticeable */
.color-mode-active .color-trigger-btn {
    animation: triggerPulse 2s infinite;
    background: #007bff;
    color: white;
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(0, 123, 255, 0.5);
}

@keyframes triggerPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(67, 97, 238, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(67, 97, 238, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(67, 97, 238, 0);
    }
}

/* Pricing & Payment Styles */
.plan-card {
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(0,0,0,0.05);
}

.plan-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(67, 97, 238, 0.1) !important;
    border-color: var(--primary-color);
}

.plan-card.featured {
    border-color: var(--primary-color);
}

.payment-method-card {
    transition: all 0.2s ease;
    border: 2px solid #eee;
}

.payment-method-card:hover {
    background-color: #f8fbff;
    border-color: var(--primary-color) !important;
}

.payment-method-card.active {
    background-color: #eff6ff;
    border: 3px solid var(--primary-color) !important;
    box-shadow: 0 0 15px rgba(67, 97, 238, 0.2);
    transform: scale(1.02);
}

#method-instapay h6 {
    font-size: 0.85rem;
}

#method-instapay p {
    font-size: 0.7rem !important;
}

.cursor-pointer {
    cursor: pointer;
}

.border-dashed {
    border-style: dashed !important;
    border-width: 2px !important;
}

.upload-area {
    background-color: #fbfcfe;
    transition: all 0.3s ease;
}

.upload-area:hover {
    background-color: #f0f4ff;
    border-color: var(--primary-color) !important;
}

#card-details input {
    letter-spacing: 1px;
}

/* Contact Modal & Social Icons */
.contact-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: #f8f9ff !important;
}

.contact-subtitle {
    background: linear-gradient(90deg, #6366f1 0%, #d946ef 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.social-icons-row {
    display: flex !important;
    flex-direction: row !important; /* Force LTR order */
    justify-content: center;
    gap: 15px;
    direction: ltr !important; /* Prevent RTL reversal */
}

.social-box {
    width: 62px;
    height: 62px;
    background: white;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #333;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 15px rgba(0,0,0,0.05);
}

.social-box:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.social-box.facebook i { color: #1877f2; }
.social-box.whatsapp i { color: #25d366; }
.social-box.linkedin i { color: #0077b5; }
.social-box.instagram i { color: #e4405f; }

.social-box i {
    transition: transform 0.3s ease;
}

.social-box:hover i {
    transform: scale(1.1);
}

/* Predictive Analytics Styles */
.predictive-btn {
    color: #6366f1;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    padding: 5px 12px !important;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.05);
}

.predictive-btn:hover {
    color: #4f46e5;
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.predictive-icon {
    font-size: 1.1rem;
    filter: drop-shadow(0 2px 4px rgba(99, 102, 241, 0.2));
}

.predictive-content h3 {
    color: var(--primary-color);
    font-weight: 800;
    margin-bottom: 25px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.predictive-content h4 {
    color: #334155;
    font-weight: 700;
    margin-top: 30px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.predictive-content h4 i {
    margin-left: 10px;
    color: #6366f1;
}

.predictive-content p {
    color: #64748b;
    line-height: 1.8;
    margin-bottom: 15px;
}

.predictive-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 15px;
    overflow: hidden;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #f1f5f9;
}

.predictive-table th {
    background-color: #f8fafc;
    color: #1e293b;
    font-weight: 700;
    padding: 15px;
    text-align: right;
    border-bottom: 2px solid #e2e8f0;
}

.predictive-table td {
    background-color: white;
    color: #475569;
    padding: 15px;
    text-align: right;
    border-bottom: 1px solid #f1f5f9;
}

.predictive-table tr:last-child td {
    border-bottom: none;
}

.predictive-table tr:hover td {
    background-color: #f1f5f9;
}

.insight-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    border-right: 4px solid #6366f1;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.insight-card i {
    color: #6366f1;
    font-size: 1.2rem;
}