/* ADTGM Dashboard Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    height: 100vh;
    overflow: hidden;
}

.dashboard {
    display: flex;
    height: 100vh;
}

/* Left Sidebar */
.sidebar {
    width: 350px;
    background: #2c3e50;
    color: white;
    padding: 20px;
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.sidebar h2 {
    color: #ecf0f1;
    margin-bottom: 5px;
    font-size: 24px;
}

.subtitle {
    color: #bdc3c7;
    font-size: 14px;
    margin-bottom: 20px;
}

.section {
    margin-bottom: 25px;
}

.sidebar h3 {
    color: #ecf0f1;
    margin-bottom: 10px;
    font-size: 16px;
    border-bottom: 1px solid #34495e;
    padding-bottom: 5px;
}

/* Form Elements */
select, button {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    border: 1px solid #34495e;
    border-radius: 6px;
    font-size: 14px;
    background: #34495e;
    color: white;
}

select:focus, button:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.toggle-btn {
    background: #3498db;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.toggle-btn:hover {
    background: #2980b9;
}

.site-info {
    background: #34495e;
    padding: 15px;
    border-radius: 6px;
    margin: 10px 0;
    max-height: 300px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.4;
}

/* Main Area */
.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px;
    gap: 10px;
}

/* Right Panel */
.right-panel {
    width: 400px;
    display: flex;
    flex-direction: column;
    padding: 10px;
    gap: 10px;
    transition: width 0.3s ease;
}

.right-panel.hidden {
    width: 0;
    padding: 0;
    overflow: hidden;
}

/* Panel Cards */
.panel-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e1e8ed;
}

.panel-card h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Specific Panel Heights */
.main-area .panel-card:nth-child(1) { height: 480px; } /* Map */
.main-area .panel-card:nth-child(2) { height: 450px; } /* Traffic Profile */
.main-area .panel-card:nth-child(3) { height: 370px; } /* LLM Analysis */

.right-panel .panel-card:nth-child(1) { height: 180px; } /* Peak Hours (Entry/Exit) - reduced */
.right-panel .panel-card:nth-child(2) { height: 280px; } /* Traffic Proportion */
.right-panel .panel-card:nth-child(3) { height: 320px; } /* Person Modes */
.right-panel .panel-card:nth-child(4) { height: 350px; } /* Parking Profile - new */

/* Chart Containers */
#map, #traffic-profile, #parking-profile, 
#traffic-proportion, #person-modes {
    width: 100%;
    height: calc(100% - 40px);
}

/* Peak hours has less padding for compact view */
#peak-hours {
    width: 100%;
    height: calc(100% - 20px);
    display: flex;
    align-items: center;
}

/* Loading Screen */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 62, 80, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #34495e;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    font-size: 18px;
    color: #ecf0f1;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .right-panel {
        width: 300px;
    }
    
    .sidebar {
        width: 280px;
    }
}

@media (max-width: 768px) {
    .dashboard {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 200px;
    }
    
    .right-panel {
        width: 100%;
        flex-direction: row;
        height: auto;
    }
    
    .main-area {
        height: auto;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-10 {
    margin-top: 10px;
}

.mb-10 {
    margin-bottom: 10px;
}

/* Chart Styling */
.plotly-graph-div {
    border-radius: 4px;
}

/* Map Styling */
.leaflet-container {
    border-radius: 4px;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}
/* Custom
 map markers */
.custom-marker {
    background: transparent !important;
    border: none !important;
}

.custom-marker div {
    cursor: pointer;
}

/* Site group legend */
.group-legend {
    position: absolute;
    top: 10px;
    right: 10px;
    background: white;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 1000;
    font-size: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    border: 1px solid #ccc;
}

/* Chat Container Styles */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 400px;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
}

/* Chat Container in Sidebar */
.chat-container-sidebar {
    display: flex;
    flex-direction: column;
    height: 350px;
    background: #34495e;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #2c3e50;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-container-sidebar .chat-messages {
    background: #2c3e50;
    padding: 10px;
    gap: 8px;
    height: 220px;
    max-height: 220px;
}

.chat-message {
    padding: 10px 15px;
    border-radius: 8px;
    max-width: 80%;
    word-wrap: break-word;
}

.chat-container-sidebar .chat-message {
    padding: 8px 12px;
    font-size: 13px;
    max-width: 90%;
}

.chat-message.user {
    background: #3498db;
    color: white;
    align-self: flex-end;
    margin-left: auto;
}

.chat-message.bot {
    background: #ecf0f1;
    color: #2c3e50;
    align-self: flex-start;
}

.chat-message.error {
    background: #e74c3c;
    color: white;
    align-self: center;
    text-align: center;
}

.chat-input {
    display: flex;
    padding: 15px;
    background: #ffffff;
    border-top: 1px solid #e1e4e8;
    gap: 10px;
}

.chat-container-sidebar .chat-input {
    padding: 10px;
    background: #34495e;
    border-top: 1px solid #2c3e50;
    gap: 8px;
}

#chat-input-text {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
}

.chat-container-sidebar #chat-input-text {
    padding: 8px;
    font-size: 13px;
    background: #2c3e50;
    color: #ecf0f1;
    border: 1px solid #1a252f;
}

#chat-input-text:focus {
    border-color: #3498db;
}

.chat-container-sidebar #chat-input-text:focus {
    border-color: #3498db;
    background: #1a252f;
}

#chat-send-btn {
    padding: 10px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s;
}

.chat-container-sidebar #chat-send-btn {
    padding: 8px 16px;
    font-size: 13px;
}

#chat-send-btn:hover {
    background: #2980b9;
}

#chat-send-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px 15px;
    background: #ecf0f1;
    border-radius: 8px;
    align-self: flex-start;
    max-width: 60px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #7f8c8d;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Example Queries Container */
.example-queries-container {
    position: relative;
    margin-top: 8px;
    border-top: 1px solid #2c3e50;
    padding-top: 8px;
}

/* Example Toggle Button */
.examples-header {
    text-align: center;
    margin-bottom: 8px;
}

.examples-toggle {
    display: inline-block;
    padding: 6px 12px;
    background: #2c3e50;
    color: #3498db;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s;
    border: 1px solid #34495e;
}

.examples-toggle:hover {
    background: #34495e;
    color: #5dade2;
    transform: translateY(-1px);
}

/* Example Queries List */
.example-queries {
    background: #1a252f;
    border-radius: 8px;
    padding: 8px;
    margin-top: 8px;
    max-height: 200px;
    overflow-y: auto;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 200px;
    }
}

.examples-title {
    font-size: 12px;
    font-weight: 700;
    color: #7f8c8d;
    margin-bottom: 6px;
    margin-top: 4px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(127, 140, 141, 0.2);
}

.chat-container-sidebar .examples-title {
    color: #3498db;
    border-bottom-color: rgba(52, 152, 219, 0.2);
}

.example-query-btn {
    display: block;
    width: 100%;
    padding: 8px 10px;
    margin: 4px 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-align: left;
    font-size: 12px;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-container-sidebar .example-query-btn {
    background: #2c3e50;
    border: 1px solid #34495e;
    color: #ecf0f1;
    font-size: 11px;
    padding: 5px 6px;
    margin: 3px 0;
}

.example-query-btn:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
    transform: translateX(2px);
}

.chat-container-sidebar .example-query-btn:hover {
    background: #3498db;
    border-color: #3498db;
}

/* Custom scrollbar for examples */
.example-queries::-webkit-scrollbar {
    width: 6px;
}

.example-queries::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.example-queries::-webkit-scrollbar-thumb {
    background: rgba(52, 152, 219, 0.4);
    border-radius: 3px;
}

.example-queries::-webkit-scrollbar-thumb:hover {
    background: rgba(52, 152, 219, 0.6);
}

/* LLM Analysis Container Styles */
.llm-analysis-container {
    display: flex;
    flex-direction: column;
    height: 400px;
    background: #ffffff;
    border-radius: 8px;
    overflow: auto;
    padding: 15px;
}

#llm-visualization {
    width: 100%;
    min-height: 300px;
    margin-bottom: 15px;
}

#llm-data-table {
    width: 100%;
    overflow-x: auto;
}

.llm-analysis-container table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.llm-analysis-container th,
.llm-analysis-container td {
    padding: 10px;
    text-align: left;
    border: 1px solid #e1e4e8;
}

.llm-analysis-container th {
    background: #f6f8fa;
    font-weight: 600;
    color: #24292e;
}

.llm-analysis-container tr:hover {
    background: #f6f8fa;
}

.llm-analysis-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6c757d;
    text-align: center;
}

.llm-analysis-empty svg {
    width: 64px;
    height: 64px;
    margin-bottom: 15px;
    opacity: 0.3;
}
