:root {
    --primary-color: oklch(0.69 0.175 245.42);
    --primary-color-hover: oklch(0.69 0.175 245.42 / 90%);
    --secondary-color: #1E2B3E;
    --text-color: #333333;
    --background-color: #FFFFFF;
    --card-background: #FFFFFF;
    --border-color: #E0E0E0;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.25;
}

.card {
    background-color: var(--card-background);
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.card-body {
    padding: 1.5rem;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 6px;
    transition: all 0.2s ease-in-out;
}

.btn-primary:hover {
    background-color: var(--primary-color-hover);
    border-color: var(--primary-color-hover);
    transform: translateY(-1px);
}

.powered-by-fence {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    font-size: 0.875rem;
    color: var(--primary-color);
    font-weight: 400;
    margin-top: 1rem;
    padding-top: 0.5rem;
}

/* Sticky tabs container */
.sticky-tabs-container {
    transition: box-shadow 0.2s ease-in-out;
    position: relative;
}

.sticky-tabs-container.scrolled {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1) !important;
}

.nav-tabs {
    border-bottom: 1px solid var(--border-color);
    padding: 0;
    margin-bottom: 1.5rem;
}

.nav-tabs .nav-link {
    color: #4F4F4F;
    border: none;
    font-weight: 500;
    padding: 1rem 1.5rem;
    margin-right: 0.5rem;
    transition: all 0.2s ease-in-out;
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background-color: transparent;
    border-bottom: 2px solid var(--primary-color);
}

.form-label {
    font-weight: 500;
    color: #4F4F4F;
    margin-bottom: 0.75rem;
}

/* Disabled dcc.Dropdown styles: .Select-control */
/* .form-control, .form-select, .Select-control {
    border-radius: 6px;
    border-color: var(--border-color);
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
} */
/* Preserve non-dropdown form control styles */
.form-control, .form-select {
    border-radius: 6px;
    border-color: var(--border-color);
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.table {
    color: var(--text-color);
    margin-bottom: 1.5rem;
}

.table thead th {
    background-color: #F2F2F2;
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--border-color);
}

.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th {
    background-color: #F2F2F2;
    font-weight: 600;
    padding: 0.75rem 1rem !important;
    border-bottom: 2px solid var(--border-color) !important;
}

.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td {
    font-size: 0.875rem;
    padding: 0.75rem 1rem !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1.5rem;
    padding: 0;
}

h4 {
    padding-left: 0;
    margin-top: 2rem;
    margin-bottom: 1.5rem;
}

.chart-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: #333333;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.chart-description {
    font-size: 0.875rem;
    color: #666666;
    margin-top: 0;
    margin-bottom: 1rem;
}

.chart-container {
    padding: 1.5rem;
    margin-bottom: 2.5rem;
    background-color: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.fw-bold {
    font-weight: 600 !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

.mt-4 {
    margin-top: 1.5rem !important;
}

.p-3 {
    padding: 1rem !important;
}

.px-4 {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
}

.h-100 {
    height: 100% !important;
}

.quick-action-card {
    background-color: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.quick-action-card .btn {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--card-background);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s ease-in-out;
}

.quick-action-card .btn:hover {
    background-color: var(--primary-color-hover);
    border-color: var(--primary-color-hover);
    transform: translateY(-1px);
}

.summary-table {
    font-size: 0.875rem;
}

.summary-table th {
    background-color: #F8FAFC;
    font-weight: 600;
    padding: 0.75rem 1rem;
}

.summary-table td {
    vertical-align: middle;
    padding: 0.75rem 1rem;
}

.dash-table-container {
    font-family: 'Montserrat', sans-serif;
}

.dash-spreadsheet-container .dash-spreadsheet-inner th {
    background-color: #F8FAFC !important;
    color: #4B5563 !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    font-size: 0.75rem;
    padding: 0.75rem 1rem !important;
    border: none !important;
    border-bottom: 2px solid var(--border-color) !important;
}

.dash-spreadsheet-container .dash-spreadsheet-inner td {
    font-size: 0.875rem;
    padding: 0.75rem 1rem !important;
    border: none !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner tr:hover {
    background-color: #F9FAFB !important;
}

.dash-table-container {
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th,
.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td {
    min-width: 150px;
    max-width: 300px;
    height: auto;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner tr:nth-child(even) {
    background-color: #F9FAFB;
}

#summary-text {
    background-color: #f8f9fa;
    border-left: 4px solid var(--primary-color);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: 0 8px 8px 0;
}

#user-question {
    border-radius: 20px;
    border: 1px solid #ced4da;
    padding: 0.75rem 1rem;
}

#submit-question {
    border-radius: 20px;
    padding: 0.5rem 1.25rem;
}

#ai-response {
    background-color: #e9ecef;
    border-radius: 8px;
    padding: 1.25rem;
    margin-top: 1.5rem;
}

/* Disabled dcc.Dropdown styles for #language-dropdown */
/* #language-dropdown .Select-control {
    background-color: transparent !important;
    border: none !important;
}

#language-dropdown .Select-value {
    padding: 0 !important;
}

#language-dropdown .Select-value-icon {
    display: none !important;
}

#language-dropdown .Select-value-label {
    padding: 0 !important;
}

#language-dropdown .Select-value-label img {
    border: 1px solid white;
    border-radius: 2px;
}

#language-dropdown .Select-arrow {
    border-color: white transparent transparent !important;
}

#language-dropdown .Select-menu-outer {
    background-color: #343a40 !important;
    border: 1px solid white !important;
    right: 0;
    left: auto;
}

#language-dropdown .Select-option {
    background-color: transparent !important;
    color: white !important;
    padding: 0.5rem 1rem;
}

#language-dropdown .Select-option:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
} */

@media (max-width: 768px) {
    .card {
        padding: 1.25rem;
    }

    .nav-tabs .nav-link {
        padding: 0.75rem 1rem;
    }
}

/* Remove border around charts in tabs */
#tab-content .chart-container {
    border: none;
    box-shadow: none;
    padding: 0;
    margin-bottom: 2rem;
}

/* Adjust spacing for charts */
#tab-content .chart-title {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

#tab-content .chart-description {
    margin-bottom: 1rem;
}

/* Add these styles to the end of your existing styles.css file */

/* Adjust dropdown styles */
/* .Select-control {
    height: auto !important;
}

.Select-multi-value-wrapper {
    height: auto !important;
    display: flex !important;
    align-items: center !important;
}

.Select-input {
    height: 10px !important;
}

.Select-placeholder,
.Select--single > .Select-control .Select-value {
    line-height: 40px !important;
} */

/* Adjust sidebar card styles */
.card {
    height: 100%;
    overflow-y: auto;
}

/* Ensure dropdowns don't overflow */
/* #show-controls {
    overflow-x: hidden;
} */

/* Adjust dropdown width */
/* .Select {
    width: 100% !important;
    max-width: none !important;
} */

/* Ensure dropdown options don't overflow */
/* .Select-menu-outer {
    width: auto !important;
    min-width: 100% !important;
} */

/* Loading overlay styles */
#loading-overlay {
    backdrop-filter: blur(2px);
    animation: fadeIn 0.3s ease-in-out;
}

/* Loading overlay visible state */
.loading-overlay-visible {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease-in-out;
    backdrop-filter: blur(2px);
}

/* Loading overlay hidden state */
.loading-overlay-hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

#loading-overlay.hide {
    animation: fadeOut 0.3s ease-in-out;
    opacity: 0;
    pointer-events: none;
}

/* Loading spinner enhancement */
#loading-overlay .spinner-border {
    width: 3.5rem !important;
    height: 3.5rem !important;
    border-width: 0.35rem !important;
}

/* Loading text styles */
#loading-overlay .loading-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.125rem;
    color: #495057;
    font-weight: 500;
    margin-top: 1.5rem;
    text-align: center;
}

/* Fix: dcc.Dropdown options overlapping (ensure proper wrapping and height) */

/* Reduce dropdown text size to 75% of current */
.Select,
.Select-control,
.Select-placeholder,
.Select-value,
.Select-option,
.Select-value-label,
.Select-input input {
    font-size: 95% !important;
}

/* Set dropdown option items to 90% */
.Select-option {
    font-size: 90% !important;
}
