/* CustomerDashboard Component Styles */

/* ===== Dashboard Container - Full Height Management ===== */
[b-customerdashboard] .dashboard-container,
.dashboard-container {
    height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 16px;
}

/* ===== Responsive Grid System ===== */
[b-customerdashboard] .dashboard-grid,
.dashboard-grid {
    display: flex;
    gap: 20px;
    height: 100%;
    overflow: hidden;
}

[b-customerdashboard] .dashboard-left-panel,
[b-customerdashboard] .dashboard-right-panel,
.dashboard-left-panel,
.dashboard-right-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ===== Data Source Selector ===== */
[b-customerdashboard] .data-source-selector,
.data-source-selector {
    margin-bottom: 12px;
}

[b-customerdashboard] .data-source-select,
.data-source-select {
    max-width: 215px;
}

/* ===== Revenue Generated Card ===== */
[b-customerdashboard] .revenue-card-wrapper,
.revenue-card-wrapper {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

[b-customerdashboard] .revenue-card,
.revenue-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

[b-customerdashboard] .revenue-card-header,
.revenue-card-header {
    padding: 12px;
    border-bottom: 1px solid var(--mud-palette-table-lines);
}

[b-customerdashboard] .revenue-card-title,
.revenue-card-title {
    margin: 0;
    padding: 0;
}

[b-customerdashboard] .revenue-filters-container,
.revenue-filters-container {
    margin-top: 8px;
}

[b-customerdashboard] .revenue-card-content,
.revenue-card-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

/* ===== Year Checkbox Row ===== */
[b-customerdashboard] .year-checkbox-row,
.year-checkbox-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

[b-customerdashboard] .year-select,
.year-select {
    max-width: 90px;
}

/* ===== Collection Efforts Section ===== */
[b-customerdashboard] .collection-efforts-header,
.collection-efforts-header {
	margin-bottom: 8px;
	margin-top: 20px;
}

[b-customerdashboard] .collection-efforts-wrapper,
.collection-efforts-wrapper {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

[b-customerdashboard] .collection-grid,
.collection-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

[b-customerdashboard] .collection-column,
.collection-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

/* ===== Card Styles ===== */
[b-customerdashboard] .effort-card,
.effort-card {
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    overflow: visible;
    background: white;
    height: auto;
}

[b-customerdashboard] .effort-card-header,
.effort-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
    flex-wrap: wrap;
    gap: 8px;
    min-height: 40px;
    flex-shrink: 0;
}

[b-customerdashboard] .effort-card-title,
.effort-card-title {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

[b-customerdashboard] .effort-card-badge,
.effort-card-badge {
    display: flex;
    align-items: center;
    gap: 2px;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    padding: 2px 4px;
    flex-shrink: 0;
    white-space: nowrap;
}

[b-customerdashboard] .effort-card-body,
.effort-card-body {
    flex: 0 0 auto;
    padding: 12px;
    overflow: visible;
    min-height: fit-content;
}

/* ===== Chevron Button ===== */
[b-customerdashboard] .chevron-button,
.chevron-button {
    width: 20px;
    height: 20px;
    padding: 0;
}

/* ===== Badge Icon ===== */
[b-customerdashboard] .badge-icon,
.badge-icon {
    font-size: 14px;
}

/* ===== Responsive Typography ===== */
[b-customerdashboard] .card-title-text,
.card-title-text {
    font-size: 0.650rem;
    font-weight: 500;
    margin: 0;
    white-space: nowrap;
}

[b-customerdashboard] .badge-percentage,
.badge-percentage {
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

[b-customerdashboard] .badge-percentage-success,
.badge-percentage-success {
    color: var(--mud-palette-success);
}

[b-customerdashboard] .badge-percentage-error,
.badge-percentage-error {
    color: var(--mud-palette-error);
}

[b-customerdashboard] .badge-label,
.badge-label {
    font-size: 0.7rem;
    color: #666;
    white-space: nowrap;
}

/* ===== Tablet Adjustments ===== */
@media (max-width: 1200px) {
    [b-customerdashboard] .collection-grid,
    .collection-grid {
        gap: 10px;
    }

    [b-customerdashboard] .card-title-text,
    .card-title-text {
        font-size: 0.8rem;
    }

    [b-customerdashboard] .badge-percentage,
    .badge-percentage {
        font-size: 0.7rem;
    }

    [b-customerdashboard] .badge-label,
    .badge-label {
        font-size: 0.65rem;
    }
}

/* ===== Mobile Layout ===== */
@media (max-width: 960px) {
    [b-customerdashboard] .dashboard-grid,
    .dashboard-grid {
        flex-direction: column;
        gap: 16px;
    }

    [b-customerdashboard] .dashboard-left-panel,
    [b-customerdashboard] .dashboard-right-panel,
    .dashboard-left-panel,
    .dashboard-right-panel {
        height: auto;
        max-height: 50vh;
    }

    [b-customerdashboard] .collection-grid,
    .collection-grid {
        grid-template-columns: 1fr;
        max-height: 600px;
    }
}

/* ===== Small Mobile ===== */
@media (max-width: 600px) {
    [b-customerdashboard] .dashboard-container,
    .dashboard-container {
        height: auto;
        padding: 8px;
    }

    [b-customerdashboard] .effort-card-header,
    .effort-card-header {
        padding: 6px 8px;
        gap: 4px;
    }

    [b-customerdashboard] .effort-card-body,
    .effort-card-body {
        padding: 8px;
    }

    [b-customerdashboard] .card-title-text,
    .card-title-text {
        font-size: 0.75rem;
    }

    [b-customerdashboard] .badge-percentage,
    .badge-percentage {
        font-size: 0.65rem;
    }

    [b-customerdashboard] .badge-label,
    .badge-label {
        font-size: 0.6rem;
    }
}

/* ===== Scrollbar Styling ===== */
[b-customerdashboard] .revenue-card-content::-webkit-scrollbar,
[b-customerdashboard] .collection-grid::-webkit-scrollbar,
.revenue-card-content::-webkit-scrollbar,
.collection-grid::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

[b-customerdashboard] .revenue-card-content::-webkit-scrollbar-track,
[b-customerdashboard] .collection-grid::-webkit-scrollbar-track,
.revenue-card-content::-webkit-scrollbar-track,
.collection-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

[b-customerdashboard] .revenue-card-content::-webkit-scrollbar-thumb,
[b-customerdashboard] .collection-grid::-webkit-scrollbar-thumb,
.revenue-card-content::-webkit-scrollbar-thumb,
.collection-grid::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

[b-customerdashboard] .revenue-card-content::-webkit-scrollbar-thumb:hover,
[b-customerdashboard] .collection-grid::-webkit-scrollbar-thumb:hover,
.revenue-card-content::-webkit-scrollbar-thumb:hover,
.collection-grid::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ===== HorizontalBarChart Component Styles ===== */
.horizontal-bar-chart {
    padding: 10px;
}

.bar-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.bar-label {
    min-width: 30px;
    font-size: 12px;
    font-weight: 500;
    color: #666;
}

.bar-container {
    flex: 1;
    margin-left: 10px;
    position: relative;
}

.bar-background {
    width: 100%;
    height: 24px;
    background-color: #f5f5f5;
    border-radius: 4px;
    position: relative;
}

.bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
    cursor: pointer;
}

.x-axis {
    display: flex;
    align-items: center;
    margin-top: 8px;
    padding-left: 40px;
}

/* ===== Custom Tooltip Styles ===== */
.custom-tooltip {
    position: relative;
}

.custom-tooltip::before,
.custom-tooltip::after {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 1000;
}

/* Tooltip content */
.custom-tooltip::before {
    content: attr(data-tooltip-label) ': ' attr(data-tooltip-value);
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    background-color: #424242;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Tooltip arrow */
.custom-tooltip::after {
    content: '';
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    border: 6px solid transparent;
    border-top-color: #424242;
}

.custom-tooltip:hover::before,
.custom-tooltip:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
