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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #f5f7fb;
    color: #1f2937;
}

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

/* ============================================================
   HEADER
   ============================================================ */
header {
    background: linear-gradient(135deg, #1E3A8A 0%, #3B82F6 100%);
    color: white;
    padding: 40px 0;
    text-align: center;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.subtitle {
    opacity: 0.9;
    font-size: 0.9rem;
}

/* ============================================================
   STEPS
   ============================================================ */
.steps {
    display: flex;
    justify-content: space-between;
    margin: 40px 0;
    flex-wrap: wrap;
    gap: 15px;
}

.step {
    flex: 1;
    background: white;
    padding: 15px;
    text-align: center;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    font-weight: 500;
}

.step-number {
    display: inline-block;
    width: 30px;
    height: 30px;
    background: #1E3A8A;
    color: white;
    border-radius: 50%;
    line-height: 30px;
    margin-right: 10px;
}

/* ============================================================
   STATS
   ============================================================ */
.stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 30px 0;
    padding: 20px;
    background: white;
    border-radius: 16px;
    text-align: center;
}

.stat {
    font-size: 1rem;
    color: #6b7280;
}

.stat span {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: #1E3A8A;
}

/* ============================================================
   CITY SELECTOR
   ============================================================ */
.city-selector {
    margin: 20px 0;
    padding: 20px;
    background: white;
    border-radius: 12px;
}

.city-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.city-selector select {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-top: 8px;
}

/* ============================================================
   CATEGORY SELECTOR
   ============================================================ */
.category-selector {
    margin: 20px 0;
    padding: 20px;
    background: white;
    border-radius: 12px;
}

.category-selector label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
}

.category-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.category-btn {
    padding: 8px 20px;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.category-btn:hover {
    border-color: #1E3A8A;
    background: #f0f4ff;
}

.category-btn.active {
    background: #1E3A8A;
    color: white;
    border-color: #1E3A8A;
}

/* ============================================================
   PARKING FILTER (НОВОЕ)
   ============================================================ */
.parking-filter {
    margin: 15px 0;
    padding: 15px 20px;
    background: white;
    border-radius: 12px;
}

.parking-filter label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
}

.parking-filter input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ============================================================
   FLATS GRID
   ============================================================ */
.flats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.flat-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.flat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.flat-image {
    height: 200px;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    overflow: hidden;
}

.flat-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.flat-info {
    padding: 16px;
}

.flat-address {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.flat-price {
    color: #1E3A8A;
    font-size: 1.3rem;
    font-weight: bold;
    margin: 10px 0;
}

.flat-price span {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: normal;
}

.flat-rooms {
    color: #6b7280;
    font-size: 0.9rem;
}

.flat-city {
    color: #9ca3af;
    font-size: 0.8rem;
    margin-top: 5px;
}

/* ============================================================
   PARKING IN FLAT CARD (НОВОЕ)
   ============================================================ */
.flat-parking {
    font-size: 0.8rem;
    margin-top: 4px;
}

.flat-parking.has {
    color: #1E3A8A;
}

.flat-parking.no {
    color: #9ca3af;
}

/* ============================================================
   CATEGORY BADGES
   ============================================================ */
.flat-category {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: bold;
    margin-top: 8px;
}

.flat-category.econom {
    background: #e5e7eb;
    color: #374151;
}

.flat-category.lux {
    background: #fef3c7;
    color: #92400e;
}

.flat-category.deluxe {
    background: #fed7aa;
    color: #9a3412;
}

/* ============================================================
   COMPARE CHECKBOX (НОВОЕ)
   ============================================================ */
.compare-checkbox {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ============================================================
   COMPARE BUTTON (НОВОЕ)
   ============================================================ */
.compare-btn {
    background: #1E3A8A;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    margin: 10px 0;
    transition: background 0.2s;
}

.compare-btn:hover {
    background: #3B82F6;
}

/* ============================================================
   COMPARE TABLE (НОВОЕ)
   ============================================================ */
.compare-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.compare-table th,
.compare-table td {
    border: 1px solid #e5e7eb;
    padding: 10px;
    text-align: center;
}

.compare-table th {
    background: #f3f4f6;
    font-weight: bold;
}

.compare-table tr:nth-child(even) {
    background: #f9fafb;
}

/* ============================================================
   COMPARE CLOSE BUTTON (НОВОЕ)
   ============================================================ */
.compare-close {
    background: #6b7280;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
}

.compare-close:hover {
    background: #4b5563;
}

/* ============================================================
   HISTORY ITEMS (НОВОЕ)
   ============================================================ */
.history-item {
    background: #f3f4f6;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.history-item:hover {
    background: #e5e7eb;
}

/* ============================================================
   DATE BADGE (НОВОЕ)
   ============================================================ */
.date-badge {
    background: #1E3A8A;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    display: inline-block;
}

/* ============================================================
   RECOMMENDATIONS GRID (НОВОЕ)
   ============================================================ */
.rec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.rec-item {
    background: white;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.rec-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.rec-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 6px;
}

.rec-item .address {
    font-weight: bold;
    font-size: 0.85rem;
}

.rec-item .price {
    color: #1E3A8A;
    font-weight: bold;
}

.rec-item .meta {
    font-size: 0.75rem;
    color: #6b7280;
}

.rec-item .flat-category {
    font-size: 0.6rem;
    display: inline-block;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow-y: auto;
}

.modal-content {
    background: white;
    margin: 10% auto;
    padding: 25px;
    width: 90%;
    max-width: 600px;
    border-radius: 20px;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #000;
}

/* ============================================================
   FORM
   ============================================================ */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
}

.btn-primary {
    background: #1E3A8A;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #3B82F6;
}

.btn-secondary {
    background: #6b7280;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: #4b5563;
}

.form-control {
    flex: 1;
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

/* ============================================================
   AMENITIES
   ============================================================ */
.amenities {
    margin: 15px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.amenity-badge {
    background: #e5e7eb;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
}

/* ============================================================
   RATING STARS
   ============================================================ */
.rating-stars {
    margin: 10px 0;
}

.star {
    font-size: 1.5rem;
    color: #e5e7eb;
    display: inline-block;
}

.star.filled {
    color: #fbbf24;
}

/* ============================================================
   TABS
   ============================================================ */
.tabs {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: all 0.2s;
    color: #6b7280;
}

.tab-btn:hover {
    background: #f3f4f6;
}

.tab-btn.active {
    color: #1E3A8A;
    border-bottom: 3px solid #1E3A8A;
    font-weight: bold;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ============================================================
   PROFILE BUTTON
   ============================================================ */
.btn-profile {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #1E3A8A;
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    transition: transform 0.2s;
}

.btn-profile:hover {
    transform: scale(1.05);
}

/* ============================================================
   MAP MARKERS
   ============================================================ */
.custom-marker {
    background: #1E3A8A;
    color: white;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.custom-marker.econom {
    background: #6b7280;
}

.custom-marker.lux {
    background: #f59e0b;
}

.custom-marker.deluxe {
    background: #991b1b;
}

/* ============================================================
   SHOP ITEMS
   ============================================================ */
.shop-item {
    background: #f9fafb;
    padding: 12px;
    margin: 10px 0;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.shop-item-name {
    font-weight: bold;
}

.shop-item-desc {
    font-size: 0.8rem;
    color: #6b7280;
}

.shop-item-cost {
    color: #1E3A8A;
    font-weight: bold;
    margin-right: 10px;
}

.redeem-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
}

.redeem-btn:hover {
    background: #059669;
}

.achievement-badge {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    padding: 4px 10px;
    border-radius: 20px;
    margin: 5px;
    font-size: 0.8rem;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
    background: #1f2937;
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: 50px;
}

footer p {
    margin: 5px 0;
}

/* ============================================================
   OFFLINE INDICATOR
   ============================================================ */
body.offline::before {
    content: "⚠️ Нет соединения с интернетом. Вы просматриваете сохранённые данные.";
    display: block;
    background: #f59e0b;
    color: white;
    text-align: center;
    padding: 8px;
    font-size: 0.85rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .steps {
        flex-direction: column;
    }

    .stats {
        gap: 20px;
    }

    .modal-content {
        margin: 20% auto;
        width: 95%;
    }

    .rec-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}
/* Скрыть флаг в атрибуции Leaflet */
a[href*="leafletjs.com"] svg,
.leaflet-attribution-flag {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
}
