/* ============================================
   GHOST - Component Styles
   Sidebar, Header, and reusable components
   ============================================ */

/* ===== Sidebar Component ===== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width-collapsed);
    height: 100vh;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid var(--border-primary);
    z-index: 50;
    display: flex;
    flex-direction: column;
    transition: width var(--transition-normal);
    overflow: hidden;
}

.sidebar:hover {
    width: var(--sidebar-width-expanded);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    gap: 0.75rem;
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: linear-gradient(135deg, var(--accent-indigo) 0%, var(--accent-cyan) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.sidebar-logo-icon i {
    color: white;
    font-size: 1.125rem;
}

.sidebar-logo-text {
    font-weight: 700;
    font-size: 1.25rem;
    background: linear-gradient(135deg, var(--accent-indigo-light), var(--accent-cyan));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0;
    white-space: nowrap;
    transition: opacity var(--transition-normal);
}

.sidebar:hover .sidebar-logo-text {
    opacity: 1;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-top: 1rem;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: all var(--transition-normal);
    border-right: 2px solid transparent;
}

.sidebar-nav-item:hover {
    color: var(--accent-indigo-light);
    background: rgba(99, 102, 241, 0.05);
}

.sidebar-nav-item.active {
    color: var(--accent-indigo-light);
    background: rgba(99, 102, 241, 0.1);
    border-right-color: var(--accent-indigo);
}

.sidebar-nav-icon {
    width: 32px;
    min-width: 32px;
    font-size: 1.25rem;
    text-align: center;
}

.sidebar-nav-text {
    margin-left: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.sidebar:hover .sidebar-nav-text {
    opacity: 1;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-gray);
}

/* ===== Header Component ===== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.header-title h1 {
    font-size: 2.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-indigo-light), var(--accent-cyan), var(--accent-indigo-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.header-title p {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-glass-card);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-full);
}

.header-status-dot {
    width: 8px;
    height: 8px;
    background: var(--status-active);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.header-status-text {
    font-size: 0.875rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

.header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    cursor: pointer;
}

/* ===== Summary Card Component ===== */
.summary-card {
    background: var(--bg-glass-card);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-2xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.summary-card.border-indigo::before {
    background: var(--accent-indigo);
}

.summary-card.border-cyan::before {
    background: var(--accent-cyan);
}

.summary-card.border-purple::before {
    background: var(--accent-purple);
}

.summary-card.border-emerald::before {
    background: var(--accent-emerald);
}

.summary-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(79, 70, 229, 0.2);
}

.summary-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.summary-card-content {
    flex: 1;
}

.summary-card-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.summary-card-value {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: white;
}

.summary-card-trend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.summary-card-trend.positive {
    color: var(--accent-emerald);
}

.summary-card-trend.negative {
    color: var(--accent-red);
}

.summary-card-trend span {
    color: var(--text-muted);
}

.summary-card-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
}

.summary-card-icon.bg-indigo {
    background: rgba(99, 102, 241, 0.2);
    color: var(--accent-indigo-light);
}

.summary-card-icon.bg-cyan {
    background: rgba(6, 182, 212, 0.2);
    color: var(--accent-cyan);
}

.summary-card-icon.bg-purple {
    background: rgba(139, 92, 246, 0.2);
    color: var(--accent-purple);
}

.summary-card-icon.bg-emerald {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-emerald);
}

.summary-card-icon i {
    font-size: 1.5rem;
}

/* ===== Section Card Component ===== */
.section-card {
    background: var(--bg-glass-card);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-2xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
}

.section-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.section-card-title i {
    color: var(--accent-indigo-light);
}

/* ===== Map Component ===== */
.map-container {
    background: radial-gradient(circle at 50% 50%, var(--bg-tertiary) 0%, var(--bg-primary) 100%);
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
}

.map-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0.6;
    pointer-events: none;
}

.city-marker {
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--accent-cyan);
    border: 3px solid var(--bg-primary);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 0 15px var(--accent-cyan);
    z-index: 10;
}

.city-marker:hover {
    transform: scale(1.2);
}

.city-marker.hq {
    background: var(--accent-amber);
    box-shadow: 0 0 20px var(--accent-amber);
    width: 24px;
    height: 24px;
}

.city-marker.branch {
    background: var(--accent-indigo);
    box-shadow: 0 0 15px var(--accent-indigo);
}

.city-label {
    position: absolute;
    font-size: 0.625rem;
    color: white;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
    pointer-events: none;
    white-space: nowrap;
    background: var(--bg-glass);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-primary);
    z-index: 15;
}

.map-legend {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    background: var(--bg-glass);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-gray);
}

.map-legend h4 {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.map-legend-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.75rem;
    padding: 0.25rem 0;
}

.map-legend-item span:first-child {
    color: var(--text-muted);
}

.map-legend-item span:last-child {
    color: var(--text-secondary);
}

/* ===== Traffic Card Component ===== */
.traffic-card {
    background: rgba(31, 41, 55, 0.3);
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-xl);
    padding: 1rem;
}

.traffic-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.traffic-card-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.traffic-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.traffic-card-icon.blue {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.traffic-card-icon.purple {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

.traffic-card-icon.emerald {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.traffic-card-label {
    font-weight: 600;
    color: var(--text-primary);
}

.traffic-card-sublabel {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.traffic-card-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

.traffic-card-value.blue {
    color: #60a5fa;
}

.traffic-card-value.purple {
    color: #a78bfa;
}

.traffic-card-value.emerald {
    color: #34d399;
}

/* ===== Modal Component ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-2xl);
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
}

/* ===== Chart Container ===== */
.chart-container {
    position: relative;
    height: 200px;
}