/* ==========================================================================
   3. LAYOUT & CONTAINERS
   ========================================================================== */
/*
.container.mx-auto {
    transition: padding-top 0.3s ease;
    padding-top: var(--banner-height);
}
/*

/* Table Scroll Container */
.table-scroll-container { 
    max-height: 300px; 
    overflow-y: auto; 
    border-radius: 0.5rem; 
    border: 1px solid #3A2A1F; 
    -webkit-overflow-scrolling: touch; 
}
.table-scroll-container thead th { 
    position: sticky; 
    top: 0; 
    z-index: 10; 
    background-color: #2C1D12; 
    color: #d1d5db; 
}


/* ==========================================================================
   4. BANNERS & NOTIFICATIONS
   ========================================================================== */

/* Top Banners (Dummy Data, Offline) */
#dummy-data-banner, #offline-data-banner {
    display: none;
    
    left: 0;
    width: 100%;
    text-align: center;
    padding: 8px 0;
    z-index: 1051;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
#dummy-data-banner {
    top: 0;
    background-color: #d97706; /* Amber 600 */
    color: #fefce8; /* Yellow 50 */
}
#offline-data-banner {
    top: 0;
    background-color: #4b5563; /* Gray 600 */
    color: #ffffff;
}
#dummy-data-banner.visible, #offline-data-banner.visible {
    display: block;
}

/* Toast Notification */
#toast-notification {
    position: fixed;
    top: 50px;
    left: 50%;
    transform: translateX(-50%) translateY(-150%);
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    z-index: 9999;
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
    opacity: 0;
    pointer-events: none;
    min-width: 400px;
    max-width: 90%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
#toast-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}
#toast-notification.success { background-color: #34D399; color: #000000!important; }
#toast-notification.error { background-color: #F87171; color: #000000!important; }

#toast-message {
    flex-grow: 1;
    text-align: left;
}

#toast-close-btn {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    padding: 0 0.5rem;
}

#toast-close-btn:hover {
    opacity: 1;
}


/* ==========================================================================
   5. POPUPS & MODALS (Settings, Onboarding, Confirmation)
   ========================================================================== */

/* Overlays (for modals, menus, onboarding) */
#agreement-modal, /* ADDED */
#onboarding-overlay,
#confirmation-modal,
#hard-refresh-modal,
#optimizer-modal,
#manual-fetch-modal,
#api-key-modal,
#documentation-modal,
#donate-modal { /* ADDED */
    transition: opacity 0.3s ease-in-out;
}
#agreement-modal.visible, /* ADDED */
#onboarding-overlay.visible,
#confirmation-modal.visible,
#hard-refresh-modal.visible,
#optimizer-modal.visible,
#manual-fetch-modal.visible,
#api-key-modal.visible,
#documentation-modal.visible,
#donate-modal.visible { /* ADDED */
    opacity: 1;
}

/* Confirmation Modal */
#confirmation-modal {
    transition-duration: 0.3s;
}

/* Banners (Console Log, AI Prompt) */
#console-log-banner,
#prompt-display-banner {
    transition-duration: 0.3s;
	z-index:9999;
}
#console-log-banner.visible,
#prompt-display-banner.visible {
    opacity: 1;
}
#console-log-output {
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Onboarding */
#onboarding-bubble {
    position: fixed; /* Changed from absolute to fixed for viewport centering */
    top: 9rem;
    left: 11rem;
    transform: translate(-50%, -50%); /* Centering trick */
}
#onboarding-top-arrow {
    animation: bounce-arrow-horizontal 1.5s infinite;
    transform: rotate(90deg);
    transform-origin: center;
	left: 6.25rem;
}
#fetch-AI-data.highlight-onboarding {
    position: relative;
    z-index: 3000; /* Ensure it's on top of the overlay */
    animation: first-time-pulse 2s infinite;
    box-shadow: 0 0 0 0 rgba(216, 180, 254, 1); /* Corresponds to purple-300 */
}

/* Settings Menu */
.settings-menu-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.menu-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.75rem;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    border: none;
}
.menu-btn:active {
    transform: scale(0.98);
}
.menu-btn > svg {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
}
#fetch-ai-data-menu-btn { background-color: #3b82f6; color: #ffffff; }
#translate-khmer-btn { background-color: #14b8a6; color: #ffffff; }
#console-log-btn, #check-for-update-btn, #enable-notifications-btn, #enable-background-service-btn { background-color: #4b5563; color: #e5e7eb; }
.menu-btn-danger-group {
    display: flex;
    gap: 0.5rem;
    padding-top: 0.75rem;
    margin-top: 0.25rem;
    border-top: 1px solid #3A2A1F;
}
.menu-btn.menu-btn-compact {
    flex-grow: 1;
    justify-content: center;
    padding: 0.6rem;
    font-size: 0.8rem;
}
#refresh-cache-btn { background-color: #f59e0b; color: #000000; }
#clear-db-btn { background-color: #ef4444; color: #ffffff; }

/* FIX: Style to disable settings section during app initialization */
.settings-disabled {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.5s ease-in-out;
}

/* UPDATED: App Title Button Style for more visibility */
.app-title-button {
    display: inline-block;
    cursor: pointer;
    padding: 0.5rem 1rem; /* Increased padding */
    border-radius: 0.75rem; /* More rounded */
    border: 1px solid #4b5563; /* Visible border by default (gray-600) */
    background-color: #374151; /* Default background (gray-700) */
    transition: background-color 0.2s, border-color 0.2s, transform 0.1s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2); /* Add a subtle shadow */
}

.app-title-button p {
    color: #d1d5db; /* Lighter text (gray-300) */
    font-size: 0.875rem;
    font-weight: 600; /* Bolder text */
    transition: color 0.2s;
}

.app-title-button:hover {
    background-color: #4b5563; /* Lighter background on hover (gray-600) */
    border-color: #6b7280; /* Lighter border on hover (gray-500) */
}

.app-title-button:hover p {
    color: #ffffff; /* White text on hover */
}

.app-title-button:active {
    transform: scale(0.98); /* Add a click effect */
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}


/* ==========================================================================
   TOOLTIP STYLES
   ========================================================================== */
.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    margin-left: 0.5rem;
    background-color: #4b5563; /* gray-600 */
    color: #e5e7eb; /* gray-200 */
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: bold;
    font-style: italic;
    cursor: help;
    transition: background-color 0.2s, transform 0.2s;
    user-select: none; /* Prevents text selection */
}

.tooltip-icon:hover {
    background-color: #6b7280; /* gray-500 */
    transform: scale(1.1);
}

#tooltip-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: transparent; /* Invisible, just to catch clicks */
    z-index: 9998; /* Below the tooltip, above everything else */
}

#tooltip-container {
    display: none; /* Hide by default */
    position: absolute; /* Changed from fixed for better positioning */
    background-color: #1f2937; /* gray-800 */
    color: #d1d5db; /* gray-300 */
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #374151; /* gray-700 */
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    max-width: 300px;
    font-size: 0.875rem;
    line-height: 1.6;
    z-index: 9999; /* Ensure it's on top of everything */
    pointer-events: none; /* Prevent the tooltip from interfering with mouse events */
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#tooltip-container.visible,
#tooltip-backdrop.visible {
    display: block;
}

#tooltip-container.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   NEW AI FETCH BUTTON STYLES
   ========================================================================== */
.ai-button {
    position: relative;
    padding: 0;
    border: 2px solid #fb923c; /* Orange-400 border */
    background: linear-gradient(145deg, #f97316, #ec4899); /* Orange-600 to Pink-500 */
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2), 
                inset 0 1px 1px rgba(255, 255, 255, 0.25);
}

.ai-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 14px rgba(0, 0, 0, 0.25),
                inset 0 1px 1px rgba(255, 255, 255, 0.25);
}

.ai-button:active {
    transform: translateY(0px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2),
                inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.ai-button-content {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px 3px;
    gap: 8px;
}

.ai-icon-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-icon-brain {
    width: 36px;
    height: 36px;
    fill: #0ea5e9; /* Sky-500 */
    filter: drop-shadow(0px 2px 3px rgba(0,0,0,0.4));
}

.ai-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    font-weight: 900;
    font-family: 'Arial Black', Gadget, sans-serif;
    color: #fde047; /* Yellow-300 */
    text-shadow: 0px 1px 2px rgba(0,0,0,0.5);
}

#fetch-AI-data .spinner {
    width: 28px;
    height: 28px;
    border-width: 3px;
    border-top-color: #fff;
    border-right-color: transparent;
    border-bottom-color: #fff;
    border-left-color: transparent;
}

/* ==========================================================================
   6. NEW SLIDE-UP SETTINGS MENU
   ========================================================================== */

#open-settings-menu-btn {
    background-color: transparent;
    color: #9ca3af; /* gray-400 */
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: color 0.2s, background-color 0.2s;
}
#open-settings-menu-btn:hover {
    background-color: #374151; /* gray-700 */
    color: white;
}
#open-settings-menu-btn.active {
    background-color: #4f46e5; /* indigo-600 */
    color: white;
}
#open-settings-menu-btn.active svg {
    transform: rotate(90deg);
}
#open-settings-menu-btn svg {
    transition: transform 0.5s ease;
}


#bottom-slide-menu-container {
    transition: opacity 0.3s ease-in-out;
}
#bottom-slide-menu-container.visible {
    opacity: 1;
}

#bottom-slide-menu {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
#bottom-slide-menu-container.visible #bottom-slide-menu {
    transform: translateY(0);
}

/* ==========================================================================
   PUNCH ME BUTTON & DONATE BUTTON STYLES
   ========================================================================== */

.punch-me-button, .donate-button {
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.punch-me-button:active, .donate-button:active {
    transform: translateY(2px) scale(0.98);
    box-shadow: 0 2px 3px rgba(0,0,0,0.1);
}

.punch-me-button .emoji, .donate-button .emoji {
    font-size: 1.25rem;
    transition: transform 0.2s;
}

.punch-me-button:active .emoji, .donate-button:active .emoji {
    transform: scale(1.2) rotate(-10deg);
}

/* Punch Me Button States */
.punch-me-button.state-0 { background-color: #22c55e; color: #1f2937; }
.punch-me-button.state-1 { background-color: #facc15; color: #1f2937; }
.punch-me-button.state-2 { background-color: #f97316; color: white; }
.punch-me-button.state-3 { background-color: #a855f7; color: white; }
.punch-me-button.state-4 { background-color: #ef4444; color: white; }

/* Donate Button Style */
.donate-button {
    background-color: #ec4899; /* pink-500 */
    color: white;
}

/* Donate Modal Styles */
.address-item label {
    display: block;
    font-weight: 600;
    color: #9ca3af; /* gray-400 */
    margin-bottom: 0.5rem;
}
.address-box {
    display: flex;
    align-items: center;
    background-color: #1f2937; /* gray-800 */
    border: 1px solid #4b5563; /* gray-600 */
    border-radius: 0.5rem;
    padding: 0.5rem;
}
.address-text {
    flex-grow: 1;
    font-family: monospace;
    color: #e5e7eb; /* gray-200 */
    word-break: break-all;
    padding-right: 0.5rem;
}
.copy-address-btn {
    flex-shrink: 0;
    background-color: #4f46e5; /* indigo-600 */
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.2s;
}
.copy-address-btn:hover {
    background-color: #4338ca; /* indigo-700 */
}

/* ==========================================================================
   APP FOOTER
   ========================================================================== */
.app-footer {
    text-align: center;
    padding: 1.5rem 1rem;
    margin-top: 2rem;
    border-top: 1px solid #374151; /* gray-700 */
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
}

.app-footer a {
    color: #9ca3af; /* gray-400 */
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.app-footer a:hover {
    color: #60a5fa; /* blue-400 */
    text-decoration: underline;
}

/* FIX: New styles for colorful donate modal */
.donate-modal-content {
    background: linear-gradient(145deg, #1e1b4b, #172554); /* Dark indigo to dark blue */
    border: 1px solid #4f46e5; /* Indigo-600 border */
}

.donate-modal-content h3 {
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.qr-code-image {
    border-radius: 0.75rem; /* rounded-xl */
    border: 2px solid #4b5563; /* gray-600 */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.qr-code-image:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.address-item[data-crypto-type] {
    padding: 1rem;
    border-radius: 0.75rem;
    border-left-width: 5px;
    background-color: rgba(255, 255, 255, 0.03);
    transition: background-color 0.2s ease;
}

.address-item[data-crypto-type]:hover {
    background-color: rgba(255, 255, 255, 0.07);
}

.address-item[data-crypto-type="eth"] { border-left-color: #60a5fa; } /* blue-400 */
.address-item[data-crypto-type="arb"] { border-left-color: #2dd4bf; } /* teal-400 */
.address-item[data-crypto-type="sol"] { border-left-color: #f472b6; } /* pink-400 */
.address-item[data-crypto-type="ton"] { border-left-color: #38bdf8; } /* lightBlue-400 */

.address-item[data-crypto-type] label {
    font-size: 1.125rem; /* text-lg */
    font-weight: 700;
    color: #e5e7eb; /* gray-200 */
}

.address-item[data-crypto-type] .address-box {
    background-color: #111827; /* gray-900 */
    border-color: #374151; /* gray-700 */
}

.address-item[data-crypto-type] .copy-address-btn {
    background-color: transparent;
    border: 1px solid currentColor;
    transition: all 0.2s ease;
}

.address-item[data-crypto-type="eth"] .copy-address-btn { color: #60a5fa; }
.address-item[data-crypto-type="arb"] .copy-address-btn { color: #2dd4bf; }
.address-item[data-crypto-type="sol"] .copy-address-btn { color: #f472b6; }
.address-item[data-crypto-type="ton"] .copy-address-btn { color: #38bdf8; }

.address-item[data-crypto-type] .copy-address-btn:hover {
    background-color: currentColor;
    color: #111827; /* gray-900 */
}

/* ==========================================================================
   7. ANIMATIONS & KEYFRAMES
   ========================================================================== */

/* Generic spinner animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.4);
    border-top: 3px solid #ffffff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 0.8s linear infinite;
}

/* Fetch button icon animation */
#fetch-AI-data svg#fetch-action-icon {
    transition: transform 0.3s ease-in-out;
}
#fetch-AI-data:hover:not(:disabled) svg#fetch-action-icon:not(.no-hover-effect) {
    transform: rotate(180deg) scale(1.1);
}
#fetch-AI-data:active:not(:disabled) svg#fetch-action-icon:not(.no-hover-effect) {
    transform: rotate(360deg) scale(1);
}

/* Onboarding pulse animation */
@keyframes first-time-pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(216, 180, 254, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 12px rgba(216, 180, 254, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(216, 180, 254, 0);
    }
}

/* Onboarding arrow bounce animation */
@keyframes bounce-arrow-horizontal {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(0) rotate(90deg);
    }
    40% {
        transform: translateX(-15px) rotate(90deg);
    }
    60% {
        transform: translateX(-7px) rotate(90deg);
    }
}

/* Auto-refresh indicator glow - OPTIMIZED */
@keyframes aura-glow {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.7;
    }
    70% {
        transform: translate(-50%, -50%) scale(3);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
}

/* AI Button Loading Animation */
.ai-button.loading {
    animation: ai-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes ai-pulse {
    50% {
        transform: scale(1.05);
        box-shadow: 0 10px 15px -3px rgb(249 115 22 / 0.2), 0 4px 6px -4px rgb(249 115 22 / 0.2);
    }
}

/* Content Card Animations */
@keyframes slideUpFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.content-card {
    opacity: 0;
    transform: translateY(25px);
    animation: slideUpFadeIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
#sentiment-section.content-card { animation-delay: 0.1s; }
#trend-signal-section.content-card { animation-delay: 0.2s; }
#ai-insights-section.content-card { animation-delay: 0.3s; }
#pattern-insights-section.content-card { animation-delay: 0.4s; }
#anticipated-events-section.content-card { animation-delay: 0.5s; }
#candlestick-chart-section.content-card { animation-delay: 0.6s; }
#sr-dashboard-section.content-card { animation-delay: 0.7s; }
#candle-data-section.content-card { animation-delay: 0.8s; }


/* Rolling Digit Animation */
.digit-display-wrapper {
    height: 2.25rem; /* Match font size 2xl line-height */
}
.digit-display {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    font-variant-numeric: tabular-nums;
}
.digit-char-container {
    display: inline-block;
    height: 2rem; /* h-8 */
    line-height: 2rem; /* leading-8 */
    overflow: hidden;
}
.digit-reel {
    display: inline-block;
    transition: transform 0.8s cubic-bezier(0.645, 0.045, 0.355, 1);
}
.digit-reel > div {
    height: 2rem;
}
.digit-static {
    display: inline-block;
    height: 2rem;
    line-height: 2rem;
}

/* Laser Beam Loading Animation - MODIFIED */
#laser-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998; /* Below modals but above content */
    pointer-events: none;
    overflow: hidden;
}

#laser-loading-overlay.loading {
    display: block;
}

.laser-beam {
    position: absolute;
    background: linear-gradient(90deg, transparent, #fb923c, transparent);
    box-shadow: 0 0 10px #fb923c, 0 0 20px #fb923c, 0 0 30px #f97316;
    opacity: 0;
    animation: laser-fade 2.5s linear infinite; /* Apply new fade animation */
}

.laser-beam.top { top: 0; left: 0; width: 100%; height: 3px; animation-delay: 0s; }
.laser-beam.right { top: 0; right: 0; width: 3px; height: 100%; animation-delay: 0.6s; }
.laser-beam.bottom { bottom: 0; left: 0; width: 100%; height: 3px; animation-delay: 1.2s; }
.laser-beam.left { top: 0; left: 0; width: 3px; height: 100%; animation-delay: 1.8s; }

/* New fade-in/out keyframe for the laser effect */
@keyframes laser-fade {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}


/* Super Trend Beam Shadow - MODIFIED */
.super-trend-beam {
    /* The animation property has been removed. */
    /* A subtle drop-shadow provides a static glow effect. */
    /* The main blur effect is handled by the SVG filter in chartOverlays.js */
    opacity: 0.7;
    filter: drop-shadow(0 0 3px currentColor);
}

/* Punch Me Button Animation */
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-5px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(5px);
  }
}
