:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --border-color: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-teal: #06b6d4;
    --accent-cyan: #38bdf8;
    --accent-blue: #3b82f6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --glass-bg: rgba(30, 41, 59, 0.85);
    --glass-border: rgba(255, 255, 255, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
    --font-heading: 'Outfit', -apple-system, sans-serif;
    --font-body: 'Inter', -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.5;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* Telegram Mini App Theme Support */
body.telegram-theme {
    background-color: var(--tg-theme-bg-color, var(--bg-dark));
    color: var(--tg-theme-text-color, var(--text-primary));
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

/* Header */
.app-header {
    height: 60px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo i {
    font-size: 24px;
    color: var(--accent-teal);
}

.logo-text h1 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.region-badge {
    font-size: 11px;
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-teal);
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.header-stats .stat-pill {
    font-size: 13px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

/* Layout */
.main-layout {
    display: flex;
    flex: 1;
    height: calc(100vh - 60px);
    position: relative;
}

/* Sidebar */
.sidebar {
    width: 420px;
    background: var(--bg-dark);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 10;
    overflow: hidden;
}

.control-panel {
    padding: 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    color: var(--text-secondary);
    font-size: 14px;
}

.search-box input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.search-box input:focus {
    border-color: var(--accent-teal);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
}

/* Radius Control Card */
.radius-control-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radius-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);

}

.radius-val-display {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 16px;
    color: var(--accent-cyan);
}

.radius-stepper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.step-btn:hover {
    background: var(--accent-teal);
    color: #fff;
    border-color: var(--accent-teal);
}

.radius-stepper input[type="range"] {
    flex: 1;
    accent-color: var(--accent-teal);
    cursor: pointer;
}

.quick-radius-presets {
    display: flex;
    gap: 6px;
}

.preset-chip {
    flex: 1;
    padding: 4px 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.preset-chip.active, .preset-chip:hover {
    background: rgba(6, 182, 212, 0.2);
    border-color: var(--accent-teal);
    color: var(--accent-teal);
}

/* Filter Actions */
.filter-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.access-toggle, .fish-toggle {
    display: flex;
    background: rgba(15, 23, 42, 0.6);
    padding: 3px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    gap: 3px;
}

.filter-chip, .fish-chip {
    flex: 1;
    padding: 8px 4px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
}

.filter-chip.active, .fish-chip.active {
    background: var(--bg-card);
    color: var(--accent-cyan);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.chip-count {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.filter-chip.active .chip-count {
    background: rgba(6, 182, 212, 0.2);
    color: var(--accent-cyan);
}

.btn-search-main {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--accent-teal), var(--accent-blue));
    border: none;
    border-radius: var(--radius-md);
    color: #fff;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
    transition: all 0.2s;
}

.btn-search-main:hover {
    opacity: 0.95;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
}

/* Results Section */
.results-header {
    padding: 10px 16px;
    background: var(--bg-dark);
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.locations-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Card item */
.location-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.location-card:hover {
    border-color: var(--accent-teal);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.badge-access {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;

}

.badge-access.paid {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-access.free {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-access.unknown {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-secondary);
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.card-district {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
    padding-top: 4px;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.dist-badge {
    color: var(--accent-cyan);
    font-weight: 600;
}

.fish-tags-mini {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.fish-tag {
    font-size: 11px;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-secondary);
}

/* Map Container */
.map-container {
    flex: 1;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
    background: #090d16;
}

.map-overlay-tip {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    width: 90%;
    max-width: 520px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close-btn:hover {
    background: var(--danger);
    color: #fff;
}

.modal-header h2 {
    font-family: var(--font-heading);
    font-size: 20px;
    line-height: 1.3;
    margin-top: 8px;
}

.modal-sub {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.info-block {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
}

.block-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.block-value {
    font-size: 14px;
    color: var(--text-primary);
}

.text-success { color: var(--success); }
.text-warning { color: var(--warning); }

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.fish-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.fish-badge {
    font-size: 12px;
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
    border: 1px solid rgba(6, 182, 212, 0.3);
    padding: 4px 10px;
    border-radius: 12px;
}

.modal-footer {
    padding-top: 8px;
}

.nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}

.yandex-btn {
    background: #fc3f1d;
    color: #fff;
}

.yandex-btn:hover {
    opacity: 0.9;
}

.loading-state {
    text-align: center;
    padding: 40px 0;
    color: var(--text-secondary);
}

.loading-state i {
    font-size: 28px;
    color: var(--accent-teal);
    margin-bottom: 12px;
}

/* Responsive Mobile Layout */
@media (max-width: 850px) {
    .main-layout {
        flex-direction: column-reverse;
        height: calc(100vh - 60px);
    }
    
    .sidebar {
        width: 100%;
        height: 50vh;
        border-right: none;
        border-top: 1px solid var(--border-color);
    }
    
    .map-container {
        height: 50vh;
    }
    
    .map-overlay-tip {
        display: none;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }
}
