.card {
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card-title {
    color: #666;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.card-text {
    color: #333;
    font-weight: bold;
}

.map-card {
}

.map-card .card {
    background: var(--white);
    min-width: 240px;
    margin-bottom: 8px;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    border-top: 3px solid var(--primary);
}

.map-card .card-title {
    color: var(--primaryTitle);
    font-size: 1.1rem;
    font-weight: bold;
    margin: 0;
    text-align: center;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--light-grey);
}

.map-card .metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    color: var(--grey);
    margin: 8px 0;
    padding: 4px 0;
}

.map-card .metric .label {
    color: var(--grey);
    font-weight: 500;
}

.map-card .value {
    font-weight: bold;
    color: var(--primary);
    font-size: 1.1rem;
}

/* Base layout */
html, body {
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* Main container */
.container-fluid {
    padding: 0;
    height: calc(100vh - 116px); /* 56px navbar + 60px filters */
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

.map-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 300px;
}

#map {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.floating-filters {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
    width: 300px;
}

/* DIEZ Brand Colors */
:root {
    --primary: #7474C1;
    --primary-hover: #000D5A;
    --primaryTitle: #000D5A;
    --navy-blue: #000D5A;
    --dark-blue: #1D1D55;
    --lite-blue: #B7D5ED;
    --body-color: #000000;
    --lite-purple: #9676D8;
    --lite-green: #81CFDD;
    --dal-green: #A6DCE6;
    --white: #ffffff;
    --black: #000000;
    --dark: #221f20;
    --grey: #565866;
    --light-grey: #c4c5cc;
}

body {
    font-family: 'Dubai', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: rgba(224, 232, 244, 0.9);
    overflow: hidden;
}

/* Navbar styling */
.navbar {
    background-color: var(--navy-blue) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: 700;
    color: var(--white) !important;
}

.nav-link {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.nav-link.active {
    color: var(--lite-blue) !important;
    border-bottom: 2px solid var(--lite-blue);
}

/* Map container and filters */
.floating-filters {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
    width: 300px;
}

.floating-filters .card {
    border: none;
    background: linear-gradient(rgba(255, 255, 255, 0) 0%, rgb(222, 230, 243) 100%);
    backdrop-filter: blur(8px);
}

.floating-filters .card-header {
    background-color: var(--primary);
    color: var(--white);
    border: none;
}

.floating-filters .card-header h5 {
    margin: 0;
    font-weight: 600;
    color: var(--white);
}

/* Form controls */
.form-select {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.5rem;
    font-size: 0.9rem;
}

.form-select:focus {
    border-color: var(--lite-purple);
    box-shadow: 0 0 0 0.2rem rgba(150, 118, 216, 0.25);
}

label {
    font-weight: 500;
    color: var(--navy-blue);
    margin-bottom: 0.3rem;
}

/* Map cards */
.map-card .card {
    background: var(--white);
    min-width: 240px;
    margin-bottom: 8px;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    border-top: 3px solid var(--primary);
}

.map-card .card-title {
    color: var(--primaryTitle);
    font-size: 1.1rem;
    font-weight: bold;
    margin: 0;
    text-align: center;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--light-grey);
}

.map-card .metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    color: var(--grey);
    margin: 8px 0;
    padding: 4px 0;
}

.map-card .value {
    font-weight: bold;
    color: var(--primary);
    font-size: 1.1rem;
}

/* Chosen styling */
.chosen-container {
    font-size: 0.9rem;
}

.chosen-container-multi .chosen-choices {
    padding: 4px;
    border: 1px solid #dee2e6;
    background-image: none;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.7);
}

.chosen-container-multi .chosen-choices li.search-choice {
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: none;
    border-radius: 3px;
    padding: 5px 20px 5px 8px;
}

.chosen-container-multi .chosen-choices li.search-choice .search-choice-close {
    top: 6px;
}

.chosen-container-multi .chosen-choices li.search-field input[type="text"] {
    color: var(--grey);
}

.chosen-container .chosen-drop {
    border-color: #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chosen-container .chosen-results li.highlighted {
    background: var(--primary);
    color: white;
}

/* Tenant Insights Styling */
.insights-container {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.kpi-row .card {
    margin: 0;
}

.metric-title {
    color: var(--grey);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.metric-value {
    color: var(--primary);
    font-size: 1.8rem;
    font-weight: bold;
}

.quadrants {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.quadrants .row {
    margin: 0;
    margin-bottom: 20px;
}

.quadrants .card {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

.quadrants .card-header {
    background-color: var(--white);
    border-bottom: 2px solid var(--light-grey);
    flex-shrink: 0;
    padding: 12px 15px;
}

.quadrants .card-body {
    padding: 15px;
    position: relative;
    height: 400px;  /* Fixed height for charts */
}

/* Chart container styling */
.chart-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100% !important;
    width: 100% !important;
}

#top-churners-table {
    overflow: auto;
    max-height: 300px;  /* Match card-body height */
}

.map-container canvas {
    position: absolute;
    top: 0;
    left: 0;
}

/* Only the deck.gl overlay should be pointer-events: none */
#revenue-map-overlay {
    pointer-events: none;
}

.map-tooltip {
    position: absolute;
    padding: 8px;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 4px;
    font-size: 12px;
    z-index: 1000;
}

.maintenance-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    height: 100%;
    min-height: 300px;
}

.maintenance-chart {
    position: relative;
    height: 100%;
}

.maintenance-chart .chart-title {
    text-align: center;
    margin-bottom: 10px;
    color: var(--grey);
}

.maintenance-chart #error-locations,
.maintenance-chart #risky-equipment {
    height: calc(100% - 30px);
}

#alerts-container {
    height: 100%;
    overflow-y: auto;
}

.issue-marker {
    width: 20px;
    height: 20px;
    background-color: var(--primary);
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
}

.issue-popup {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 200px;
    z-index: 1000;
}

.issue-marker:hover .issue-popup {
    display: block;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--navy-blue);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 1.2s ease-out;
}

.loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

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

.loading-logo {
    color: var(--white);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--lite-purple);
    border-top: 3px solid var(--lite-blue);
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 1s linear infinite;
}

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

/* Chat Widget */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
}

.chat-widget.collapsed {
    transform: translateY(calc(100% - 60px));
}

.chat-header {
    padding: 15px 20px;
    background: var(--navy-blue);
    color: white;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    position: relative;
    z-index: 1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chat-title {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.message.user {
    align-items: flex-end;
}

.message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    background: #f0f2f5;
}

.message.user .message-content {
    background: var(--primary);
    color: white;
}

.message.assistant .message-content {
    background: #f0f2f5;
}

.sample-questions {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
}

.sample-questions li {
    margin: 5px 0;
}

.sample-questions a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
}

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

.chat-input textarea {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 15px;
    resize: none;
    font-size: 0.9rem;
}

.chat-input button {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-input button:hover {
    background: var(--primary-hover);
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 4px 8px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: typing 1s infinite ease-in-out;
}

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

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

@keyframes typing {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Global Filters */
.global-filters {
    background: linear-gradient(rgba(255, 255, 255, 0.95) 0%, rgb(222, 230, 243) 100%);
    padding: 10px 0;
    height: 90px;
    border-bottom: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.filters-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 20px;
    padding: 0 20px;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    font-size: 0.85rem;
    color: var(--navy-blue);
    margin-bottom: 4px;
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 4px;
}

.filter-actions .btn {
    height: 31px;
    padding: 0 12px;
    font-size: 0.85rem;
}

.filter-actions .form-select {
    height: 31px;
    padding: 0 28px 0 12px;
    font-size: 0.85rem;
}

.tenant-popup {
    padding: 8px;
}

.tenant-popup h6 {
    margin: 0 0 8px 0;
    color: var(--navy-blue);
}

.tenant-popup .metric {
    display: flex;
    justify-content: space-between;
    margin: 4px 0;
    font-size: 0.9rem;
}

.tenant-popup .label {
    color: var(--grey);
}

.tenant-popup .value {
    font-weight: 500;
    color: var(--navy-blue);
}

#revenue-map,
#issues-map {
    position: absolute !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100% !important;
}

/* Insights List Styling */
.insights-list {
    height: 100%;
    overflow-y: auto;
    padding: 5px;
}

.insight-card {
    background: white;
    border-left: 4px solid var(--primary);
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.insight-card.warning {
    border-left-color: #ffc107;
}

.insight-card.danger {
    border-left-color: #dc3545;
}

.insight-card.success {
    border-left-color: #28a745;
}

.insight-card .header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.insight-card .title {
    font-weight: 600;
    color: var(--navy-blue);
}

.insight-card .actions {
    display: flex;
    gap: 8px;
}

.insight-card .action-btn {
    padding: 2px 8px;
    font-size: 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid #dee2e6;
    background: white;
}

.insight-card .action-btn:hover {
    background: #f8f9fa;
}

.insight-card .content {
    font-size: 0.9rem;
    color: var(--grey);
    margin-bottom: 8px;
}

.insight-card .metadata {
    font-size: 0.8rem;
    color: #6c757d;
} 