/* ==================================================
   Sofia Night Transit Planner - Stylesheet
   Sofia 2027 - Premium Dark Theme with Leaflet Layout
   ================================================== */

:root {
    --font-header: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Theme Colors */
    --bg-main: #050a15;
    --bg-card: rgba(15, 23, 42, 0.45);
    --border-card: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(6, 182, 212, 0.4);
    
    /* Neon Colors per Line */
    --color-n1: #ff3b30;         /* Red */
    --color-n2: #007aff;         /* Blue */
    --color-n3: #34c759;         /* Green */
    --color-n4: #ff9500;         /* Orange */
    
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem 1rem;
    overflow-x: hidden;
    position: relative;
}

/* Ambient glow blobs */
.glow-bg {
    position: fixed;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    z-index: -1;
    background: 
        radial-gradient(circle at 15% 15%, rgba(0, 122, 255, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 85% 25%, rgba(255, 149, 0, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 50% 80%, rgba(52, 199, 89, 0.06) 0%, transparent 50%);
    filter: blur(80px);
    pointer-events: none;
}

/* Main Container */
.app-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 1px solid var(--border-card);
    padding-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.badge {
    background: linear-gradient(135deg, var(--color-n2), var(--color-n3));
    color: #050a15;
    font-family: var(--font-header);
    font-weight: 700;
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    letter-spacing: 0.05em;
    display: inline-block;
    margin-bottom: 0.5rem;
    box-shadow: 0 0 15px rgba(0, 122, 255, 0.35);
}

h1 {
    font-family: var(--font-header);
    font-size: 2.25rem;
    font-weight: 800;
    background: linear-gradient(to right, #ffffff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Language selector */
.lang-selector {
    display: flex;
    background: rgba(10, 15, 30, 0.6);
    border: 1px solid var(--border-card);
    border-radius: 8px;
    padding: 0.2rem;
}

.lang-btn {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    cursor: pointer;
    border-radius: 5px;
    transition: var(--transition-smooth);
}

.lang-btn.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

/* Grid Layout */
.main-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 2rem;
    align-items: stretch;
}

@media (max-width: 900px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
}

/* Sidebar */
.sidebar-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Glassmorphism Card Templates */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    transition: var(--transition-smooth);
}

.card:hover {
    border-color: rgba(6, 182, 212, 0.12);
}

.glass {
    position: relative;
    overflow: hidden;
}

.glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 200%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.01) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(25deg);
    pointer-events: none;
}

.card-title {
    font-family: var(--font-header);
    font-size: 1.15rem;
    font-weight: 600;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.icon {
    font-size: 1.25rem;
}

/* Search Box */
.search-box {
    display: flex;
    gap: 0.5rem;
}

.search-input {
    flex: 1;
    background: rgba(10, 15, 30, 0.8);
    border: 1px solid var(--border-card);
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition-smooth);
}

.search-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.15);
}

.search-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Line Selector Toggle Buttons */
.line-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.line-btn {
    border: 1px solid var(--border-card);
    background: rgba(10, 15, 30, 0.6);
    border-radius: 10px;
    padding: 0.6rem 0;
    font-family: var(--font-header);
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    outline: none;
    transition: var(--transition-fast);
    text-align: center;
}

/* Color states for active lines */
.line-btn.btn-n1 { color: var(--color-n1); }
.line-btn.btn-n2 { color: var(--color-n2); }
.line-btn.btn-n3 { color: var(--color-n3); }
.line-btn.btn-n4 { color: var(--color-n4); }

.line-btn.btn-n1.active { background: rgba(255, 59, 48, 0.12); border-color: var(--color-n1); box-shadow: 0 0 10px rgba(255, 59, 48, 0.2); }
.line-btn.btn-n2.active { background: rgba(0, 122, 255, 0.12); border-color: var(--color-n2); box-shadow: 0 0 10px rgba(0, 122, 255, 0.2); }
.line-btn.btn-n3.active { background: rgba(52, 199, 89, 0.12); border-color: var(--color-n3); box-shadow: 0 0 10px rgba(52, 199, 89, 0.2); }
.line-btn.btn-n4.active { background: rgba(255, 149, 0, 0.12); border-color: var(--color-n4); box-shadow: 0 0 10px rgba(255, 149, 0, 0.2); }

.line-btn:not(.active) {
    color: var(--text-muted) !important;
    border-color: var(--border-card) !important;
    background: transparent !important;
    opacity: 0.4;
}

.input-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Button UI */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-header);
    font-weight: 700;
    font-size: 0.85rem;
    border: none;
    outline: none;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-n2), #00b8fe);
    color: #050a15;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.45);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-card);
    color: var(--text-main);
    width: 100%;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* Recommendation badge container */
.recommendation-badge-container {
    display: flex;
    justify-content: center;
    margin: 0.5rem 0;
}

.rec-badge {
    padding: 0.6rem 2.5rem;
    border-radius: 9999px;
    font-family: var(--font-header);
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    transition: var(--transition-smooth);
}

/* Badge variants */
.rec-badge.bg-n1 { background: linear-gradient(135deg, #ff453a, #ff3b30); color: #ffffff; box-shadow: 0 0 20px rgba(255, 59, 48, 0.4); }
.rec-badge.bg-n2 { background: linear-gradient(135deg, #0a84ff, #007aff); color: #ffffff; box-shadow: 0 0 20px rgba(0, 122, 255, 0.4); }
.rec-badge.bg-n3 { background: linear-gradient(135deg, #30d158, #34c759); color: #ffffff; box-shadow: 0 0 20px rgba(52, 199, 89, 0.4); }
.rec-badge.bg-n4 { background: linear-gradient(135deg, #ff9f0a, #ff9500); color: #ffffff; box-shadow: 0 0 20px rgba(255, 149, 0, 0.4); }

.rec-badge.bg-none {
    background: linear-gradient(135deg, #475569, #334155);
    color: #cbd5e1;
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Transit Metrics details */
.transit-metrics {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.metric-label {
    color: var(--text-muted);
}

.metric-value {
    color: #ffffff;
    font-weight: 600;
    font-family: var(--font-header);
    text-align: right;
}

.font-bold {
    font-weight: 700;
    color: #ffffff;
}

.divider {
    border: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

/* Rules / General Info */
.info-details-box {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-details-header {
    font-family: var(--font-header);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-n3);
    letter-spacing: 0.03em;
}

.info-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-list li {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.info-list .bullet {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--color-n3);
    display: inline-block;
    flex-shrink: 0;
    margin-top: 5px;
}

/* Map Panel */
.map-panel {
    border: 1px solid var(--border-card);
    border-radius: 16px;
    padding: 0.25rem;
    min-height: 500px;
    height: 100%;
}

.map-container {
    width: 100%;
    height: 100%;
    min-height: 492px;
    border-radius: 12px;
    background-color: #0b111e;
}

/* Leaflet Dark Styles overrides */
.leaflet-container {
    font-family: var(--font-body);
}

.leaflet-bar {
    border: 1px solid var(--border-card) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4) !important;
    border-radius: 8px !important;
    overflow: hidden;
}

.leaflet-bar a {
    background-color: #0d1628 !important;
    color: #ffffff !important;
    border-bottom: 1px solid var(--border-card) !important;
    transition: var(--transition-smooth);
}

.leaflet-bar a:hover {
    background-color: #1a263c !important;
    color: var(--color-n2) !important;
}

.leaflet-bar a.leaflet-disabled {
    background-color: #090e18 !important;
    color: #475569 !important;
}

/* Custom Marker Styling */
.custom-search-marker {
    background: transparent;
    border: none;
}

.marker-pin {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid var(--color-n2);
    box-shadow: 0 0 10px var(--color-n2);
    animation: markerPulse 1.5s infinite ease-in-out;
}

@keyframes markerPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 8px var(--color-n2); }
    50% { transform: scale(1.15); box-shadow: 0 0 15px var(--color-n2); }
}

/* Popup overrides */
.leaflet-popup-content-wrapper {
    background: rgba(13, 22, 40, 0.9) !important;
    border: 1px solid var(--border-card) !important;
    backdrop-filter: blur(12px);
    color: #ffffff !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}

.leaflet-popup-tip {
    background: rgba(13, 22, 40, 0.9) !important;
    border: 1px solid var(--border-card) !important;
}

.leaflet-popup-content {
    font-size: 0.8rem !important;
    line-height: 1.4 !important;
    margin: 0.75rem 1rem !important;
}

.leaflet-popup-content strong {
    color: var(--color-n2);
}

/* Footer & Disclaimers */
.app-footer {
    border-top: 1px solid var(--border-card);
    padding-top: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    background: transparent;
    box-shadow: none;
}

.disclaimer-content {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
    text-align: center;
    max-width: 800px;
}

.copyright {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.15);
    text-align: center;
    margin-top: 0.5rem;
}

/* Mobile and Tablet Responsiveness Updates */
@media (max-width: 600px) {
    body {
        padding: 1rem 0.75rem;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    .badge {
        font-size: 0.7rem;
    }
    
    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .card {
        padding: 1.25rem;
    }
    
    .search-box {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
    }
    
    .search-input {
        width: 100%;
    }
    
    .btn {
        width: 100%;
    }
    
    .map-panel {
        min-height: 350px;
        height: 350px;
    }
    
    .map-container {
        min-height: 342px;
    }
}

/* Suite Navigation Bar */
.suite-nav {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-card);
    padding-bottom: 0.75rem;
}

.suite-nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--font-header);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.suite-nav-link:hover {
    color: #ffffff;
}

.suite-nav-link.active {
    color: var(--color-n2);
}


