/* ==================================================================== */
/* 01. COLOR PALETTE & GLOBAL RESET */
/* ==================================================================== */

:root {
    /* --- Main Backgrounds --- */
    --dark-bg-main: #f5f5f5;
    --dark-bg-secondary: #ffffff;
    --dark-bg-header: #ffffff;

    /* --- Accent Colors --- */
    --accent-blue: #54a0ff;
    --accent-purple: #9b59b6;
    --accent-orange: #f39c12;
    --accent-red: #e74c3c;
    --accent-green: #10b981;        
    --accent-green-dark: #059669;

    /* --- Typography & Borders --- */
    --text-dark: #3b3b3b;
    --text-light: #6b7280;
    --text-muted: #9ca3af;
    --border-light: #e5e7eb;
    --border-dark: #d1d5db;

    /* --- Graph Theme Colors (from theme.py) --- */
    --plot-bg-main: #14162a;
    --plot-panel: #1a1e38;
    --plot-grid: #34495e;
    --plot-text: #222222;
    --plot-muted: #202020;
}

body {
    background: var(--dark-bg-main);
    color: var(--text-dark);
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 400;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
/* ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--dark-bg-main);
}
::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
} */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--dark-bg-main);
}
::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* AI Chat Scrollbar (lighter for dark backgrounds) */
.ai-chat-history-mini::-webkit-scrollbar,
.ai-chat-history-full::-webkit-scrollbar {
    width: 6px;
}
.ai-chat-history-mini::-webkit-scrollbar-track,
.ai-chat-history-full::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
.ai-chat-history-mini::-webkit-scrollbar-thumb,
.ai-chat-history-full::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}
.ai-chat-history-mini::-webkit-scrollbar-thumb:hover,
.ai-chat-history-full::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* ==================================================================== */
/* 02. GENERAL LAYOUT & CONTAINERS */
/* ==================================================================== */

.container-fluid {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 40px;
}

.main-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-row {
    background-color: var(--dark-bg-header);
    border-bottom: 1px solid var(--border-light);
    margin: 0 -20px;
    padding: 0 40px;
}

/* ==================================================================== */
/* 03. HEADER (LOGO, TITLE, ACTIONS) */
/* ==================================================================== */

.app-header {
    background-color: var(--dark-bg-header);
    border-bottom: 1px solid var(--border-light);
    padding: 16px 40px 0 40px;
    margin: 0 -40px 10px -40px; /* Negative margin to span full width */
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

/* Logo Section */
.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 24px;
    border-right: 2px solid var(--border-light);
}

.app-logo {
    width: 100%;
    height: 48px;
    object-fit: contain;
}

.logo-text-container {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo-text-opex { color: var(--text-dark); }
.logo-text-360ai { color: var(--accent-blue); }

/* Title Section */
.title-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.app-title {
    font-size: 28px; /* Enhanced size per override */
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -0.8px;
    margin: 0;
    padding: 12px 0;
    line-height: 1.2;
}

.app-subtitle {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-light);
    margin: -4px 0 0 0;
    padding: 0;
    line-height: 1.2;
}

/* User Actions Section */
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: var(--text-light);
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    position: relative;
}

.icon-btn:hover {
    background-color: rgba(84, 160, 255, 0.1);
    color: var(--accent-blue);
}

.icon-btn:active {
    transform: scale(0.95);
}

.notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background-color: var(--accent-red);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}

/* Profile Avatar (Green Gradient Override) */
.profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #059669);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    user-select: none;
}

.profile-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* ==================================================================== */
/* 04. TABS & NAVIGATION */
/* ==================================================================== */

.custom-tabs {
    border: none;
    background-color: white;
    border-bottom: 1px solid var(--border-light);
    margin-top: 30px;
    margin-bottom: 0px !important;
    margin-left: 20px;
    margin-right: 20px;
    padding: 0;
    border-radius: 8px;
}

.custom-tab {
    background-color: transparent !important;
    border: none !important;
    border-bottom: 3px solid transparent !important;
    padding: 16px 32px !important;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-light) !important;
    transition: all 0.2s ease;
    margin-right: 0;
}

.custom-tab:hover {
    color: var(--accent-blue) !important;
    background-color: rgba(84, 160, 255, 0.05) !important;
}

.custom-tab--selected {
    color: var(--accent-blue) !important;
    border-bottom-color: var(--accent-blue) !important;
    background-color: transparent !important;
    font-weight: 600;
}

/* ==================================================================== */
/* 05. FORM ELEMENTS (INPUTS, DROPDOWNS, SWITCHES) */
/* ==================================================================== */

/* Dropdown Label */
.dropdown-label {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-dark);
    margin-bottom: 8px;
    margin-top: 16px;
    display: block;
    text-transform: none;
    letter-spacing: 0;
}

.dropdown-label:first-of-type {
    margin-top: 0;
}

/* Input Field (Enhanced 1.5px Border) */
.input-field {
    background: white;
    color: var(--text-dark);
    border: 1.5px solid var(--border-dark);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    width: 100%;
    transition: all 0.2s;
    margin-bottom: 16px;
    box-sizing: border-box;
}

.input-field:focus {
    border-color: var(--accent-blue);
    outline: none;
    box-shadow: 0 0 0 4px rgba(84, 160, 255, 0.12);
}

.input-field::placeholder {
    color: var(--text-muted);
}

/* Dropdown Container */
.dropdown {
    margin-bottom: 16px;
}

/* Dropdown Select Control (Enhanced) */
.dropdown .Select-control {
    background-color: white !important;
    border: 1.5px solid var(--border-dark) !important;
    color: var(--text-dark) !important;
    border-radius: 10px;
    min-height: 44px;
    transition: all 0.2s;
}

.dropdown .Select-control:hover {
    border-color: var(--accent-blue) !important;
}

.dropdown .Select-placeholder {
    color: var(--text-muted) !important;
    padding-left: 4px;
    line-height: 44px !important;
}

.dropdown .Select-value {
    color: var(--text-dark) !important;
    line-height: 44px !important;
    padding-left: 4px !important;
}

.dropdown .Select-menu-outer {
    background-color: white !important;
    border: 1.5px solid var(--border-dark) !important;
    border-radius: 10px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    z-index: 2000;
}

.dropdown .Select-option {
    background-color: white !important;
    color: var(--text-dark) !important;
    padding: 12px 16px;
}

.dropdown .Select-option:hover {
    background-color: rgba(84, 160, 255, 0.1) !important;
    color: var(--accent-blue) !important;
}

/* Switches */
.form-switch .form-check-input {
    width: 44px;
    height: 24px;
    background-color: #d1d5db;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.form-switch .form-check-input:checked {
    background-color: var(--accent-blue);
}

.point-checklist .form-check-input {
    border-radius: 6px;
    width: 20px;
    height: 20px;
    margin-top: 2px;
}

.point-checklist .form-check-label {
    font-size: 14px;
    color: var(--text-dark);
    cursor: pointer;
}

/* ==================================================================== */
/* 06. BUTTONS */
/* ==================================================================== */

/* Plot Button */
.plot-btn {
    width: 100%;
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 12px 24px;
    background-color: var(--accent-blue);
    border: none;
    border-radius: 10px;
    transition: all 0.2s ease;
    color: white;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(84, 160, 255, 0.3);
}

.plot-btn:hover {
    background-color: #3d8ae8;
    box-shadow: 0 6px 14px rgba(84, 160, 255, 0.4);
    transform: translateY(-1px);
}

.plot-btn:active {
    transform: translateY(0);
}

/* Save Config Button */
.save-config-btn {
    width: 100%;
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 12px 24px;
    background: #e5e7eb;
    border: none;
    border-radius: 10px;
    transition: all 0.2s ease;
    color: var(--text-dark);
    font-size: 14px;
    cursor: pointer;
    margin-top: 0;
    height: 44px;
}

.save-config-btn:hover {
    background: #d1d5db;
    transform: translateY(-1px);
}

/* ==================================================================== */
/* 07. PANELS & CONFIGURATION */
/* ==================================================================== */

/* Control Panel (Sidebar) */
.control-panel {
    background-color: var(--dark-bg-secondary);
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-light);
    height: fit-content;
    margin-top: 8px;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin-top: 32px;
    margin-bottom: 20px;
    letter-spacing: -0.3px;
}

.section-title:first-child {
    margin-top: 0;
}

/* Graph Panel (Main Content) */
.graph-panel {
    padding-left: 24px;
}

.graph-container {
    min-height: 500px;
    height: auto;
    width: 100%;
    background-color: var(--dark-bg-secondary);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-light);
    padding: 24px;
    margin-bottom: 24px;
    transition: box-shadow 0.2s ease;
}

/* Config Sub-containers */
.config-container {
    background-color: #fafbfc;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.config-row {
    margin-bottom: 20px;
}
.config-row:last-child {
    margin-bottom: 0;
}

.bearing-config-section {
    background: linear-gradient(135deg, #f9fafb 0%, #eff6ff 100%);
    border-left: 4px solid #3b82f6;
    transition: all 0.3s ease;
}

.bearing-config-section:hover {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.config-end-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.config-validation-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.config-valid { background: #d1fae5; color: #065f46; }
.config-invalid { background: #fee2e2; color: #991b1b; }

.cpm-output {
    margin-top: 15px;
    font-size: 12px;
    color: var(--text-light);
    text-align: right;
    padding-right: 12px;
    padding-left: 12px;
}

/* ==================================================================== */
/* 13. TAB TRANSITIONS & LOADING OPTIMIZATIONS */
/* ==================================================================== */

/* Smooth tab content transitions */
.tab-content {
    animation: fadeIn 0.2s ease-in;
    will-change: opacity;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading wrapper styling */
.loading-wrapper {
    min-height: 200px;
}

/* Optimize dropdown rendering */
.Select-menu-outer {
    will-change: opacity, transform;
}

/* Smooth dropdown transitions */
.dropdown .Select-menu-outer {
    animation: dropdownSlide 0.15s ease-out;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading spinner custom styling */
._dash-loading-callback {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}

/* Optimize graph rendering */
.graph-container {
    contain: layout style;
    will-change: auto;
}

/* Prevent layout shift during loading */
.graph-panel {
    min-height: 600px;
}
/* ==================================================================== */
/* 08. UPLOAD COMPONENTS & STATUS */
/* ==================================================================== */

.upload-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin-top: 32px;
    margin-bottom: 16px;
    letter-spacing: -0.3px;
}

.upload-title:first-child {
    margin-top: 0;
}

.upload-box {
    border: 2px dashed var(--border-dark);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s ease;
    background-color: #fcfcfd;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
}

.upload-box:hover {
    border-color: var(--accent-blue);
    background-color: #f7f9fc;
}

.upload-content-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    flex-grow: 1;
}

.upload-icon {
    font-size: 24px;
    color: var(--text-muted);
    margin: 0;
    transition: color 0.3s ease;
    flex-shrink: 0;
}

.upload-box:hover .upload-icon {
    color: var(--accent-blue);
}

.upload-main-text-container {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.upload-main-text {
    color: var(--text-dark);
    font-size: 15px;
    margin: 0 0 4px 0;
    font-weight: 500;
    text-align: left;
}

.upload-info {
    color: var(--text-muted);
    font-size: 12px;
    margin: 0;
    line-height: 1.5;
    text-align: left;
}

.upload-button {
    background-color: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(84, 160, 255, 0.3);
    flex-shrink: 0;
    margin-left: auto;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-button:hover {
    background-color: #3d8ae8;
}

/* Status Messages */
.upload-success {
    background-color: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    margin-top: 15px;
    line-height: 1.5;
}

.upload-error {
    background-color: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    margin-top: 15px;
    line-height: 1.5;
}

/* Report List */
.report-file-list {
    list-style: none;
    padding-left: 0;
    margin-top: 10px;
}

.report-file-list li {
    margin: 6px 0;
}

.report-file-link {
    display: block;
    padding: 10px 14px;
    background-color: #f3f4f6;
    border-radius: 8px;
    text-decoration: none;
    color: #1f2937;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
    transition: all 0.20s ease;
}

.report-file-link:hover {
    background-color: #e0f2fe;
    border-color: #38bdf8;
    color: #0c4a6e;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.report-file-link:active {
    transform: scale(0.98);
}

/* ==================================================================== */
/* 09. AI AGENT SYSTEM (COMMON & SPECIFIC) - WHITE THEME */
/* ==================================================================== */

.ai-agent-column {
    padding-left: 16px;
    transition: all 0.3s ease;
}

/* Chat Bubble Animations & Styles */
.chat-bubble {
    margin-bottom: 15px;
    animation: slideIn 0.3s ease;
    max-width: 100%;
    overflow: hidden;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-header {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
}

.chat-sender {
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chat-message {
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.user-message {
    background: #f3f4f6;
    color: #1f2937;
    margin-left: 20px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ai-message {
    background: #0ea5a4;
    color: #ffffff;
    margin-right: 20px;
    box-shadow: 0 2px 4px rgba(14, 165, 164, 0.2);
    max-width: calc(100% - 20px);
}

.error-message {
    background: #fee2e2;
    color: #991b1b;
    margin-right: 20px;
    border: 1px solid #fecaca;
}

/* --- AI AGENT MINI (Sidebar) --- */
.ai-agent-panel-mini {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px;
    height: calc(100vh - 200px);
    min-height: 400px;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 180px;
    overflow: hidden;
}

.ai-agent-header-mini {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.ai-robot-icon {
    font-size: 28px;
    color: #0ea5a4;
    filter: none;
}

.ai-agent-title-mini {
    color: #1f2937;
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.expand-btn-mini {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 12px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.expand-btn-mini:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #374151;
}

.ai-upload-box-mini {
    background: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-upload-box-mini:hover {
    background: #f3f4f6;
    border-color: #0ea5a4;
}

.ai-upload-mini {
    color: #6b7280;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ai-chat-section-mini {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    overflow: hidden;
    margin-top: 10px;
    min-height: 0;
}

.ai-chat-history-mini {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 12px;
    padding-right: 8px;
}

.ai-input-wrapper-mini {
    display: flex;
    gap: 8px;
}

.ai-input-mini {
    flex: 1;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    color: #1f2937;
    outline: none;
    transition: border-color 0.2s ease;
}

.ai-input-mini:focus {
    border-color: #0ea5a4;
    box-shadow: 0 0 0 3px rgba(14, 165, 164, 0.1);
}

.ai-send-btn-mini {
    background: #0ea5a4;
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.ai-send-btn-mini:hover {
    background: #0d8f8e;
    box-shadow: 0 2px 4px rgba(14, 165, 164, 0.3);
}

/* --- AI AGENT FULL (Tab View) --- */
.ai-agent-panel-full {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 40px;
    min-height: calc(100vh - 250px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.ai-agent-header-full {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.ai-robot-icon-full {
    font-size: 48px;
    color: #0ea5a4;
    filter: none;
}

.ai-agent-title-full {
    color: #1f2937;
    font-size: 32px;
    font-weight: 800;
    margin: 0;
}

.minimize-btn-full {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px 18px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
    font-weight: 500;
}

.minimize-btn-full:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #374151;
}

.ai-upload-box-full {
    background: #f9fafb;
    border: 3px dashed #d1d5db;
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 20px;
}

.ai-upload-box-full:hover {
    background: #f3f4f6;
    border-color: #0ea5a4;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.ai-chat-section-full {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 25px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.ai-chat-history-full {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 15px;
    min-height: 300px;
}

/* Custom scrollbar for chat history */
.ai-chat-history-full::-webkit-scrollbar,
.ai-chat-history-mini::-webkit-scrollbar {
    width: 6px;
}

.ai-chat-history-full::-webkit-scrollbar-track,
.ai-chat-history-mini::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 3px;
}

.ai-chat-history-full::-webkit-scrollbar-thumb,
.ai-chat-history-mini::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.ai-chat-history-full::-webkit-scrollbar-thumb:hover,
.ai-chat-history-mini::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.ai-input-wrapper-full {
    display: flex;
    gap: 15px;
    align-items: center;
}

.ai-input-full {
    flex: 1;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 16px 20px;
    font-size: 15px;
    color: #1f2937;
    outline: none;
    transition: border-color 0.2s ease;
}

.ai-input-full:focus {
    border-color: #0ea5a4;
    box-shadow: 0 0 0 3px rgba(14, 165, 164, 0.1);
}

.ai-send-btn-full {
    background: #0ea5a4;
    border: none;
    border-radius: 12px;
    padding: 16px 32px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-send-btn-full:hover {
    background: #0d8f8e;
    box-shadow: 0 4px 6px rgba(14, 165, 164, 0.3);
}

/* ==================================================================== */
/* 10. PLOTLY & THIRD-PARTY OVERRIDES */
/* ==================================================================== */

.modebar {
    background-color: #f9fafb !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 4px;
    padding: 4px;
}

.modebar-btn path {
    fill: #6b7280 !important;
}

.modebar-btn:hover {
    background-color: #f3f4f6 !important;
}

/* Text Visibility Adjustments */
.js-plotly-plot .plotly .xaxislayer-above text,
.js-plotly-plot .plotly .yaxislayer-above text,
.js-plotly-plot .plotly .legendtext,
.js-plotly-plot .plotly .traces text,
.js-plotly-plot .plotly .titletext,
.js-plotly-plot .plotly .g-titles text,
.js-plotly-plot .plotly .ytick,
.js-plotly-plot .plotly .xtick,
.js-plotly-plot .plotly .color-bar text {
    fill: #1f2937 !important;
}

/* ==================================================================== */
/* 11. RESPONSIVENESS */
/* ==================================================================== */

@media (max-width: 1200px) {
    .ai-agent-column {
        margin-top: 24px;
        padding-left: 0;
        width: 100%;
    }
    
    .ai-agent-panel-mini {
        position: relative;
        top: 0;
        height: auto;
    }
}

@media (max-width: 992px) {
    .header-content {
        flex-wrap: wrap;
    }

    .logo-container {
        border-right: none;
        padding-right: 0;
    }

    .header-left {
        width: 100%;
        justify-content: space-between;
        padding-bottom: 12px;
        border-bottom: 1px solid #e5e7eb;
    }

    .header-right {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 768px) {
    .container-fluid {
        padding: 0 20px;
    }

    .app-header {
        margin: 0 -20px 10px -20px;
        padding: 16px 20px 0 20px;
    }

    .custom-tabs {
        margin: 20px -20px 0 -20px;
        padding: 0 20px;
    }

    .graph-panel {
        padding-left: 0;
        margin-top: 20px;
    }

    .upload-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .upload-content-wrapper {
        justify-content: center;
        flex-direction: column;
    }

    .upload-main-text-container {
        align-items: center;
    }

    .upload-button {
        width: 100%;
        margin-left: 0;
    }
    
    .ai-agent-panel-mini {
        height: auto;
        max-height: 400px;
    }
    
    .ai-agent-panel-full {
        padding: 20px;
    }
    
    .ai-agent-title-full {
        font-size: 24px;
    }
    
    .ai-robot-icon-full {
        font-size: 36px;
    }
}

/* Navigation button in mini AI view */
.ai-nav-btn-mini {
    display: none !important;
    width: 100%;
    padding: 10px 12px;
    background: #0ea5a4;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-nav-btn-mini:hover {
    background: #0d8f8e;
    box-shadow: 0 2px 4px rgba(14, 165, 164, 0.3);
}

.ai-nav-btn-mini:active {
    transform: translateY(1px);
}

/* Navigation button in full AI view */
.nav-btn-full {
    display: none !important;
    padding: 10px 16px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-btn-full:hover {
    background: #2563eb;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.nav-btn-full:active {
    transform: translateY(1px);
}

/* Disabled Chat Input States */
.ai-input-mini:disabled,
.ai-input-full:disabled {
    background: #f3f4f6 !important;
    border-color: #e5e7eb !important;
    cursor: not-allowed;
    opacity: 0.6;
}

.ai-send-btn-mini:disabled,
.ai-send-btn-full:disabled {
    background: #d1d5db !important;
    cursor: not-allowed;
    opacity: 0.5;
}

.ai-send-btn-mini:disabled:hover,
.ai-send-btn-full:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Chat Status Badge */
.ai-chat-status-active {
    background: #d1fae5;
    border: 1px solid #6ee7b7;
    color: #065f46;
    padding: 10px 15px;
    border-radius: 8px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
}

.ai-chat-status-disabled {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: #6b7280;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

