/* ========================================
   CONSOLIDATED DASHBOARD CSS
   Clean, organized, no duplicates
   ======================================== */

/* ========================================
   1. GLOBAL RESET & BASE STYLES
   ======================================== */
* {
    box-sizing: border-box;
}

html, body {
    height: 100vh;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #f0f2f5;
    overflow-x: hidden;
}

/* Dash app containers */
#react-entry-point,
#react-entry-point > div,
body > div:first-child {
    min-height: 100vh;
    height: auto;
}

/* ========================================
   2. LAYOUT STRUCTURE
   ======================================== */
.dashboard-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 10px;
}

/* Dashboard Header */
.dashboard-header {
    height: 60px;
    flex-shrink: 0;
    margin-bottom: 10px;
    background-color: white;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 2px solid #dee2e6;
}

.dashboard-header h1 {
    color: #333;
    font-size: 24px;
    font-weight: bold;
    margin: 0;
    text-align: center;
}

/* ========================================
   3. TABS STYLING
   ======================================== */
.tabs-container,
.dash-tabs {
    flex-shrink: 0;
    margin-bottom: 10px;
    z-index: 999;
    position: relative;
}

/* Tab buttons */
.tab {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    border: 2px solid #dee2e6 !important;
    border-bottom: none !important;
    border-radius: 12px 12px 0 0 !important;
    color: #495057 !important;
    padding: 12px 36px !important;
    margin-right: 4px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
    min-width: 108px !important;
    text-align: center !important;
}

.tab:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%) !important;
    color: #212529 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15) !important;
}

.tab.tab--selected {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%) !important;
    color: white !important;
    border-color: #0056b3 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0,123,255,0.3) !important;
    z-index: 10 !important;
}

/* Tab content area */
.tab-content {
    flex: 1;
    min-height: calc(100vh - 160px);
    display: flex;
    flex-direction: column;
    background-color: white;
    border: 2px solid #dee2e6;
    border-radius: 0 8px 8px 8px;
    padding: 20px;
    margin-top: -2px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* ========================================
   4. CHART LAYOUT
   ======================================== */
/* Chart row - side by side charts */
.chart-row {
    flex: 1;
    display: flex;
    gap: 15px;
    min-height: 500px;
    margin-bottom: 20px;
}

/* Chart containers */
.chart-container {
    flex: 1;
    min-height: 500px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* Chart size variants */
.chart-large {
    width: 70%;
}

.chart-medium {
    width: 48%;
}

.chart-small {
    width: 30%;
}

.chart-wide {
    width: 80%;
    max-width: 1200px;
    margin: 0 auto;
}

/* ========================================
   5. CHART TITLES & NAVIGATION
   ======================================== */
.chart-title {
    height: 25px;
    min-height: 25px;
    flex-shrink: 0;
    font-size: 14px;
    font-weight: bold;
    color: #333;
    text-align: center;
    margin: 0 0 10px 0;
    padding: 5px;
    background-color: #f8f9fa;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Navigation controls - unified styling */
.dtd-navigation-controls,
.wtw-navigation-controls {
    height: 40px;
    min-height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 0 0 10px 0;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

/* Dropdown in navigation controls */
.dtd-navigation-controls .dash-dropdown,
.wtw-navigation-controls .dash-dropdown {
    height: 28px;
    min-height: 28px;
}

.dtd-navigation-controls .dash-dropdown .Select-control,
.wtw-navigation-controls .dash-dropdown .Select-control {
    height: 28px !important;
    line-height: 26px !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    background-color: white !important;
    font-size: 12px !important;
}

/* Date picker in navigation controls */
.dtd-navigation-controls .DateRangePickerInput,
.wtw-navigation-controls .DateRangePickerInput {
    height: 28px !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    background-color: white !important;
}

.dtd-navigation-controls .DateInput,
.wtw-navigation-controls .DateInput {
    height: 28px !important;
    width: 90px !important;
}

.dtd-navigation-controls .DateInput_input,
.wtw-navigation-controls .DateInput_input {
    height: 26px !important;
    line-height: 26px !important;
    font-size: 11px !important;
    padding: 0 4px !important;
}

/* Labels in navigation */
.dtd-navigation-controls label,
.wtw-navigation-controls label {
    font-size: 12px;
    font-weight: bold;
    color: #333;
    margin: 0;
}

/* Remove the old container styling that's not needed */
#date-range-container,
#day-navigation-container {
    position: relative;
}

/* Clean up any extra styling on the dropdown containers */
.dtd-navigation-controls > div,
.wtw-navigation-controls > div {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Radio button styling in navigation controls */
.period-radio-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

.period-radio-group label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: normal;
    color: #333;
    cursor: pointer;
    margin: 0;
    padding: 2px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.period-radio-group label:hover {
    background-color: rgba(46, 134, 171, 0.1);
}

.period-radio-group input[type="radio"] {
    width: 14px;
    height: 14px;
    margin: 0;
    cursor: pointer;
    accent-color: #2E86AB;
}

.period-radio-group input[type="radio"]:checked + span {
    color: #2E86AB;
    font-weight: bold;
}

/* Radio button container in navigation */
.dtd-navigation-controls .period-radio-group {
    background-color: white;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* ========================================
   6. CHARTS & GRAPHS
   ======================================== */
/* All chart graphs */
#dtd-sales-chart,
#wtw-sales-chart,
#ytd-sales-chart,
#mtd-sales-chart,
#ytd-profit-chart,
#mtd-profit-chart,
#sales-time-chart {
    flex: 1;
    min-height: 400px;
    width: 100%;
}

/* Plotly specific */
.plotly-graph-div {
    z-index: 1 !important;
}

/* ========================================
   7. FORM CONTROLS & DROPDOWNS - CLEAN VERSION
   ======================================== */
/* Base form elements */
label {
    font-weight: bold;
}

/* Clean dropdown styling - no overlaps */
.dash-dropdown {
    position: relative;
    height: 36px;
    line-height: 36px;
    min-height: 36px;
}

.dash-dropdown .Select {
    height: 36px;
}

.dash-dropdown .Select-control {
    height: 36px !important;
    line-height: 34px !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    background-color: white !important;
    cursor: pointer !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
}

.dash-dropdown .Select-control:hover {
    border-color: #007bff !important;
}

.dash-dropdown .Select-control:focus {
    border-color: #007bff !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25) !important;
}

/* Value container - no overlap */
.dash-dropdown .Select-value-container {
    padding-left: 8px !important;
    padding-right: 30px !important;
    flex: 1 !important;
    height: 34px !important;
    line-height: 34px !important;
    overflow: hidden !important;
}

/* Arrow zone - positioned properly */
.dash-dropdown .Select-arrow-zone {
    position: absolute !important;
    right: 0 !important;
    top: 0 !important;
    width: 25px !important;
    height: 34px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    z-index: 2 !important;
}

/* Arrow - clean triangle */
.dash-dropdown .Select-arrow {
    border-color: #999 transparent transparent !important;
    border-style: solid !important;
    border-width: 5px 5px 0 !important;
    display: block !important;
    height: 0 !important;
    width: 0 !important;
    margin: 0 !important;
}

.dash-dropdown .Select-control:hover .Select-arrow {
    border-top-color: #007bff !important;
}

/* Remove any pseudo-elements that might cause overlap */
.dash-dropdown .Select-control::before,
.dash-dropdown .Select-control::after {
    display: none !important;
}

/* Time period dropdown - specific clean styling */
#time-period-dropdown {
    position: relative !important;
    z-index: 100 !important;
}

#time-period-dropdown .Select-control {
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    background-color: white !important;
    box-shadow: none !important;
}

/* Dropdown menu - clean positioning */
.dash-dropdown .Select-menu-outer {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1000 !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    background-color: white !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    margin-top: 1px !important;
}

/* Menu options */
.dash-dropdown .Select-option {
    padding: 8px 12px !important;
    cursor: pointer !important;
    background-color: white !important;
    border: none !important;
}

.dash-dropdown .Select-option:hover {
    background-color: #f8f9fa !important;
}

.dash-dropdown .Select-option.is-selected {
    background-color: #007bff !important;
    color: white !important;
}

/* Date picker styling - clean */
.DateInput_input {
    height: 36px !important;
    line-height: 34px !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    padding: 0 8px !important;
    font-size: 13px !important;
    background-color: white !important;
}

.DateRangePicker {
    position: relative !important;
}

.DateInput {
    height: 36px !important;
    width: 100px !important;
    position: relative !important;
}

/* Container sizing - clean */
#date-range-container {
    max-width: 250px;
    position: relative;
}

#day-navigation-container {
    max-width: 220px;
    position: relative;
}

.DateRangePickerInput {
    display: flex !important;
    align-items: center !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    background-color: white !important;
    padding: 0 !important;
}

/* ========================================
   8. DATA DISPLAYS
   ======================================== */
/* Sales total displays */
.sales-total {
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    margin: 10px 0;
    color: #2c3e50;
}

.sales-total-large {
    font-size: 1.8rem;
    font-weight: bold;
    text-align: center;
    margin: 15px 0;
    color: #2c3e50;
}

.today-total {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 8px 0;
    text-align: center;
}

.daily-summary {
    font-size: 1rem;
    margin: 5px 0;
    padding: 5px;
}

.number {
    font-size: 40px;
    font-weight: bold;
}

/* ========================================
   9. RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 1024px) {
    .chart-wide {
        width: 95%;
    }
    
    .chart-medium {
        width: 48%;
        min-width: 300px;
    }
}

@media (max-width: 768px) {
    .chart-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .chart-container {
        width: 100%;
        height: 45%;
        min-height: 400px;
    }
    
    .chart-medium,
    .chart-small,
    .chart-large {
        width: 100%;
    }
    
    .dashboard-header h1 {
        font-size: 18px;
    }
    
    .tab {
        padding: 8px 20px !important;
        font-size: 12px !important;
        min-width: 80px !important;
    }
}

@media (max-height: 600px) {
    .dashboard-header {
        height: 40px;
        padding: 5px;
    }
    
    .dashboard-header h1 {
        font-size: 16px;
    }
    
    .tab-content {
        min-height: calc(100vh - 100px);
    }
    
    .chart-container {
        min-height: 350px;
    }
}

/* ========================================
   10. UTILITY CLASSES
   ======================================== */
.filter-container {
    margin-bottom: 20px;
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
}

.content-container {
    margin: 0 2rem;
    padding: 2rem 1rem;
}

/* Remove scrollbars */
* {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

*::-webkit-scrollbar {
    display: none;
}

/* Add this new section for radio button styling */

/* ========================================
   11. RADIO BUTTON STYLING (DROPDOWN REPLACEMENT)
   ======================================== */

/* Radio button group container - reduced width */
.time-period-radio-group {
    display: flex;
    gap: 8px;  /* Reduced gap between radio buttons */
    align-items: center;
    padding: 4px 8px;
    width: auto;  /* Auto width instead of 100% */
    min-width: 200px;  /* Minimum width to prevent too small */
    max-width: 240px;  /* Maximum width to keep it compact */
}

/* Individual radio button labels - more compact */
.time-period-radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;  /* Space between button and title */
    font-size: 14px;
    font-weight: normal;
    color: #333;
    cursor: pointer;
    margin: 0;
    padding: 6px 10px;  /* Reduced horizontal padding */
    border-radius: 4px;
    transition: all 0.2s ease;
    background-color: white;
    border: 1px solid transparent;
    min-width: 70px;  /* Reduced minimum width */
    justify-content: flex-start;
    white-space: nowrap;  /* Prevent text wrapping */
}

/* Radio button label hover effect */
.time-period-radio-group label:hover {
    background-color: #f0f8ff;
    border-color: #007bff;
    color: #007bff;
}

/* Radio button input styling */
.time-period-radio-group input[type="radio"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    accent-color: #007bff;
    flex-shrink: 0;  /* Prevent radio button from shrinking */
}

/* Selected radio button styling */
.time-period-radio-group input[type="radio"]:checked + span {
    color: #007bff;
    font-weight: 600;
}

/* Selected radio button parent label styling */
.time-period-radio-group label:has(input[type="radio"]:checked) {
    background-color: #e7f3ff;
    border-color: #007bff;
    color: #007bff;
    font-weight: 600;
}

/* Ensure text doesn't wrap */
.time-period-radio-group span {
    white-space: nowrap;
    margin-left: 4px;  /* Additional small space between button and text */
}

/* Add these styles to improve the date picker appearance */

/* Enhanced date picker styling */
#date-range-picker {
    width: 280px !important;
}

.DateRangePickerInput {
    width: 280px !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    background-color: white !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    height: 38px !important;
}

.DateInput {
    width: 130px !important;
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
}

.DateInput_input {
    height: 36px !important;
    line-height: 36px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #333 !important;
    padding: 0 8px !important;
    border: none !important;
    background-color: transparent !important;
    width: 100% !important;
}

.DateInput_input::placeholder {
    color: #666 !important;
    font-weight: 500 !important;
}

/* Date range arrow styling */
.DateRangePickerInput_arrow {
    padding: 0 8px !important;
    color: #666 !important;
    font-weight: bold !important;
}

/* Navigation button spacing improvements */
.nav-button {
    background-color: #2E86AB;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    height: 36px;
    min-width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-button:hover {
    background-color: #1f5f7a;
}

/* Date display between arrows */
.date-display {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-align: center;
    min-width: 120px;
    padding: 0 8px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    height: 36px;
    line-height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
}

