/* Remove empty space from dcc.Tabs tab-content divs */
.tab-content {
    padding: 0 !important;
    margin: 0 !important;
    min-height: 0 !important;
}

/* Dashboard Grid Preview Hover Effect */
.dashboard-card-content:hover .dashboard-hover-overlay {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Smooth transitions for grid icons */
.dashboard-grid-preview > div > div:hover {
    transform: scale(1.1);
}

/* Recently Viewed Dashboard Cards Hover Effect */
.view-dashboard-btn {
    position: relative;
}

.view-dashboard-btn:hover {
    background-color: #0056b3 !important;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,123,255,0.4) !important;
}

.view-dashboard-btn::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background-color: #2c3e50;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.view-dashboard-btn::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #2c3e50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.view-dashboard-btn:hover::after,
.view-dashboard-btn:hover::before {
    opacity: 1;
}

/* Dashboard Action Buttons Hover Effects */
.dashboard-action-btn {
    position: relative;
}

.dashboard-action-btn:hover {
    transform: scale(1.08);
}

.dashboard-action-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background-color: #2c3e50;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.dashboard-action-btn::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #2c3e50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.dashboard-action-btn:hover::after,
.dashboard-action-btn:hover::before,
.dashboard-action-btn:disabled:hover::after,
.dashboard-action-btn:disabled:hover::before {
    opacity: 1;
}

/* Specific color overrides for different action buttons */
.dashboard-action-present:hover {
    background-color: #138496 !important;
    box-shadow: 0 4px 8px rgba(23,162,184,0.5) !important;
}

.dashboard-action-edit:hover {
    background-color: #e0a800 !important;
    box-shadow: 0 4px 8px rgba(255,193,7,0.5) !important;
}

.dashboard-action-share:hover {
    background-color: #218838 !important;
    box-shadow: 0 4px 8px rgba(40,167,69,0.5) !important;
}

.dashboard-action-manage:hover {
    background-color: #545b62 !important;
    box-shadow: 0 4px 8px rgba(108,117,125,0.5) !important;
}

.dashboard-action-duplicate:hover {
    background-color: #0056b3 !important;
    box-shadow: 0 4px 8px rgba(0,123,255,0.5) !important;
}

.dashboard-action-delete:hover {
    background-color: #c82333 !important;
    box-shadow: 0 4px 8px rgba(220,53,69,0.5) !important;
}

/* Refresh Dashboard Cards Button */
.refresh-dashboard-btn:hover {
    background-color: #e9ecef !important;
    border-color: #adb5bd !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15) !important;
}

.refresh-dashboard-btn:active i {
    animation: spin 0.5s ease-in-out;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Brand option items hover */
.brand-option-item:hover {
    background-color: #e8f4f8 !important;
    border-color: #007bff !important;
}

/* OAuth Popup Mode Styles - Hide navbar and sidebar */
/* Apply immediately based on URL or body class */
body.oauth-popup #navbar,
html.oauth-popup #navbar {
    display: none !important;
}

body.oauth-popup #sidebar,
html.oauth-popup #sidebar {
    display: none !important;
}

body.oauth-popup #main-content-container,
html.oauth-popup #main-content-container {
    margin-left: 0 !important;
    padding-top: 0 !important;
    width: 100% !important;
}

/* Ensure popup content fills the window */
body.oauth-popup,
html.oauth-popup {
    overflow-y: auto;
}

body.oauth-popup #page-content,
html.oauth-popup #page-content {
    padding: 0 !important;
    margin: 0 !important;
}

/* Hide navbar/sidebar immediately on select-property page (before JS runs) */
/* This prevents the flash of the main app layout */
body:has([id*="select-property"]) #navbar,
body[data-page="select-property"] #navbar {
    display: none !important;
}

body:has([id*="select-property"]) #sidebar,
body[data-page="select-property"] #sidebar {
    display: none !important;
}

body:has([id*="select-property"]) #main-content-container,
body[data-page="select-property"] #main-content-container {
    margin-left: 0 !important;
    padding-top: 0 !important;
    width: 100% !important;
}

/* ============================================================================
   AI FEATURE HIGHLIGHTING STYLES
   ============================================================================ */

/* AI Feature Button Container - Adds positioning context for badge */
.ai-feature-btn-wrapper {
    position: relative;
    display: inline-block;
    margin-right: 8px;
}

/* AI Badge Overlay - Small "AI" text in top-right corner */
.ai-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 4px;
    border-radius: 4px;
    z-index: 10;
    pointer-events: none;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.6);
    letter-spacing: 0.5px;
    line-height: 1;
}

/* Auto-Generate Button (Data Sources) - AI Feature Styling */
.ai-auto-generate-btn {
    position: relative;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #9C27B0 100%) !important;
    color: white !important;
    border: 3px solid rgba(255, 215, 0, 0.8) !important;
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    font-size: 20px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4), 0 0 20px rgba(156, 39, 176, 0.3) !important;
    animation: ai-pulse 2s ease-in-out infinite !important;
    margin-right: 8px !important;
}

.ai-auto-generate-btn:hover {
    transform: scale(1.15) !important;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.6), 0 0 30px rgba(156, 39, 176, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.9) !important;
}

.ai-auto-generate-btn:active {
    transform: scale(1.05) !important;
}

/* Tooltips for AI Auto-Generate Button and wrapper spans */
.ai-auto-generate-btn::after,
span[data-tooltip]::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background-color: #2c3e50;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

span[data-tooltip]::after {
    content: attr(data-tooltip);
}

.ai-auto-generate-btn::before,
span[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #2c3e50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.ai-auto-generate-btn:hover::after,
.ai-auto-generate-btn:hover::before,
span[data-tooltip]:hover::after,
span[data-tooltip]:hover::before {
    opacity: 1;
}

/* Audio Summary Button (Dashboard Cards) - AI Feature Styling */
.dashboard-action-audio.ai-feature {
    position: relative;
    background: linear-gradient(135deg, #6f42c1 0%, #9b59b6 50%, #4a90e2 100%) !important;
    color: white !important;
    border: 3px solid rgba(111, 66, 193, 0.8) !important;
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    font-size: 20px !important;
    margin: 4px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 12px rgba(111, 66, 193, 0.4), 0 0 20px rgba(74, 144, 226, 0.3) !important;
    animation: ai-pulse 2s ease-in-out infinite !important;
    order: -1 !important; /* Move to first position */
}

.dashboard-action-audio.ai-feature:hover {
    transform: scale(1.15) !important;
    box-shadow: 0 6px 20px rgba(111, 66, 193, 0.6), 0 0 30px rgba(74, 144, 226, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.9) !important;
}

.dashboard-action-audio.ai-feature:active {
    transform: scale(1.05) !important;
}

/* Pulsing Glow Animation for AI Features */
@keyframes ai-pulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4), 0 0 20px rgba(156, 39, 176, 0.3);
    }
    50% {
        box-shadow: 0 6px 16px rgba(255, 215, 0, 0.6), 0 0 30px rgba(156, 39, 176, 0.5);
    }
}

/* Audio Summary AI Pulse (different colors) */
@keyframes ai-pulse-audio {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(111, 66, 193, 0.4), 0 0 20px rgba(74, 144, 226, 0.3);
    }
    50% {
        box-shadow: 0 6px 16px rgba(111, 66, 193, 0.6), 0 0 30px rgba(74, 144, 226, 0.5);
    }
}

.dashboard-action-audio.ai-feature {
    animation: ai-pulse-audio 2s ease-in-out infinite !important;
}

/* Sparkle Effect on Hover (Optional Enhancement) */
.ai-feature-btn-wrapper::after {
    content: '✨';
    position: absolute;
    top: -8px;
    left: -8px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    animation: sparkle-float 1.5s ease-in-out infinite;
}

.ai-feature-btn-wrapper:hover::after {
    opacity: 1;
}

@keyframes sparkle-float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    50% {
        transform: translate(-2px, -2px) rotate(10deg);
    }
}

/* AI Button States (Loading/Processing) */
.ai-auto-generate-btn.processing,
.dashboard-action-audio.ai-feature.processing {
    animation: ai-spin 1.5s linear infinite !important;
    pointer-events: none !important;
    opacity: 0.8 !important;
}

@keyframes ai-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Locked State for AI Buttons (subscription required) - Higher specificity to override disabled */
.ai-auto-generate-btn.locked:disabled {
    opacity: 1 !important;
    cursor: not-allowed !important;
    animation: none !important;
    background: #f8f9fa !important;
    border: 2px solid #dee2e6 !important;
    box-shadow: none !important;
}

.ai-auto-generate-btn.locked:disabled i.fa-magic {
    /* Use gradient color from normal state with reduced opacity */
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #9C27B0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0.7 !important;
}

.ai-auto-generate-btn.locked:disabled i.fa-lock {
    color: #495057 !important; /* Grey lock */
    opacity: 1 !important;
}

/* Locked State for Audio Summary Buttons (subscription required) */
.dashboard-action-audio.locked:disabled {
    cursor: not-allowed !important;
    animation: none !important;
    background: linear-gradient(135deg, rgba(111, 66, 193, 0.2) 0%, rgba(155, 89, 182, 0.2) 50%, rgba(74, 144, 226, 0.2) 100%) !important;
    border: 2px solid rgba(111, 66, 193, 0.3) !important;
    box-shadow: 0 2px 8px rgba(111, 66, 193, 0.15) !important;
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 1 !important;
}

.dashboard-action-audio.locked:disabled span {
    /* Keep emoji fully visible with original colors */
    opacity: 1 !important;
    filter: none !important;
    font-size: 20px !important;
}

/* Disabled State for AI Buttons (non-locked) */
.ai-auto-generate-btn:disabled:not(.locked),
.dashboard-action-audio.ai-feature:disabled:not(.locked) {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    animation: none !important;
    background: #6c757d !important;
    border-color: #5a6268 !important;
}

/* Make action buttons container use flexbox for ordering */
.dashboard-card-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
}

/* Data Source Action Buttons (matching dashboard card style) */
.data-source-action-btn {
    position: relative;
}

.data-source-action-btn:hover {
    transform: scale(1.08);
}

/* Hide default browser tooltip for action buttons (we use custom CSS tooltip) */
.data-source-action-btn,
.dashboard-action-btn {
    position: relative;
}

/* Custom CSS tooltips read from data-tooltip attribute (not title) to avoid browser default tooltips */
.data-source-action-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background-color: #2c3e50;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.data-source-action-btn::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #2c3e50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.data-source-action-btn:hover::after,
.data-source-action-btn:hover::before {
    opacity: 1;
}

/* Specific hover effects for each data source button type (matching dashboard style) */
/* View Details button (Blue) */
.data-source-action-btn[id*='btn-view-source']:hover {
    background-color: #0056b3 !important;
    box-shadow: 0 4px 8px rgba(0,123,255,0.5) !important;
}

/* Sync button (Teal) */
.data-source-action-btn[id*='btn-sync-source']:hover {
    background-color: #138496 !important;
    box-shadow: 0 4px 8px rgba(23,162,184,0.5) !important;
}

/* Create Charts button (Green) */
.data-source-action-btn[id*='btn-create-charts']:hover {
    background-color: #218838 !important;
    box-shadow: 0 4px 8px rgba(40,167,69,0.5) !important;
}

/* Restore button (Green) */
.data-source-action-btn[id*='btn-restore-source']:hover {
    background-color: #218838 !important;
    box-shadow: 0 4px 8px rgba(40,167,69,0.5) !important;
}

/* Delete/Archive button (Red) */
.data-source-action-btn[id*='btn-delete-source']:hover {
    background-color: #c82333 !important;
    box-shadow: 0 4px 8px rgba(220,53,69,0.5) !important;
}

/* Data Source Card Actions Container (matching dashboard style) */
.data-source-card-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
}

/* Brand Manager Action Buttons (matching data source card style) */
.brand-action-btn {
    position: relative;
}

.brand-action-btn:hover {
    transform: scale(1.08);
}

.brand-action-btn::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background-color: #2c3e50;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.brand-action-btn::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #2c3e50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.brand-action-btn:hover::after,
.brand-action-btn:hover::before {
    opacity: 1;
}

/* Specific hover effects for brand action buttons */
/* Edit button (Yellow) */
.brand-action-btn[id*='btn-edit-brand']:hover {
    background-color: #e0a800 !important;
    box-shadow: 0 4px 8px rgba(255,193,7,0.5) !important;
}

/* Delete button (Red) */
.brand-action-btn[id*='btn-delete-brand']:hover {
    background-color: #c82333 !important;
    box-shadow: 0 4px 8px rgba(220,53,69,0.5) !important;
}

/* Brand Card Actions Container */
.brand-card-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
}

/* ============================================================================
   UNIVERSAL CARD HOVER EFFECTS
   ============================================================================ */

/* Standard card hover effect - Use for most card-based views */
.card-hover-effect {
    transition: all 0.2s ease;
    cursor: pointer;
}

.card-hover-effect:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(79, 70, 229, 0.2) !important;
    border-color: rgba(79, 70, 229, 0.5) !important;
}

/* Subtle hover effect - Use for conservative/minimal styling */
.card-hover-effect-subtle {
    transition: all 0.2s ease;
    cursor: pointer;
}

.card-hover-effect-subtle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(79, 70, 229, 0.15) !important;
    border-color: rgba(79, 70, 229, 0.3) !important;
}

/* Elevated hover effect - Use for prominent cards */
.card-hover-effect-elevated {
    transition: all 0.2s ease;
    cursor: pointer;
}

.card-hover-effect-elevated:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15) !important;
    border-color: rgba(79, 70, 229, 0.3);
}

/* Fix for missing hover-shadow class (backward compatibility) */
.hover-shadow {
    transition: all 0.2s ease;
    cursor: pointer;
}

.hover-shadow:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(79, 70, 229, 0.2) !important;
    border-color: rgba(79, 70, 229, 0.5) !important;
}

/* Chart Library card hover effect */
.chart-library-card:hover .chart-card-inner {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(79, 70, 229, 0.2) !important;
    border-color: rgba(79, 70, 229, 0.5) !important;
}
