/* Flip Card Styles (shared for BillAnalytics, UsageAnalytics, etc.) */
.flip-card {
    perspective: 1000px;
    cursor: pointer;
    outline: none;
    min-height: 260px;
    display: flex;
    flex-direction: column;
    margin: 0 0 1.5rem 0; /* Only bottom margin for vertical spacing, horizontal handled by Bootstrap grid */
}
.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(.4,2,.3,1);
    transform-style: preserve-3d;
}
.flip-card.flipped .flip-card-inner, .flip-card-inner.flipped {
    transform: rotateY(180deg);
}
.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    border-top-width: 8px; /* Distinct upper border */
    border-top-color: var(--theme-primary-color, currentColor); /* Use theme color for distinction */
}
.flip-card-back {
    transform: rotateY(180deg);
}

/* Hide logout in all menu contexts */
.logout-mobile-only {
    display: none !important;
}

/* Show logout only in mobile hamburger menu - multiple selectors for DevExpress */
@media (max-width: 767.98px) {
    .dx-menu-hamburger-panel .logout-mobile-only,
    .dx-dropdown-menu .logout-mobile-only,
    .dx-menu-dropdown .logout-mobile-only,
    .dx-overlay-content .logout-mobile-only {
        display: inline-block !important;
    }
}

/* Alternative approach: Hide logout in horizontal menu items specifically */
.dx-menu-horizontal .logout-mobile-only {
    display: none !important;
}

/* Standard spacing between account details and meter usage graph */
.account-details-to-meter-graph-spacing {
    margin-top: var(--theme-spacing-lg, 2rem);
    margin-bottom: var(--theme-spacing-lg, 2rem);
}

@media (max-width: 767.98px) {
    .account-details-to-meter-graph-spacing {
        margin-top: var(--theme-spacing-md, 1rem);
        margin-bottom: var(--theme-spacing-md, 1rem);
    }
}

/* Margin for analytics controls section */
.analytics-controls-margin {
    margin-top: 1rem;
}

/* Match the analytics header export buttons to the period dropdown's height (AB#6598/6599).
   ThemedButton has no size parameter, so the buttons otherwise render at the Bootstrap
   .btn default height (~38px) while .period-select is forced to 32px, leaving them
   visibly mismatched. GetActionButtonStyle() sets only colors/radius inline, so these
   layout rules are not overridden. */
.usage-analytics-header .themed-button,
.bill-analytics-header .themed-button {
    height: 32px;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
}

/* Interpretation section inside flip cards */
.interpretation-section {
    background: color-mix(in srgb, var(--theme-text-color, #212529) 10%, transparent);
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin: 0.5rem 0;
}

/* Scrollable card body styles */
.scrollable-card-body {
    overflow-y: auto;
    max-height: 400px;
    padding: 1rem;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--theme-text-color, #212529) 50%, transparent) transparent;
}

.scrollable-card-body::-webkit-scrollbar {
    width: 6px;
}

.scrollable-card-body::-webkit-scrollbar-track {
    background: color-mix(in srgb, var(--theme-text-color, #212529) 10%, transparent);
    border-radius: 3px;
}

.scrollable-card-body::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--theme-text-color, #212529) 30%, transparent);
    border-radius: 3px;
}

.scrollable-card-body::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--theme-text-color, #212529) 50%, transparent);
}

/* Scrollable content areas within cards */
.scrollable-content {
    overflow-y: auto;
    max-height: 200px;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--theme-text-color, #212529) 50%, transparent) transparent;
}

.scrollable-content::-webkit-scrollbar {
    width: 4px;
}

.scrollable-content::-webkit-scrollbar-track {
    background: color-mix(in srgb, var(--theme-text-color, #212529) 5%, transparent);
    border-radius: 2px;
}

.scrollable-content::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--theme-text-color, #212529) 20%, transparent);
    border-radius: 2px;
}

.scrollable-content::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--theme-text-color, #212529) 40%, transparent);
}

/* Smooth scrolling for better UX */
.scrollable-card-body,
.scrollable-content {
    scroll-behavior: smooth;
}

/* Focus styles for accessibility */
.scrollable-card-body:focus,
.scrollable-content:focus {
    outline: 2px solid var(--theme-primary-color, currentColor);
    outline-offset: 2px;
}

/* Interval Readings Component Styles */
.interval-readings-container {
    width: 100%;
}

.interval-readings-header {
    width: 100%;
}

/* Drill-down date selection panel - uses theme variables instead of hardcoded Bootstrap bg-light */
.interval-readings-drilldown-panel {
    background-color: color-mix(in srgb, var(--theme-primary-color, #0d6efd) 5%, transparent);
}

/* Current-period label shown between the Prev/Next arrows */
.interval-readings-period-label {
    font-size: 1.05rem;
}

/* Usage summary strip: a subtle insight band above the chart */
.interval-readings-summary {
    padding: 0.75rem 1rem;
    border-radius: var(--theme-card-border-radius, 0.5rem);
    background-color: color-mix(in srgb, var(--theme-primary-color, #0d6efd) 5%, transparent);
}

/* Chart container for responsive sizing */
.chart-container {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--theme-text-color, #212529) 2%, transparent);
    border-radius: 0.375rem;
    padding: 0.5rem;
    position: relative;
}

.chart-container-default {
    height: 400px;
}

/* Data table section styling */
.data-table-section {
    width: 100%;
}

/* Responsive adjustments for chart */
@media (max-width: 767.98px) {
    .chart-container {
        height: 300px !important;
        min-height: 300px;
    }
    
    .interval-readings-container .form-label {
        font-size: 0.875rem;
    }
}

@media (min-width: 768px) {
    .chart-container {
        min-height: 400px;
    }
}

/* SuperAdmin Interval Read Setup Tab Styles */
.interval-read-card-body {
    background-color: color-mix(in srgb, var(--theme-primary-color, #0d6efd) 8%, transparent);
    color: var(--theme-text-color, #212529);
}

.interval-read-card-body .card-title {
    color: var(--theme-text-color, #212529);
}

.interval-read-modal-header {
    background-color: color-mix(in srgb, var(--theme-primary-color, #0d6efd) 8%, transparent);
}

.interval-read-modal-body {
    color: var(--theme-text-color, #212529);
    background-color: var(--theme-background-color, #ffffff);
}

.interval-read-modal-overlay {
    background-color: color-mix(in srgb, var(--theme-text-color, #212529) 35%, transparent);
}

.interval-read-themed-label {
    color: var(--theme-text-color, #212529);
}

.interval-read-setup-card {
    max-width: 700px;
    width: 100%;
    margin: auto;
    padding: 0 0.5rem;
}

/* Respect users who prefer reduced motion: disable the tab fade-in and any chart/panel
   transitions in the interval-reads UI (WCAG 2.3.3). */
@media (prefers-reduced-motion: reduce) {
    .interval-read-tab.fade-in,
    .interval-readings-container,
    .interval-readings-container * {
        animation: none !important;
        transition: none !important;
    }
}
