/* Global Styles for Multi-Page Dash App */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Sidebar Navigation Styles */
.nav-link {
    display: block;
    padding: 0.75rem 1rem;
    color: #e2e8f0;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
    background-color: transparent;
}

.nav-link:hover {
    background-color: #1e293b !important;
    color: #ffffff !important;
    text-decoration: none;
}

.nav-link.active {
    background-color: #3b82f6 !important;
    color: #ffffff !important;
    font-weight: 600;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1e293b;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Data Table Styling */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table thead {
    background-color: #f3f4f6;
    position: sticky;
    top: 0;
}

.data-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.data-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    color: #1f2937;
}

.data-table tbody tr:hover {
    background-color: #f9fafb;
}

/* Button Hover Effects */
button {
    transition: all 0.2s ease;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
}

/* Card Hover Effects */
.chart-card {
    transition: all 0.3s ease;
}

.chart-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Loading Indicator */
._dash-loading {
    position: relative;
}

/* Responsive Design */
@media (max-width: 1024px) {
    /* Hide sidebar on mobile */
    #sidebar {
        transform: translateX(-100%);
    }
    
    /* Adjust main content */
    #page-content > div {
        margin-left: 0 !important;
        padding: 1rem !important;
    }
}

/* Print Styles */
@media print {
    #sidebar {
        display: none;
    }
    
    #page-content > div {
        margin-left: 0 !important;
    }
    
    button {
        display: none;
    }
}

/* Dropdown Custom Styling */
.Select-control {
    border-radius: 6px !important;
    border-color: #d1d5db !important;
}

.Select-control:hover {
    border-color: #9ca3af !important;
}

.Select-menu-outer {
    border-radius: 6px !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
    margin-top: 4px !important;
}

/* Dropdown Options Spacing */
.Select-menu-outer .Select-menu {
    max-height: 400px !important;
}

.Select-option {
    padding: 12px 16px !important;
    line-height: 1.6 !important;
    border-bottom: 1px solid #f3f4f6 !important;
    transition: all 0.15s ease !important;
}

.Select-option:last-child {
    border-bottom: none !important;
}

.Select-option:hover {
    background-color: #f3f4f6 !important;
}

.Select-option.is-focused {
    background-color: #eff6ff !important;
    color: #1e40af !important;
}

.Select-option.is-selected {
    background-color: #3b82f6 !important;
    color: white !important;
    font-weight: 500 !important;
}

/* Multi-select dropdown styling */
.Select--multi .Select-value {
    background-color: #eff6ff !important;
    border-color: #bfdbfe !important;
    color: #1e40af !important;
    margin: 2px 4px 2px 0 !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
}

.Select--multi .Select-value-icon {
    border-right-color: #bfdbfe !important;
    padding: 2px 6px !important;
}

.Select--multi .Select-value-icon:hover {
    background-color: #dbeafe !important;
    color: #1e40af !important;
}

/* Trace Selector Specific Styling */
.trace-selector-dropdown .Select-menu-outer {
    min-width: 500px !important;
}

.trace-selector-dropdown .Select-option {
    padding: 14px 18px !important;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
    font-size: 13px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.trace-selector-dropdown .Select-option:hover {
    background-color: #f0f9ff !important;
    border-left: 3px solid #3b82f6 !important;
    padding-left: 15px !important;
}

.trace-selector-dropdown .Select-option.is-focused {
    background-color: #e0f2fe !important;
    border-left: 3px solid #0ea5e9 !important;
    padding-left: 15px !important;
}

.trace-selector-dropdown .Select-option.is-selected {
    background-color: #3b82f6 !important;
    border-left: 3px solid #1e40af !important;
    padding-left: 15px !important;
}

/* Slider Styling */
.rc-slider-track {
    background-color: #6366f1 !important;
}

.rc-slider-handle {
    border-color: #6366f1 !important;
}

.rc-slider-handle:hover,
.rc-slider-handle:active {
    border-color: #4f46e5 !important;
    box-shadow: 0 0 0 5px rgba(99, 102, 241, 0.2) !important;
}

/* Modal Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

#chart-modal {
    animation: fadeIn 0.2s ease-in;
}

/* Tooltip Styling */
.dash-tooltip {
    background-color: #1f2937 !important;
    border-radius: 6px !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 0.875rem !important;
}

/* Form Input Styling */
input[type="text"],
input[type="number"] {
    transition: all 0.2s ease;
}

input[type="text"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
}

/* Checklist Styling */
.dash-checklist {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dash-checklist label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.dash-checklist label:hover {
    background-color: #f3f4f6;
}

.dash-checklist input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 0.5rem;
    cursor: pointer;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
}

.status-badge.success {
    background-color: #d1fae5;
    color: #065f46;
}

.status-badge.warning {
    background-color: #fef3c7;
    color: #92400e;
}

.status-badge.error {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-badge.info {
    background-color: #dbeafe;
    color: #1e40af;
}
