/* Updated styles.css with improved responsive design */

:root {
    --primary-color: #1a1a1a;
    --secondary-color: #333333;
    --accent-color: #ff8034;
    --text-light: #ffffff;
    --text-gray: #aaaaaa;
    --bg-dark: #121212;
    --bg-secondary: #202020;
    --bg-light: #2a2a2a;
    --sidebar-width: 280px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    background-color: #f8f9fa;
    overflow-x: hidden;
}

/* Improved Responsive Cards */
.card {
    height: 100%;
    transition: all 0.2s ease;
    border: 1px solid rgba(0,0,0,0.1);
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
}

.card-body {
    display: flex;
    flex-direction: column;
}

.metric-cards .card {
    background-color: #f8f9fa;
}

/* Domain Detail Layout */
.domain-header {
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.domain-name {
    font-weight: 700;
    color: #333;
}

.domain-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    color: #666;
    font-size: 0.9rem;
}

.domain-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.badge-ml {
    background-color: rgba(255, 128, 52, 0.2);
    color: var(--accent-color);
}

.badge-vertical {
    background-color: rgba(108, 117, 125, 0.1);
    color: #6c757d;
}

/* Table Responsive Design */
.table-responsive {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

/* Column Visibility Dropdown */
.column-visibility-dropdown {
    z-index: 100;
}

.column-visibility-dropdown .dropdown-menu {
    max-height: 350px;
    overflow-y: auto;
    padding: 0;
}

.column-visibility-dropdown .form-check {
    margin-bottom: 0.5rem;
}

/* Chart Improvements */
.card-header {
    border-bottom: 1px solid #eee;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .domain-name {
        font-size: 1.4rem;
    }
    
    .domain-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .column-visibility-control {
        width: 100%;
        margin-top: 0.5rem;
    }
    
    .domain-daily-table-container {
        overflow-x: auto;
    }
}

/* Make Dash DataTable more responsive */
.dash-table-container {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
}

.dash-spreadsheet-container {
    overflow-x: auto !important;
}

.dash-spreadsheet {
    overflow-x: auto !important;
}

/* Fix chart responsiveness */
.js-plotly-plot, .plot-container {
    width: 100% !important;
}

.plotly, .main-svg {
    width: 100% !important;
}

.modern-loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    padding: 2rem;
    position: relative;
}

.modern-loading-dots {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.modern-loading-dot {
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    animation: dots-loading 1.4s ease-in-out infinite both;
}

.modern-loading-dot:nth-child(1) { animation-delay: -0.32s; }
.modern-loading-dot:nth-child(2) { animation-delay: -0.16s; }
.modern-loading-dot:nth-child(3) { animation-delay: 0s; }

.modern-loading-text {
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    animation: fade-in-out 2s ease-in-out infinite;
}

/* Skeleton Loading for Cards */
.loading-skeleton {
    background: linear-gradient(
        90deg,
        #f0f2f5 25%,
        #e4e7eb 50%,
        #f0f2f5 75%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite linear;
    border-radius: 8px;
}

.metric-card-skeleton {
    min-height: 140px;
    padding: 20px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.skeleton-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.skeleton-icon {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    border-radius: 4px;
}

.skeleton-title {
    width: 60%;
    height: 12px;
    border-radius: 4px;
}

.skeleton-value {
    width: 80%;
    height: 28px;
    margin-bottom: 12px;
    border-radius: 6px;
}

.skeleton-trend {
    width: 70%;
    height: 14px;
    margin-bottom: 6px;
    border-radius: 4px;
}

.skeleton-trend:last-child {
    width: 60%;
    margin-bottom: 0;
}

/* Chart Loading Skeleton */
.chart-loading-skeleton {
    min-height: 450px;
    background: white;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chart-skeleton-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chart-skeleton-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
}

.chart-skeleton-title {
    width: 200px;
    height: 20px;
    border-radius: 4px;
}

.chart-skeleton-subtitle {
    width: 300px;
    height: 14px;
    border-radius: 4px;
    margin-top: 8px;
}

.chart-skeleton-body {
    flex: 1;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.chart-skeleton-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.dash-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60px;
    padding: 20px;
}

.revenue-forecast-container .dash-loading,
.enhanced-metric-tile .dash-loading,
.chart-loading-skeleton .dash-loading {
    min-height: 200px;
}

.modern-loading-container .dash-spinner,
.chart-loading-skeleton .dash-spinner,
.metric-card-skeleton .dash-spinner {
    border: 3px solid #f3f4f6 !important;
    border-top: 3px solid #667eea !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    animation: spin 1s linear infinite !important;
}

/* Top card metrics loading styles */
#top-card-metrics-loading .dash-loading {
    min-height: 150px;
    background-color: transparent;
}

#top-card-metrics-loading .dash-spinner {
    width: 50px;
    height: 50px;
    border-width: 4px;
    border-top-color: #007bff !important;
    border-right-color: transparent !important;
    border-bottom-color: transparent !important;
    border-left-color: transparent !important;
}

/* Bootstrap placeholder improvements */
.placeholder-glow .placeholder {
    animation: shimmer 2s infinite linear;
    background: linear-gradient(to right, #f0f0f0 8%, #e0e0e0 18%, #f0f0f0 33%);
    background-size: 1000px 100%;
}

/* Card loading skeleton improvements */
.placeholder-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 1rem;
    text-align: center;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.placeholder-card .placeholder {
    border-radius: 4px;
    margin: 0 auto;
}

.dashboard-container {
    display: block;
    min-height: 100vh;
    width: 100%;
}

/* Logo styling */
.logo {
    height: 40px;
    margin-bottom: 1rem;
}


.section-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #eee;
    margin-left: 0.5rem;
}

.filter-group {
    margin-bottom: 1rem;
    position: relative;
}

.filter-label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    color: #666;
    font-weight: 500;
}

.filter-input, .filter-select {
    width: 100%;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    color: #333;
    padding: 0.6rem 0.75rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: all 0.2s;
}

.filter-input:focus, .filter-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(255,128,52,0.15);
    outline: none;
}

/* Enhanced date picker styling */
.date-picker {
    cursor: pointer;
    width: 100% !important;
}

/* Ensure the date picker container takes full width */
.filter-group .DateInput_input {
    width: 100%;
    font-size: 0.9rem;
    padding: 8px 10px;
    border-radius: 4px;
}

/* Make the entire DatePicker component take full width */
.filter-group .SingleDatePickerInput {
    width: 100%;
    display: block;
}

.filter-group .SingleDatePicker {
    width: 100%;
    display: block;
}

/* Ensure the calendar portal appears properly */
.SingleDatePickerInput__withBorder {
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

/* Make date input look consistent with other inputs */
.DateInput {
    width: 100%;
}

.DateInput_input {
    font-weight: 400;
    color: #333;
}

/* Style the calendar when it appears */
.DayPicker {
    box-shadow: 0 2px 15px rgba(0,0,0,0.15);
    border-radius: 6px;
}

/* Style the selected day */
.CalendarDay__selected {
    background-color: var(--accent-color) !important;
    border: 1px solid var(--accent-color) !important;
}

.CalendarDay__selected:hover {
    background-color: var(--accent-color) !important;
    color: white !important;
}

.date-range-presets {
    margin-bottom: 1rem;
}

.preset-btn {
    flex: 1;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 4px;
    border-color: #e0e0e0;
}

.preset-btn.active {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

.apply-filters-btn {
    width: 100%;
    background-color: var(--accent-color);
    border: none;
    color: white;
    padding: 0.75rem;
    border-radius: 4px;
    font-weight: 600;
    margin-top: 1rem;
    transition: all 0.25s;
    box-shadow: 0 2px 6px rgba(255,128,52,0.3);
}

.apply-filters-btn:hover {
    background-color: #e56a20;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255,128,52,0.4);
}

.apply-filters-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(255,128,52,0.3);
}

/* Custom styles for dropdowns */
.filter-select .Select-control {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    height: auto;
    min-height: 38px;
}

.filter-select .Select-control:hover {
    border-color: #ccc;
}

.filter-select .Select-menu-outer {
    border-radius: 0 0 4px 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.filter-select .Select-option {
    padding: 10px 12px;
}

.filter-select .Select-option.is-focused {
    background-color: rgba(255,128,52,0.05);
}

.filter-select .Select-option.is-selected {
    background-color: rgba(255,128,52,0.1);
    color: #333;
}

/* Custom checkbox styling */
.filter-checkbox .custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.filter-checkbox .custom-control-label {
    font-size: 0.85rem;
    color: #555;
}

/* Main Content Styles - Full width without sidebar */
.main-content {
    flex: 1;
    margin-left: 0;
    padding: 1.5rem 2rem;
    background-color: #f8f9fa;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
}

.page-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #333;
}

/* Chart Tabs */
.chart-tabs {
    margin-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    overflow-x: auto;
}

.chart-tab {
    border: none;
    background: none;
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    color: #666;
    opacity: 0.7;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}


.chart-tab.active {
    opacity: 1;
    border-bottom-color: var(--accent-color);
    color: #333;
}

.chart-graph {
    height: 250px;
}
.domain-table-section {
    overflow-x: auto;
    margin-bottom: 2rem;
}

.domain-table-section .dash-table-container {
    min-width: 100%;
}
.chart-dropdown {
    width: 140px;
    font-size: 12px;
}
.domain-table-section .dash-cell {
    font-size: 12px;
    padding: 6px;
    min-width: 80px;
    max-width: 150px;
    white-space: normal;
    text-overflow: ellipsis;
    overflow: hidden;
}
@media (max-width: 768px) {
    .chart-graph {
        height: 200px;
    }
}
/* Domain Selection with Virtualized Scroll */
.domain-selector-container {
    margin-bottom: 2rem;
}

.domain-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.domain-count {
    font-size: 0.9rem;
    color: #666;
}

.domain-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-height: 120px;
    overflow-y: auto;
    padding: 0.5rem;
    background-color: #fff;
    border-radius: 6px;
    border: 1px solid #ddd;
    scrollbar-width: thin;
}

.domain-chip {
    padding: 0.5rem 1rem;
    background-color: #f1f1f1;
    color: #333;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.domain-chip:hover {
    background-color: #e0e0e0;
}

.domain-chip.active {
    background-color: var(--accent-color);
    color: white;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.summary-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.summary-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 0.5rem;
}

.summary-card-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #333;
}

.summary-card-change {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.summary-card-change.positive {
    color: #28a745;
}

.summary-card-change.negative {
    color: #dc3545;
}

/* Domain Detail Panel */
.domain-detail {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.domain-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.domain-info {
    flex: 1;
    min-width: 300px;
}

.domain-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
}

.domain-meta {
    display: flex;
    gap: 2rem;
    color: #666;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.domain-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.domain-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.domain-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-ml {
    background-color: rgba(255, 128, 52, 0.2);
    color: var(--accent-color);
}

.badge-vertical {
    background-color: rgba(108, 117, 125, 0.1);
    color: #6c757d;
}

/* ML Implementation Date Marker */
.ml-date-marker {
    color: var(--accent-color);
    border-left: 2px solid var(--accent-color);
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    background-color: rgba(255, 128, 52, 0.1);
    border-radius: 0 4px 4px 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* Metric Cards Grid */
.metric-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.metric-card {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1.25rem;
}

.enhanced-metric-card {
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: default;
}

.enhanced-metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-color: #cbd5e0;
}

.enhanced-metric-card:hover .fas:not(.fa-arrow-up):not(.fa-arrow-down):not(.fa-star) {
    color: #4a5568 !important;
}

.enhanced-metric-card:hover .fw-bold.text-uppercase {
    color: #4a5568 !important;
}

@media (max-width: 768px) {
    .enhanced-metric-card {
        padding: 16px;
        border-radius: 8px;
    }
    
    .enhanced-metric-card .metric-value {
        font-size: 24px !important;
    }
    
    .enhanced-metric-card .metric-icon {
        font-size: 16px !important;
    }
    
    .metrics-tiles.row [class*="col-"] {
        margin-bottom: 1rem;
    }
    
    .metrics-tiles.row [class*="col-"]:last-child {
        margin-bottom: 0;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.enhanced-metric-card {
    animation: slideInUp 0.5s ease-out;
}

.enhanced-metric-card:nth-child(1) { animation-delay: 0.1s; }
.enhanced-metric-card:nth-child(2) { animation-delay: 0.2s; }
.enhanced-metric-card:nth-child(3) { animation-delay: 0.3s; }

/* User Management Table Styling */
.card-body .table tbody,
.table tbody {
    border-style: hidden !important;
}

.card-body .table tbody tr,
.table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.2s ease;
}

.card-body .table tbody tr:hover,
.table tbody tr:hover {
    background-color: #f7fafc;
}

.card-body .table tbody tr:last-child,
.table tbody tr:last-child {
    border-bottom: none !important;
}

.geo-metric-btn, .device-metric-btn, .os-metric-btn, .browser-metric-btn, .segment-media-type-btn, .throttled-metric-btn {
    background-color: #f8f9fa !important;
    border-color: rgba(0,0,0,0.15) !important;
    color: #495057 !important;
}

.geo-metric-btn:hover, .device-metric-btn:hover, .os-metric-btn:hover, .browser-metric-btn:hover, .segment-media-type-btn:hover, .throttled-metric-btn:hover {
    background-color: #e9ecef !important;
    border-color: rgba(0,0,0,0.2) !important;
    color: #495057 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

.geo-metric-btn:active, .device-metric-btn:active, .os-metric-btn:active, .browser-metric-btn:active, .segment-media-type-btn:active, .throttled-metric-btn:active {
    background-color: #dee2e6 !important;
    border-color: rgba(0,0,0,0.25) !important;
    color: #495057 !important;
    transform: translateY(0);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1) !important;
}

.geo-metric-btn:focus, .device-metric-btn:focus, .os-metric-btn:focus, .browser-metric-btn:focus, .segment-media-type-btn:focus, .throttled-metric-btn:focus {
    background-color: #f8f9fa !important;
    border-color: rgba(0,0,0,0.15) !important;
    color: #495057 !important;
    box-shadow: none !important;
    outline: none !important;
}

.geo-metric-btn.active, .device-metric-btn.active, .os-metric-btn.active, .browser-metric-btn.active, .segment-media-type-btn.active, .throttled-metric-btn.active {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.2) !important;
}

.geo-metric-btn.active:focus, .device-metric-btn.active:focus, .os-metric-btn.active:focus, .browser-metric-btn.active:focus, .segment-media-type-btn.active:focus, .throttled-metric-btn.active:focus {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.2) !important;
    outline: none !important;
}

.geo-metric-btn.active:hover, .device-metric-btn.active:hover, .os-metric-btn.active:hover, .browser-metric-btn.active:hover, .segment-media-type-btn.active:hover, .throttled-metric-btn.active:hover {
    background-color: #5a6268 !important;
    border-color: #5a6268 !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.2) !important;
}

/* Override Bootstrap's default button colors for our specific classes */
.btn-light.geo-metric-btn, .btn-light.device-metric-btn, .btn-light.os-metric-btn, .btn-light.browser-metric-btn, .btn-light.segment-media-type-btn, .btn-light.throttled-metric-btn {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.2) !important;
}

.btn-outline-light.geo-metric-btn, .btn-outline-light.device-metric-btn, .btn-outline-light.os-metric-btn, .btn-outline-light.browser-metric-btn, .btn-outline-light.segment-media-type-btn, .btn-outline-light.throttled-metric-btn {
    background-color: #f8f9fa !important;
    border-color: rgba(0,0,0,0.15) !important;
    color: #495057 !important;
}

/* Handle all possible button states more explicitly */
.btn-light.geo-metric-btn:hover, .btn-light.device-metric-btn:hover, .btn-light.os-metric-btn:hover, .btn-light.browser-metric-btn:hover, .btn-light.segment-media-type-btn:hover, .btn-light.throttled-metric-btn:hover {
    background-color: #5a6268 !important;
    border-color: #5a6268 !important;
    color: #ffffff !important;
}

.btn-outline-light.geo-metric-btn:hover, .btn-outline-light.device-metric-btn:hover, .btn-outline-light.os-metric-btn:hover, .btn-outline-light.browser-metric-btn:hover, .btn-outline-light.segment-media-type-btn:hover, .btn-outline-light.throttled-metric-btn:hover {
    background-color: #e9ecef !important;
    border-color: rgba(0,0,0,0.2) !important;
    color: #495057 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

.btn-light.geo-metric-btn:focus, .btn-light.device-metric-btn:focus, .btn-light.os-metric-btn:focus, .btn-light.browser-metric-btn:focus, .btn-light.segment-media-type-btn:focus, .btn-light.throttled-metric-btn:focus {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.2) !important;
    outline: none !important;
}

.btn-outline-light.geo-metric-btn:focus, .btn-outline-light.device-metric-btn:focus, .btn-outline-light.os-metric-btn:focus, .btn-outline-light.browser-metric-btn:focus, .btn-outline-light.segment-media-type-btn:focus, .btn-outline-light.throttled-metric-btn:focus {
    background-color: #f8f9fa !important;
    border-color: rgba(0,0,0,0.15) !important;
    color: #495057 !important;
    box-shadow: none !important;
    outline: none !important;
}

.btn-light.geo-metric-btn:active, .btn-light.device-metric-btn:active, .btn-light.os-metric-btn:active, .btn-light.browser-metric-btn:active, .btn-light.segment-media-type-btn:active, .btn-light.throttled-metric-btn:active {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.2) !important;
}

.btn-outline-light.geo-metric-btn:active, .btn-outline-light.device-metric-btn:active, .btn-outline-light.os-metric-btn:active, .btn-outline-light.browser-metric-btn:active, .btn-outline-light.segment-media-type-btn:active, .btn-outline-light.throttled-metric-btn:active {
    background-color: #dee2e6 !important;
    border-color: rgba(0,0,0,0.25) !important;
    color: #495057 !important;
    transform: translateY(0);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1) !important;
}

/* Force override for all possible Bootstrap button combinations */
[class*="geo-metric-btn"], [class*="device-metric-btn"], [class*="os-metric-btn"], [class*="browser-metric-btn"], [class*="segment-media-type-btn"], [class*="throttled-metric-btn"] {
    transition: all 0.2s ease !important;
}

/* Target any button with our custom classes, regardless of Bootstrap color class */
button.geo-metric-btn, button.device-metric-btn, button.os-metric-btn, button.browser-metric-btn, button.segment-media-type-btn, button.throttled-metric-btn {
    transition: all 0.2s ease !important;
}

/* Override for primary/secondary colors that might be applied by Dash */
.btn-primary.geo-metric-btn, .btn-primary.device-metric-btn, .btn-primary.os-metric-btn, .btn-primary.browser-metric-btn, .btn-primary.segment-media-type-btn, .btn-primary.throttled-metric-btn,
.btn-secondary.geo-metric-btn, .btn-secondary.device-metric-btn, .btn-secondary.os-metric-btn, .btn-secondary.browser-metric-btn, .btn-secondary.segment-media-type-btn, .btn-secondary.throttled-metric-btn,
.btn-success.geo-metric-btn, .btn-success.device-metric-btn, .btn-success.os-metric-btn, .btn-success.browser-metric-btn, .btn-success.segment-media-type-btn, .btn-success.throttled-metric-btn,
.btn-info.geo-metric-btn, .btn-info.device-metric-btn, .btn-info.os-metric-btn, .btn-info.browser-metric-btn, .btn-info.segment-media-type-btn, .btn-info.throttled-metric-btn {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.2) !important;
}

.btn-outline-primary.geo-metric-btn, .btn-outline-primary.device-metric-btn, .btn-outline-primary.os-metric-btn, .btn-outline-primary.browser-metric-btn, .btn-outline-primary.segment-media-type-btn, .btn-outline-primary.throttled-metric-btn,
.btn-outline-secondary.geo-metric-btn, .btn-outline-secondary.device-metric-btn, .btn-outline-secondary.os-metric-btn, .btn-outline-secondary.browser-metric-btn, .btn-outline-secondary.segment-media-type-btn, .btn-outline-secondary.throttled-metric-btn,
.btn-outline-success.geo-metric-btn, .btn-outline-success.device-metric-btn, .btn-outline-success.os-metric-btn, .btn-outline-success.browser-metric-btn, .btn-outline-success.segment-media-type-btn, .btn-outline-success.throttled-metric-btn,
.btn-outline-info.geo-metric-btn, .btn-outline-info.device-metric-btn, .btn-outline-info.os-metric-btn, .btn-outline-info.browser-metric-btn, .btn-outline-info.segment-media-type-btn, .btn-outline-info.throttled-metric-btn {
    background-color: #f8f9fa !important;
    border-color: rgba(0,0,0,0.15) !important;
    color: #495057 !important;
}

/* Performance Scores Grid Styles */
.performance-scores-grid {
    width: 100% !important;
}

.score-item {
    transition: all 0.3s ease !important;
    cursor: pointer;
}

.score-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1) !important;
    border-color: rgba(0,0,0,0.15) !important;
}

.score-item .score-circle {
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.score-item:hover .score-circle {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15) !important;
}

.score-details {
    flex-grow: 1;
}

/* Responsive grid adjustments */
@media (max-width: 768px) {
    .performance-scores-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }
    
    .score-item {
        min-height: 80px !important;
        padding: 12px 8px !important;
        flex-direction: row !important;
        text-align: left !important;
    }
    
    .score-item .score-circle {
        width: 50px !important;
        height: 50px !important;
        margin-right: 12px !important;
        margin-bottom: 0 !important;
    }
    
    .score-item .score-circle span {
        font-size: 14px !important;
    }
    
    .score-item .score-details {
        margin-top: 0;
    }
    
    .score-item .score-details > div {
        font-size: 11px !important;
        line-height: 1.3 !important;
    }
    
    .score-item .score-details i {
        font-size: 12px !important;
        margin-right: 6px !important;
    }
}

@media (min-width: 769px) and (max-width: 1199px) {
    .performance-scores-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 18px !important;
    }
    
    .score-item {
        min-height: 90px !important;
        padding: 16px 12px !important;
    }
    
    .score-item .score-circle {
        width: 55px !important;
        height: 55px !important;
    }
    
    .score-item .score-circle span {
        font-size: 16px !important;
    }
    
    .score-item .score-details > div {
        font-size: 13px !important;
    }
    
    .score-item .score-details i {
        font-size: 14px !important;
    }
}

/* Animation for score items */
.score-item:nth-child(1) { animation: slideInLeft 0.6s ease-out 0.1s both; }
.score-item:nth-child(2) { animation: slideInLeft 0.6s ease-out 0.2s both; }
.score-item:nth-child(3) { animation: slideInLeft 0.6s ease-out 0.3s both; }
.score-item:nth-child(4) { animation: slideInLeft 0.6s ease-out 0.4s both; }
.score-item:nth-child(5) { animation: slideInLeft 0.6s ease-out 0.5s both; }
.score-item:nth-child(6) { animation: slideInLeft 0.6s ease-out 0.6s both; }

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Segment Insights Header Styling */
.segment-insights-header {
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease-out;
}

.segment-insights-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1) !important;
}

.domain-icon-circle {
    transition: all 0.3s ease;
}

.segment-insights-header:hover .domain-icon-circle {
    transform: scale(1.05);
    background: rgba(66, 153, 225, 0.15) !important;
}

.insights-metric-item {
    transition: all 0.2s ease;
    padding: 8px;
    border-radius: 6px;
}

.insights-metric-item:hover {
    background: rgba(0,0,0,0.02);
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .segment-insights-header .d-flex.justify-content-between {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    
    .segment-insights-header .gap-4 {
        gap: 1rem !important;
        margin-top: 1rem;
    }
}

.enhanced-metric-card:nth-child(4) { animation-delay: 0.4s; }
.enhanced-metric-card:nth-child(5) { animation-delay: 0.5s; }
.enhanced-metric-card:nth-child(6) { animation-delay: 0.6s; }

.metric-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #333;
}

.metric-change {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.metric-change.positive {
    color: #28a745;
}

.metric-change.negative {
    color: #dc3545;
}

/* Chart Sections */
.chart-section {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.chart-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.chart-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.chart-select {
    padding: 0.4rem 1rem;
    border-radius: 4px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    color: #333;
}

/* Virtual List for Domain Browsing */
.virtual-list-container {
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background-color: white;
    border: 1px solid #ddd;
}

.virtual-list-header {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr 1fr;
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #ddd;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
}

.virtual-list-scroll {
    height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.virtual-list-row {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr 1fr;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.virtual-list-row:hover {
    background-color: #f8f9fa;
    cursor: pointer;
}

.virtual-list-row.active {
    background-color: rgba(255, 128, 52, 0.1);
    border-left: 3px solid var(--accent-color);
}

/* Metric Tiles Styling */
.metric-tile {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 1.25rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.metric-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #333;
}

.metric-trend {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0.9;
    line-height: 1.2;
    padding: 2px 0;
    margin-bottom: 2px;
}

.metric-trend:last-child {
    margin-bottom: 0;
}

.metric-trend .trend-value {
    font-weight: 600;
    font-size: 0.7rem;
    color: #495057;
}

.metric-trend .trend-label {
    font-size: 0.65rem;
    opacity: 0.7;
    font-weight: 400;
    color: #6c757d;
}

.metric-trend i {
    font-size: 0.6rem;
    margin: 0 2px;
}

.metric-trend.positive {
    color: #28a745;
}

.metric-trend.negative {
    color: #dc3545;
}

.metric-trends {
    margin-top: 8px;
    padding: 6px 8px;
    background: linear-gradient(to bottom, rgba(248, 249, 250, 0.3), transparent);
    border-radius: 6px;
    border-top: 1px solid #e9ecef;
}

.metric-trend-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.7rem;
    margin-bottom: 3px;
    padding: 2px 0;
}

.metric-trend-compact:last-child {
    margin-bottom: 0;
}

.metric-trend-compact .trend-info {
    display: flex;
    align-items: center;
    gap: 3px;
}

.metric-trend-compact .trend-value {
    font-weight: 600;
    font-size: 0.65rem;
}

.metric-trend-compact .trend-label {
    font-size: 0.6rem;
    opacity: 0.6;
    font-weight: 400;
}

.metric-trend-compact i {
    font-size: 0.55rem;
    margin-right: 1px;
}

.metrics-timestamp {
    text-align: right;
    font-size: 0.8rem;
}

/* Forecast timestamp styles */
.forecast-timestamp-section {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.forecast-timestamp-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 12px 20px;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.forecast-timestamp-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.forecast-timestamp-text {
    margin: 0;
    letter-spacing: 0.5px;
}

/* Revenue Trend Tabs */
.revenue-trend-tabs .nav-link {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}
/* Add these styles to your styles.css file */

/* Skeleton loading animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.02);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes dots-loading {
    0% {
        opacity: 0.2;
        transform: scale(0.8);
    }
    20% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0.2;
        transform: scale(0.8);
    }
}

@keyframes fade-in-out {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 1;
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.skeleton {
    background: linear-gradient(to right, #f0f0f0 8%, #e0e0e0 18%, #f0f0f0 33%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.pulse {
    animation: pulse 2s infinite;
}

/* Skeleton cards for summary metrics */
.skeleton-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 135px;
}

.skeleton-card-title {
    height: 16px;
    width: 70%;
    margin-bottom: 0.5rem;
}

.skeleton-card-value {
    height: 32px;
    width: 50%;
    margin-bottom: 0.5rem;
}

.skeleton-card-text {
    height: 16px;
    width: 80%;
}

/* Skeleton for domain details */
.skeleton-domain-header {
    background-color: white;
    border-radius: 8px 8px 0 0;
    padding: 1.5rem;
    margin-bottom: 1px;
}

.skeleton-domain-name {
    height: 28px;
    width: 200px;
    margin-bottom: 0.5rem;
}

.skeleton-domain-meta {
    height: 16px;
    width: 60%;
}

.skeleton-metrics-section {
    background-color: white;
    border-radius: 0 0 8px 8px;
    padding: 1.5rem;
}

.skeleton-metric-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.skeleton-metric-card {
    height: 100px;
    border-radius: 8px;
}

.skeleton-chart {
    height: 300px;
    border-radius: 8px;
    margin-top: 1.5rem;
}

/* Skeleton rows for domain list */
.skeleton-list-row {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr 1fr;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.skeleton-list-cell {
    height: 16px;
    border-radius: 4px;
}
/* Add to styles.css */
/* Fallback loading text */
.loading-text {
    padding: 2rem;
    text-align: center;
    color: #666;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Better spinner color for loading */
.dash-spinner.dash-default {
    margin: 2rem auto;
    border-top-color: var(--accent-color) !important;
}

/* Loading error state */
.loading-error {
    padding: 2rem;
    text-align: center;
    color: #721c24;
    background-color: #f8d7da;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin: 1rem 0;
}

.loading-error i {
    margin-right: 0.5rem;
    color: #dc3545;
}

.loading-error .retry-btn {
    margin-top: 1rem;
    background-color: #dc3545;
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
}

.loading-error .retry-btn:hover {
    background-color: #c82333;
}
/* Responsive Adjustments - No sidebar */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }
}

.revenue-tab-section {
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.revenue-tab-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
}

.revenue-tab-label {
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
    margin-bottom: 0;
}

.revenue-tab-dropdown {
    width: 180px;
    font-size: 0.9rem;
}


.revenue-loading-wrapper {
    min-height: 300px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}
/* Segment insights styles */
.segment-insights-section {
    margin-bottom: 2rem;
}

.segment-media-type-btn {
    font-size: 0.85rem;
    padding: 0.25rem 0.75rem;
}

.segment-card {
    height: 100%;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.segment-distribution-chart {
    min-height: 300px;
}

.segment-metric-pill {
    background-color: #f8f9fa;
    border-radius: 30px;
    padding: 0.5rem 1rem;
    display: inline-flex;
    align-items: center;
    margin-right: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.segment-metric-pill .metric-name {
    color: #666;
    font-weight: 500;
    margin-right: 0.5rem;
}

.segment-metric-pill .metric-value {
    font-weight: 600;
    color: #333;
}

.segment-insights-content {
    min-height: 200px;
}

.time-period-card {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1.25rem;
    height: 100%;
}

.time-period-card .period-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
}

.time-period-card .metric-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.time-period-card .metric-label {
    color: #666;
}

.time-period-card .metric-value {
    font-weight: 600;
    color: #333;
}

.geo-table {
    overflow-x: auto;
}

.insights-list {
    list-style-type: none;
    padding-left: 0;
}

.insights-list li {
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 1.5rem;
}

.insights-list li:before {
    content: "•";
    color: var(--accent-color);
    font-size: 1.5rem;
    position: absolute;
    left: 0;
    top: -0.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .segment-metric-pill {
        width: 100%;
        margin-right: 0;
        justify-content: space-between;
    }
}

/* Segment Insights styles */
.score-circle {
    transition: transform 0.3s ease;
}

.score-circle:hover {
    transform: scale(1.1);
}

.segment-insights-container .card {
    transition: box-shadow 0.3s ease;
}

.segment-insights-container .card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Highlight ACPM in time period cards */
.text-primary .fw-bold {
    position: relative;
}

.text-primary .fw-bold::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #007bff;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.text-primary .fw-bold:hover::after {
    transform: scaleX(1);
}

/* Style the map tooltip */
.geo-map-tooltip {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 12px;
    padding: 8px 12px;
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Domain dropdown styling */
.domain-dropdown {
    width: 100%;
    margin-bottom: 1rem;
}

.domain-dropdown .Select-control {
    border: 1px solid #ddd;
    border-radius: 4px;
    height: 38px;
}

.domain-dropdown .Select-menu-outer {
    border-radius: 0 0 4px 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.domain-dropdown .Select-option {
    padding: 8px 12px;
}

.domain-dropdown .Select-option.is-focused {
    background-color: rgba(0, 123, 255, 0.05);
}

/* Tab styling */
#domain-detail-tabs .nav-link {
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    color: #007bff;
    border: none;
    background: none;
    transition: all 0.3s ease;
}

#domain-detail-tabs .nav-link:hover {
    color: #0056b3;
    border-color: transparent;
}

#domain-detail-tabs .nav-link.active {
    color: #2d3748 !important;
    background: white;
    border: 1px solid #dee2e6;
    border-bottom: 1px solid white;
    border-radius: 0.375rem 0.375rem 0 0;
}

#domain-detail-tabs .tab-content {
    padding-top: 1rem;
}

.domain-analytics-tabs .nav-tabs {
    border-bottom: 1px solid #dee2e6;
}

.domain-analytics-tabs .nav-link {
    border-radius: 0;
    margin-bottom: -1px;
}

.domain-analytics-tabs .nav-link.active {
    background-color: transparent;
    border: none;
}

/* Hourly Performance Grid Styles */
.hourly-performance-container {
    background-color: #f8f9fa;
}

/* Summary KPI Cards */
.hourly-kpi-card {
    border-left: 4px solid #007bff;
    transition: all 0.2s ease;
}

.hourly-kpi-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
    transform: translateY(-2px);
}

.hourly-kpi-card.revenue { border-left-color: #10b981; }
.hourly-kpi-card.geo { border-left-color: #3b82f6; }
.hourly-kpi-card.media { border-left-color: #8b5cf6; }
.hourly-kpi-card.metrics { border-left-color: #6366f1; }
.hourly-kpi-card.viewability { border-left-color: #f59e0b; }
.hourly-kpi-card.dsp { border-left-color: #06b6d4; }
.hourly-kpi-card.device { border-left-color: #8b5cf6; }
.hourly-kpi-card.browser { border-left-color: #06b6d4; }
.hourly-kpi-card.os { border-left-color: #84cc16; }
.hourly-kpi-card.floor { border-left-color: #06b6d4; }

/* Performance Grid Table */
.hourly-performance-table {
    font-family: monospace;
    font-size: 11px;
    border-collapse: collapse;
    width: 100%;
}

.hourly-performance-table th,
.hourly-performance-table td {
    padding: 3px 4px;
    text-align: center;
    border: 1px solid #dee2e6;
    white-space: nowrap;
    min-width: 45px;
}

.hourly-performance-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    position: sticky;
    top: 0;
    z-index: 10;
    font-size: 10px;
}

.hourly-hour-header {
    background: #e9ecef !important;
    font-weight: 600;
    position: sticky;
    left: 0;
    z-index: 5;
    min-width: 35px !important;
}

.hourly-total-row {
    background: #f8f9fa !important;
    font-weight: 700;
    border-top: 2px solid #495057;
}

.hourly-today-column {
    background: #ffffff !important;
}

.hourly-future-hour {
    background: #f8f9fa !important;
    color: #6c757d;
}

.hourly-current-hour {
    background-color: rgba(255, 193, 7, 0.1) !important;
}

/* Custom performance level colors */
.perf-high { 
    background-color: #66BB6A !important; 
    color: #1B5E20 !important; 
    font-weight: 600 !important;
}

.perf-medium { 
    background-color: #A5D6A7 !important; 
    color: #2E7D32 !important; 
    font-weight: 500 !important;
}

.perf-borderline { 
    background-color: #C8E6C9 !important; 
    color: #388E3C !important; 
    font-weight: normal !important;
}

.perf-low { 
    background-color: #E8F5E9 !important; 
    color: #4CAF50 !important; 
    font-weight: normal !important;
}

.perf-worst { 
    background-color: #FFCDD2 !important; 
    color: #C62828 !important; 
    font-weight: 600 !important;
}

/* Metric buttons */
.hourly-metric-btn {
    font-size: 12px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 4px;
    margin-right: 8px;
    margin-bottom: 4px;
    transition: all 0.2s;
}

.hourly-metric-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Filter controls */
.hourly-filter-section {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 16px 20px;
}

.hourly-filter-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-weight: 600;
    color: #374151;
}

.hourly-active-filters {
    margin-bottom: 16px;
    padding: 12px;
    background-color: #f0f9ff;
    border-radius: 6px;
    border-left: 4px solid #3b82f6;
}

/* Grid container */
.hourly-grid-container {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 70vh;
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    /* Start scrolled to the right to show latest data */
    scroll-behavior: smooth;
}

/* Performance table improvements */
.hourly-performance-table {
    font-family: monospace;
    font-size: 11px;
    border-collapse: collapse;
    width: max-content; /* Allow table to extend beyond container */
    min-width: 100%;
    table-layout: auto;
}

.hourly-performance-table th,
.hourly-performance-table td {
    padding: 4px 6px;
    text-align: center;
    border: 1px solid #dee2e6;
    white-space: nowrap;
    min-width: 50px;
    max-width: 80px;
}

/* Sticky columns for hour labels */
.hourly-performance-table .hour-column {
    position: sticky;
    left: 0;
    z-index: 10;
    background: #e9ecef !important;
    font-weight: 600;
    min-width: 50px !important;
    box-shadow: 2px 0 4px rgba(0,0,0,0.1);
}

/* Header improvements */
.hourly-performance-table thead th {
    position: sticky;
    top: 0;
    z-index: 15;
    background: #f8f9fa !important;
    font-weight: 600;
    color: #495057;
    font-size: 10px;
    border-bottom: 2px solid #dee2e6;
}

/* Today column highlighting */
.hourly-today-column {
    background: #fff3cd !important;
    border-left: 2px solid #ffc107 !important;
    border-right: 2px solid #ffc107 !important;
}

/* Container responsiveness - Fix overflow issues */
.hourly-performance-container {
    max-width: 100%;
    width: 100%;
    overflow-x: hidden;
}

/* Ensure main container doesn't overflow */
.container-fluid {
    max-width: 100%;
    padding-left: 15px;
    padding-right: 15px;
    overflow-x: hidden;
}

/* Fix Bootstrap row overflow */
.row {
    margin-left: 0;
    margin-right: 0;
}

.row > [class*="col-"] {
    padding-left: 8px;
    padding-right: 8px;
}

/* KPI Cards container fix */
.hourly-kpi-cards-container {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* Filter section responsiveness */
.hourly-filter-section {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Fix dropdown width issues */
.hourly-performance-container .Select-control,
.hourly-performance-container .form-control {
    min-width: 120px;
    max-width: 100%;
    box-sizing: border-box;
}

/* Improve responsive behavior for small screens */
@media (max-width: 1200px) {
    .row > [class*="col-"] {
        padding-left: 5px;
        padding-right: 5px;
    }
    
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
}

@media (max-width: 992px) {
    .bg-white.p-3 {
        padding: 12px !important;
    }
    
    .bg-light.p-3 {
        padding: 12px !important;
    }
}

/* Ensure main content container doesn't exceed viewport */
.main-content {
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Sticky headers and totals for hourly performance table */
.hourly-table-container {
    position: relative;
    max-height: 100vh;
    overflow: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.sticky-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #f8f9fa !important;
    border-bottom: 2px solid #dee2e6 !important;
}

.sticky-header-row {
    position: sticky;
    top: 0;
    z-index: 15;
}

.sticky-total {
    position: sticky;
    bottom: 0;
    z-index: 10;
    background: #e9ecef !important;
    border-top: 2px solid #495057 !important;
    font-weight: 700 !important;
}

.sticky-total-row {
    position: sticky;
    bottom: 0;
    z-index: 10;
}

/* Enhanced hour column sticky positioning */
.hourly-performance-table .hour-column {
    position: sticky;
    left: 0;
    z-index: 25;
    background: #e9ecef !important;
    font-weight: 600;
    min-width: 50px !important;
    box-shadow: 2px 0 4px rgba(0,0,0,0.1);
}

/* Header hour column gets higher z-index */
.sticky-header.hour-column {
    z-index: 30;
}

/* Total hour column gets medium z-index */
.sticky-total.hour-column {
    z-index: 20;
}

/* Smaller KPI cards to save space */
.hourly-kpi-card {
    height: 80px !important;
    min-height: 80px !important;
}

.hourly-kpi-card .card-body {
    padding: 8px !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hourly-performance-table {
        font-size: 9px;
    }
    
    .hourly-performance-table th,
    .hourly-performance-table td {
        padding: 2px 3px;
        min-width: 35px;
    }
    
    .hourly-grid-container {
        max-height: 60vh;
    }
    
    .hourly-kpi-card {
        height: 70px !important;
        min-height: 70px !important;
    }
}

/* Enhanced metric tiles */
.enhanced-metric-tile {
    min-height: 140px;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Smooth loading transitions */
.enhanced-metric-tile [id$="-loading-container"],
.enhanced-metric-tile [id$="-content"] {
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 1;
    transform: translateY(0);
}

/* Revenue forecast container styling */
.enhanced-forecast-chart-section {
    position: relative;
    min-height: 450px;
}

.enhanced-forecast-chart-section [id$="-loading-container"],
.enhanced-forecast-chart-section [id$="-content-container"] {
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Chart loading fade-in effect */
.enhanced-forecast-chart-section [id$="-content-container"] {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.enhanced-metric-tile:hover {
    border-left-color: #2980b9;
    border-left-width: 6px;
}

/* TODO: Click for details hover effect - commented out as endpoint is not yet active */
/* .enhanced-metric-tile:hover::after {
    content: "Click for details";
    position: absolute;
    top: 5px;
    right: 8px;
    font-size: 8px;
    color: #3498db;
    font-weight: 600;
    opacity: 0.8;
} */

.top-performers-list {
    margin-top: 5px;
    padding: 4px 0;
    border-top: 1px solid #eee;
}

.top-performers-list .text-success {
    font-weight: 600;
}

/* Top Performers Container Styling */
.top-performers-container {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
}

/* Custom scrollbar styling for top performers */
.top-performers-container::-webkit-scrollbar {
    width: 6px;
}

.top-performers-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.top-performers-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.top-performers-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Firefox scrollbar styling */
.top-performers-container {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}

/* CSV Upload Area Styling */
.upload-area {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.upload-area:hover {
    border-color: #5a67d8 !important;
    background-color: #f0f4ff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(90, 103, 216, 0.15);
}

.upload-area:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(90, 103, 216, 0.2);
}

/* Info section styling */
.info-section {
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 12px;
    border: 1px solid #e9ecef;
}

/* Fix any layout interference when hidden */
.csv-upload-container {
    position: relative;
    overflow: hidden;
}

.csv-upload-container[style*="display: none"] {
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.metric-tile .metric-title {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    margin-bottom: 4px;
}

.metric-tile .metric-value {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 8px;
}

/* Loading state styles for insight content */
.insight-content-loading {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 400px !important;
}

/* Normal state styles for insight content when loaded */
.insight-content-loaded {
    display: block !important;
    min-height: auto !important;
}

/* Enhanced Revenue Forecast Styling */
.enhanced-forecast-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-top: 24px;
    padding: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.enhanced-forecast-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    border-color: #cbd5e0;
}

.enhanced-forecast-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.enhanced-forecast-chart-section {
    padding: 20px 24px 0 24px;
}

.enhanced-forecast-metrics {
    padding: 0 24px 24px 24px;
}

/* Enhanced Forecast Metric Cards */
.enhanced-forecast-metric-card {
    background: white;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    padding: 16px;
    transition: all 0.3s ease;
    cursor: default;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    height: 100%;
}

.enhanced-forecast-metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    border-color: #cbd5e0;
}

/* Icon and title hover effects for forecast metric cards */
.enhanced-forecast-metric-card:hover .fas {
    color: #4a5568 !important;
}

.enhanced-forecast-metric-card:hover .forecast-metric-title {
    color: #4a5568 !important;
}

.forecast-metric-title {
    font-size: 11px;
    font-weight: 600;
    color: #718096;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.forecast-metric-value {
    font-size: 24px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 4px;
    line-height: 1.2;
}

.forecast-metric-subtitle {
    font-size: 12px;
    font-weight: 500;
    color: #a0aec0;
    line-height: 1.3;
}

.enhanced-forecast-metrics-container {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #f7fafc;
}

.forecast-metrics-header {
    margin-bottom: 16px;
}

/* Responsive Design for Forecast Cards */
@media (max-width: 768px) {
    .enhanced-forecast-card {
        margin-top: 16px;
        border-radius: 8px;
    }
    
    .enhanced-forecast-header {
        padding: 16px 20px;
    }
    
    .enhanced-forecast-chart-section {
        padding: 16px 20px 0 20px;
    }
    
    .enhanced-forecast-metrics {
        padding: 0 20px 20px 20px;
    }
    
    .enhanced-forecast-metric-card {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .forecast-metric-value {
        font-size: 20px;
    }
    
    .forecast-metric-title {
        font-size: 11px;
    }
}

/* Enhanced Modal Styles for Job History and Active Jobs */
/* Override Bootstrap modal-xl default width */
.modal.fade#bulk-results-modal .modal-dialog.modal-xl {
    max-width: 95vw !important;
    width: 95vw !important;
    margin: 1rem auto !important;
}

/* More specific selector to override Bootstrap */
#bulk-results-modal.modal .modal-dialog {
    max-width: 95vw !important;
    width: 95vw !important;
    margin: 1rem auto !important;
}

/* Force width with highest specificity */
body .modal#bulk-results-modal .modal-dialog {
    max-width: 95vw !important;
    width: 95vw !important;
    margin: 1rem auto !important;
}

#bulk-results-modal .modal-content {
    max-height: 90vh !important;
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
}

#bulk-results-modal .modal-header {
    border-bottom: 1px solid #e9ecef !important;
    background-color: #f8f9fa !important;
    border-radius: 12px 12px 0 0 !important;
    padding: 1.25rem 1.5rem !important;
}

#bulk-results-modal .modal-body {
    padding: 1.5rem !important;
    overflow: hidden !important;
}

#bulk-results-modal .modal-footer {
    border-top: 1px solid #e9ecef !important;
    background-color: #f8f9fa !important;
    border-radius: 0 0 12px 12px !important;
    padding: 1rem 1.5rem !important;
}

/* Enhanced Modal Styles for Admin Flagged Response Detail */
/* Use flexbox to center the modal */
div#admin-flagged-detail-modal.modal {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

div#admin-flagged-detail-modal.modal.show {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Override Bootstrap modal-xl default width for flagged response modal */
div#admin-flagged-detail-modal {
    --bs-modal-width: 95vw !important;
}

div#admin-flagged-detail-modal > div.modal-dialog {
    max-width: 95vw !important;
    width: 95vw !important;
    margin: 0 !important;
    transform: none !important;
    position: relative !important;
}

div#admin-flagged-detail-modal.modal .modal-dialog.modal-xl {
    max-width: 95vw !important;
    width: 95vw !important;
    margin: 0 !important;
    transform: none !important;
    position: relative !important;
}

/* More specific selector to override Bootstrap */
#admin-flagged-detail-modal.modal .modal-dialog {
    max-width: 95vw !important;
    width: 95vw !important;
    margin: 0 !important;
    transform: none !important;
    position: relative !important;
}

/* Force width with highest specificity */
body .modal#admin-flagged-detail-modal .modal-dialog {
    max-width: 95vw !important;
    width: 95vw !important;
    margin: 0 !important;
    transform: none !important;
    position: relative !important;
}

body div.modal#admin-flagged-detail-modal .modal-dialog {
    max-width: 95vw !important;
    width: 95vw !important;
    margin: 0 !important;
    transform: none !important;
    position: relative !important;
}

html body div.modal.fade#admin-flagged-detail-modal .modal-dialog.modal-xl {
    max-width: 95vw !important;
    width: 95vw !important;
    margin: 0 !important;
    transform: none !important;
    position: relative !important;
}

.wide-modal .modal-dialog {
    max-width: 95vw !important;
    width: 95vw !important;
    margin: 0 !important;
    transform: none !important;
    position: relative !important;
}

#admin-flagged-detail-modal .modal-content {
    max-height: 90vh !important;
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
}

#admin-flagged-detail-modal .modal-header {
    border-bottom: 1px solid #e9ecef !important;
    background-color: #f8f9fa !important;
    border-radius: 12px 12px 0 0 !important;
    padding: 1.25rem 1.5rem !important;
}

#admin-flagged-detail-modal .modal-body {
    padding: 1.5rem !important;
    max-height: 75vh !important;
    overflow-y: auto !important;
}

#admin-flagged-detail-modal .modal-footer {
    border-top: 1px solid #e9ecef !important;
    background-color: #f8f9fa !important;
    border-radius: 0 0 12px 12px !important;
    padding: 1rem 1.5rem !important;
}

/* Ensure modal content is responsive */
@media (max-width: 768px) {
    .modal.fade#bulk-results-modal .modal-dialog.modal-xl,
    #bulk-results-modal.modal .modal-dialog,
    body .modal#bulk-results-modal .modal-dialog {
        max-width: 98vw !important;
        width: 98vw !important;
        margin: 0.5rem auto !important;
    }
    
    #bulk-results-modal .modal-content {
        max-height: 95vh !important;
    }
}

/* Domain Alerts Toast System */
.alerts-toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    pointer-events: none;
}

/* Ensure minimized toast container allows pointer events */
.alerts-toast-container .alerts-toast-minimized {
    pointer-events: auto !important;
}

.alerts-toast {
    pointer-events: auto;
    background: white;
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    border-left: 4px solid #fff59d;
}

.alerts-toast .toast-header {
    background: linear-gradient(135deg, #fff9c4 0%, #fff59d 100%);
    border-bottom: 1px solid #e0e0e0;
    padding: 12px 16px;
    font-weight: 600;
    border-radius: 12px 12px 0 0;
    position: relative;
}

.alerts-toast #alerts-summary {
    background: linear-gradient(135deg, #fafbfc 0%, #f1f3f4 100%);
    border-bottom: 1px solid #e8eaed;
    font-size: 0.85rem;
    padding: 12px 16px;
    color: #5f6368;
    font-weight: 400;
    letter-spacing: 0.025em;
    line-height: 1.4;
}

/* Style the summary text specifically */
.alerts-toast #alerts-summary #alerts-summary-text {
    color: #5f6368;
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.4;
    margin: 0;
}

/* Add subtle separators between priority levels */
.alerts-toast #alerts-summary #alerts-summary-text {
    opacity: 0.85;
}

/* Subtle styling for the summary section */
.alerts-toast #alerts-summary {
    position: relative;
}

/* Add a very subtle shadow to the summary section */
.alerts-toast #alerts-summary::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #e8eaed 50%, transparent 100%);
}

.alerts-toast .toast-body {
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
}

/* Alert Items Styling */
.alerts-toast .card {
    border: 1px solid #f1f3f4;
    border-radius: 10px;
    transition: all 0.3s ease;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.alerts-toast .card:hover {
    border-color: #e8eaed;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
    background: #fafbfc;
}

.alerts-toast .card-body {
    padding: 12px;
}

.alerts-toast .card .mt-2.pt-2 {
    background-color: #f8f9fa;
    margin: 8px -12px -12px -12px;
    padding: 8px 12px 12px 12px;
    border-radius: 0 0 8px 8px;
}

.alerts-toast .badge {
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 12px;
}

/* Domain Alerts Accordion */
.domain-alerts-accordion .accordion-item {
    border: none;
    background: transparent;
    margin-bottom: 8px;
}

.domain-alerts-accordion .accordion-button {
    background: #ffffff;
    border: 1px solid #f1f3f4;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #5f6368;
    transition: all 0.3s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.domain-alerts-accordion .accordion-button::after {
    margin-left: auto;
}

.domain-alerts-accordion .accordion-button:not(.collapsed) {
    background: #f8f9fa;
    border-color: #dadce0;
    color: #3c4043;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.domain-alerts-accordion .accordion-button:focus {
    box-shadow: 0 0 0 0.15rem rgba(95, 99, 104, 0.15);
    border-color: #dadce0;
    background: #f8f9fa;
}

/* Accordion content styling */
.domain-alerts-accordion .accordion-collapse {
    border: none;
    background: transparent;
}

.domain-alerts-accordion .accordion-body {
    padding: 16px;
    background: #ffffff;
    border: 1px solid #f1f3f4;
    border-top: none;
    border-radius: 0 0 10px 10px;
    margin-top: -1px;
}

/* Subtle hover effects for accordion items */
.domain-alerts-accordion .accordion-button:hover {
    background: #fafbfc;
    border-color: #e8eaed;
}

/* Make alert type badges more subtle */
.alerts-toast .alert-type-badge {
    background: #f1f3f4 !important;
    color: #5f6368 !important;
    border: 1px solid #e8eaed;
    font-weight: 400;
    opacity: 0.9;
}

/* Subtle styling for alert content */
.alerts-toast .alert-content {
    color: #5f6368;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Make severity badges more refined */
.alerts-toast .severity-badge {
    font-weight: 500;
    opacity: 0.85;
}

/* Alert count badge styling in accordion title */
.domain-alerts-accordion .accordion-button .alert-count-badge {
    display: inline-block;
    background: #ff6b6b;
    color: #ffffff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 8px;
    vertical-align: middle;
    box-shadow: 0 2px 4px rgba(255, 107, 107, 0.3);
    min-width: 24px;
    text-align: center;
}

.domain-alerts-accordion .accordion-button:hover .alert-count-badge {
    background: #ff5252;
    box-shadow: 0 3px 6px rgba(255, 107, 107, 0.4);
}

.domain-alerts-accordion .accordion-button:not(.collapsed) .alert-count-badge {
    background: #ee5a52;
    box-shadow: 0 3px 8px rgba(238, 90, 82, 0.4);
}

/* Publisher name chip styling in accordion title */
.domain-alerts-accordion .accordion-button .publisher-chip {
    display: inline-block;
    background: #80868b;
    color: #ffffff;
    border: 1px solid #9aa0a6;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 12px;
    vertical-align: middle;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.3px;
}

.domain-alerts-accordion .accordion-button:hover .publisher-chip {
    background: #5f6368;
    border-color: #80868b;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.domain-alerts-accordion .accordion-button:not(.collapsed) .publisher-chip {
    background: #5f6368;
    color: #ffffff;
    border-color: #80868b;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.18);
}

/* Left side wrapper for domain and alert count */
.domain-alerts-accordion .accordion-button .left-content {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Domain name styling - maintain default accordion button font size */
.domain-alerts-accordion .accordion-button .domain-name {
    margin-right: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #202124;
}

/* Publisher filter chips - horizontal scrollable */
.publisher-chips-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar but keep functionality */
.publisher-chips-scroll::-webkit-scrollbar {
    height: 4px;
}

.publisher-chips-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.publisher-chips-scroll::-webkit-scrollbar-thumb {
    background: #dadce0;
    border-radius: 2px;
}

.publisher-chips-scroll::-webkit-scrollbar-thumb:hover {
    background: #bdc1c6;
}

/* Publisher chip buttons */
.publisher-chip-btn {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    background: #f1f3f4;
    color: #5f6368;
    border: 1px solid #dadce0;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.publisher-chip-btn:hover {
    background: #e8eaed;
    border-color: #bdc1c6;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.publisher-chip-btn.active {
    background: #202124;
    color: #ffffff;
    border-color: #202124;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.publisher-chip-btn.active:hover {
    background: #3c4043;
    border-color: #3c4043;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

.publisher-chip-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(32, 33, 36, 0.2);
}

/* Subtle button styling */
.alerts-toast .btn-outline-primary {
    border-color: #dadce0;
    color: #5f6368;
    background: transparent;
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.alerts-toast .btn-outline-primary:hover {
    border-color: #bdc1c6;
    background: #f8f9fa;
    color: #3c4043;
    transform: none;
}

.alerts-toast .btn-outline-success {
    border-color: #dadce0;
    color: #5f6368;
    background: transparent;
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.alerts-toast .btn-outline-success:hover {
    border-color: #bdc1c6;
    background: #f8f9fa;
    color: #3c4043;
    transform: none;
}

.domain-alerts-accordion .accordion-button::after {
    background-size: 16px;
    transition: transform 0.3s ease;
    opacity: 0.7;
}

/* Improve spacing and typography */
.domain-alerts-accordion .accordion-item {
    margin-bottom: 8px;
    border: none;
    background: transparent;
}

/* Subtle divider between accordion items */
.domain-alerts-accordion .accordion-item:not(:last-child) {
    border-bottom: 1px solid #f1f3f4;
    padding-bottom: 8px;
}

.domain-alerts-accordion .accordion-body {
    padding: 8px 0;
    background: transparent;
}

/* Alert Type Icons */
.alerts-toast .fa-dollar-sign {
    color: #28a745;
}

.alerts-toast .fa-server {
    color: #ffc107;
}

.alerts-toast .fa-users {
    color: #17a2b8;
}

.alerts-toast .fa-chart-line {
    color: #6f42c1;
}

.alerts-toast .fa-exclamation-triangle {
    color: #dc3545;
}

/* View Button Styling */
.alerts-toast .btn-outline-primary {
    border-width: 1px;
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.alerts-toast .btn-outline-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

.alerts-toast .btn-outline-success {
    border-width: 1px;
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    min-width: 32px;
}

.alerts-toast .btn-outline-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

/* Minimize/Maximize button styling */
.alerts-toast .btn-minimize,
.alerts-toast .btn-maximize {
    background: #f8f9fa;
    border: 1px solid #e8eaed;
    font-size: 1rem;
    font-weight: 400;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
    opacity: 0.8;
    color: #5f6368;
    line-height: 1;
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Icon styling for minimize/maximize buttons */
.alerts-toast .btn-minimize i,
.alerts-toast .btn-maximize i {
    font-size: 0.9rem;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ensure maximize button in minimized toast is clickable and styled consistently */
.alerts-toast-minimized .btn-maximize {
    z-index: 10001 !important;
    pointer-events: auto !important;
    position: relative;
    cursor: pointer !important;
    background: #f8f9fa !important;
    border: 1px solid #e8eaed !important;
    font-size: 1rem !important;
    font-weight: 400 !important;
    padding: 6px !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
    opacity: 0.8 !important;
    color: #5f6368 !important;
    line-height: 1 !important;
    min-width: 28px !important;
    height: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.alerts-toast-minimized .btn-maximize:hover {
    opacity: 1 !important;
    background-color: #e8eaed !important;
    color: #3c4043 !important;
    border-color: #dadce0 !important;
    transform: scale(1.05);
}

.alerts-toast .btn-minimize:hover,
.alerts-toast .btn-maximize:hover {
    opacity: 1;
    background-color: #e8eaed;
    color: #3c4043;
    border-color: #dadce0;
    transform: scale(1.05);
}

/* Ensure minimize/maximize buttons are always visible */
.alerts-toast .btn-minimize:focus,
.alerts-toast .btn-maximize:focus {
    outline: 2px solid #dadce0;
    outline-offset: 2px;
    background-color: #e8eaed;
}

/* Make sure the buttons have proper contrast */
.alerts-toast .btn-minimize,
.alerts-toast .btn-maximize {
    text-shadow: none;
}

/* Minimized toast styling */
.alerts-toast-minimized {
    background: white;
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border-left: 3px solid #fff59d;
    transition: all 0.3s ease;
    z-index: 10000 !important;
    pointer-events: auto !important;
    position: relative;
}

.alerts-toast-minimized:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Smooth transitions for minimized toast */
.alerts-toast-minimized {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Icon styling consistency for minimized toast */
.alerts-toast-minimized .btn-maximize i {
    font-size: 0.9rem;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alerts-toast-minimized .toast-header {
    background: linear-gradient(135deg, #fff9c4 0%, #fff59d 100%);
    border-bottom: 1px solid #e0e0e0;
    padding: 12px 16px;
    font-weight: 600;
    border-radius: 8px 8px 0 0;
    position: relative;
}

/* Improved spacing for minimized toast content */
.alerts-toast-minimized .toast-header .d-flex {
    gap: 12px;
}

/* Style the title text in minimized toast */
.alerts-toast-minimized .toast-header small {
    font-size: 0.9rem;
    color: #5f6368;
    white-space: nowrap;
}

/* Style the alert count badge in minimized toast */
.alerts-toast-minimized .toast-header .badge {
    font-size: 0.75rem;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Responsive Design for Alerts Toast */
@media (max-width: 768px) {
    .alerts-toast-container {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }
    
    .alerts-toast {
        width: 100% !important;
        max-width: none;
    }
    
    .alerts-toast #alerts-toast-body {
        max-height: 300px;
    }
    
    .alerts-toast .card-body {
        padding: 10px;
    }
    
    .alerts-toast .accordion-button {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
}

/* Animation for toast appearance */
@keyframes slideInFromBottom {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.alerts-toast.show {
    animation: slideInFromBottom 0.3s ease-out;
}

/* Hover effects for better interactivity */
.alerts-toast:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

/* Custom scrollbar for toast body */
.alerts-toast #alerts-toast-body::-webkit-scrollbar {
    width: 6px;
}

.alerts-toast #alerts-toast-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.alerts-toast #alerts-toast-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.alerts-toast #alerts-toast-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Alerts Count Badge Styling */
#alerts-count-badge {
    margin-left: 16px !important;
    font-size: 0.75rem !important;
    min-width: 20px !important;
    height: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 2px solid white !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    font-weight: 600 !important;
}

/* Alerts Count Indicator Styling */
#alerts-count-indicator {
    font-size: 0.7rem !important;
    min-width: 18px !important;
    height: 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 2px solid white !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

#alerts-count-indicator.bg-success {
    background-color: #28a745 !important;
}

#alerts-count-indicator.bg-warning {
    background-color: #ffc107 !important;
    color: #212529 !important;
}

#alerts-count-indicator.bg-danger {
    background-color: #dc3545 !important;
}

/* Domain Analytics Alerts Section */
.domain-selector-container .btn-outline-warning {
    border-width: 2px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.domain-selector-container .btn-outline-warning:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 193, 7, 0.3);
}

.domain-selector-container .btn-outline-warning:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25);
}

/* Tab Alerts Count Styling */
#domain-tab-alerts-count {
    font-size: 0.7rem !important;
    min-width: 18px !important;
    height: 18px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 2px 6px !important;
    font-weight: 600 !important;
}

#domain-tab-alerts-count.bg-success {
    background-color: #28a745 !important;
}

#domain-tab-alerts-count.bg-warning {
    background-color: #ffc107 !important;
    color: #212529 !important;
}

#domain-tab-alerts-count.bg-danger {
    background-color: #dc3545 !important;
}

/* ============================================
   Coolsense AI Chat Interface Styles
   ============================================ */

/* Chat session item hover effects */
.chat-session-item:hover {
    background: #f7fafc !important;
    border-color: #cbd5e0 !important;
}

.chat-session-item:hover[style*="background: #f7fafc"] {
    background: #edf2f7 !important;
}

/* Chat messages container scrollbar */
#coolsense-chat-messages::-webkit-scrollbar {
    width: 8px;
}

#coolsense-chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#coolsense-chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 10px;
}

#coolsense-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Chat input focus state */
#coolsense-chat-input:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
    outline: none;
}

/* Message animation */
@keyframes slideInMessage {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-session-item,
#coolsense-chat-messages > div {
    animation: slideInMessage 0.3s ease-out;
}

/* Responsive adjustments for Coolsense */
@media (max-width: 992px) {
    #coolsense-chat-messages {
        max-height: calc(100vh - 500px) !important;
    }
}

@media (max-width: 768px) {
    .coolsense-sidebar {
        display: none;
    }
    
    #coolsense-chat-messages {
        max-height: calc(100vh - 450px) !important;
    }
}

/* Loading state for Coolsense */
#loading-coolsense {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Badge improvements in Coolsense */
.badge {
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* Button hover effects in chat */
#coolsense-send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

/* Card hover in chat data */
.card:hover {
    transform: translateY(-2px);
    transition: all 0.2s ease;
}

/* Smooth transitions */
* {
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

button, a {
    transition: all 0.2s ease;
}

/* Coolsense specific table styles */
#coolsense-chat-messages table {
    font-size: 13px;
}

#coolsense-chat-messages table th {
    background: #f7fafc;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    color: #4a5568;
}

#coolsense-chat-messages table td {
    vertical-align: middle;
}

/* Download button animation */
.btn-primary:active {
    transform: scale(0.98);
}

/* Chat history sidebar scrollbar */
.chat-session-item:first-child {
    margin-top: 0;
}

/* Welcome screen question buttons */
#coolsense-chat-messages .btn-light:hover {
    background-color: #f7fafc !important;
    color: #2d3748 !important;
    border-color: #4299e1 !important;
    transform: translateX(3px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#coolsense-chat-messages .btn-light {
    transition: all 0.3s ease;
}

/* Welcome screen cards hover */
#coolsense-chat-messages .card:hover {
    border-color: #cbd5e0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

/* Chat session buttons - remove default button styling */
.chat-session-item {
    font-family: inherit;
    line-height: inherit;
}

.chat-session-item:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.2);
}

/* Flag Response Button Styles */
.flag-response-btn:hover {
    background: #fef2f2 !important;
    color: #f56565 !important;
    border-color: #fecaca !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(245, 101, 101, 0.2) !important;
}

/* Enhanced Metric Card Hover Effect */
.enhanced-metric-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.12) !important;
    transform: translateY(-2px);
}
