:root {
    --primary: #1e4099;
    --accent: #e73137;
    --up-color: #10b981;
    --down-color: #ef4444;
    --bg: #f1f5f9;
    --card-bg: rgba(255, 255, 255, 0.85);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: rgba(226, 232, 240, 0.5);
    --shadow-lux: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at top left, #f8fafc, #e2e8f0);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
}

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

.hidden { display: none !important; }

/* Header */
.main-header {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    padding: 25px 0;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.brand-logo {
    height: 60px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.search-area {
    flex: 1;
    max-width: 400px;
}

.lang-switcher {
    display: flex;
    gap: 5px;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px;
    border-radius: 50px;
    border: 1px solid var(--border);
}

.btn-lang {
    border: none;
    background: transparent;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-lang.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(30, 64, 153, 0.2);
}

.btn-lang:hover:not(.active) {
    background: rgba(30, 64, 153, 0.05);
    color: var(--primary);
}


#citySearch {
    padding: 14px 25px;
    border-radius: 50px;
    border: 1px solid var(--border);
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#citySearch:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 5px rgba(30, 64, 153, 0.08);
    transform: scale(1.02);
}

/* Grid */
.city-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 25px;
    padding: 40px 0;
}

.city-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lux);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    animation: cardAppear 0.6s forwards;
}

@keyframes cardAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.city-card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 20px 40px -10px rgba(30, 64, 153, 0.15);
    background: #fff;
    border-color: var(--primary);
}

.city-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Trend Styles */
.trend-indicator {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 50px;
    font-weight: 600;
}

.trend-up {
    background: rgba(16, 185, 129, 0.1);
    color: var(--up-color);
}

.trend-down {
    background: rgba(239, 68, 68, 0.1);
    color: var(--down-color);
}

.trend-stable {
    background: rgba(100, 116, 139, 0.1);
    color: var(--text-muted);
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.price-row .label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.price-row .price-val {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.price-row .change-pct {
    font-size: 11px;
    margin-left: 5px;
    opacity: 0.8;
}

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
}

.modal-content {
    background: #fff;
    width: 100%;
    max-width: 650px;
    border-radius: 32px;
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transform: scale(0.9);
    animation: modalScale 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes modalScale {
    to { transform: scale(1); }
}

.modal-header {
    padding: 30px 40px;
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 20px;
    width: 40px; height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-close:hover {
    background: var(--accent);
    transform: rotate(90deg);
}

.modal-body {
    padding: 40px;
    max-height: 70vh;
    overflow-y: auto;
}

.district-table th {
    background: transparent;
    border-bottom: 2px solid var(--bg);
    padding: 15px;
    text-align: left;
    font-size: 12px;
    color: var(--text-muted);
}

.district-table td {
    padding: 18px 15px;
    border-bottom: 1px solid var(--bg);
    font-size: 15px;
    font-weight: 500;
}

.main-footer {
    padding: 60px 0;
    text-align: center;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13px;
}

#lastUpdate {
    font-weight: 600;
    color: var(--primary);
}

@media (max-width: 768px) {
    .main-header .container { flex-direction: column; text-align: center; }
    .brand-logo { height: 50px; }
    .search-area { width: 100%; }
}
