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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    overflow: hidden;
    height: 100vh;
}

/* Top Navigation Bar */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
}

.menu-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s;
}

.menu-btn:hover {
    background: #f0f0f0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: bold;
    color: #2196F3;
}

.logo i {
    font-size: 24px;
}

/* Auth Buttons */
.auth-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nav-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    background: #f0f0f0;
    color: #333;
}

.nav-btn.register {
    background: #2196F3;
    color: white;
}

.nav-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-btn.register:hover {
    background: #1976D2;
}

/* User Menu */
.user-menu-container {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f0f0f0;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.user-menu-btn:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
}

.user-menu-btn i:first-child {
    font-size: 20px;
    color: #2196F3;
}

.user-menu-btn i:last-child {
    font-size: 12px;
    color: #666;
}

.user-menu-btn .user-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 200px;
    display: none;
    z-index: 2000;
    overflow: hidden;
    animation: slideDown 0.2s ease;
}

.dropdown-menu.show {
    display: block !important;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: #333;
    transition: background 0.2s;
    cursor: pointer;
}

.dropdown-menu a:hover {
    background: #f5f5f5;
}

.dropdown-menu hr {
    margin: 4px 0;
    border: none;
    border-top: 1px solid #eee;
}

.dropdown-menu a:last-child {
    color: #f44336;
}

.dropdown-menu a:last-child:hover {
    background: #ffebee;
}

/* User Status Indicator */
.user-status {
    position: fixed;
    top: 70px;
    right: 16px;
    z-index: 1000;
    background: white;
    padding: 6px 12px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.user-status.logged-in {
    background: #4caf50;
    color: white;
}

.user-status.logged-out {
    background: #ff9800;
    color: white;
}

.user-status i {
    font-size: 10px;
}

.user-status:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Drawer Styles */
.drawer {
    position: fixed;
    left: -320px;
    top: 0;
    bottom: 0;
    width: 320px;
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 1002;
    transition: left 0.3s ease;
    overflow-y: auto;
    padding: 20px;
    margin-top: 60px;
    border-radius: 0 12px 12px 0;
}

.drawer.open {
    left: 0;
}

.drawer-header {
    position: relative;
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    margin-bottom: 20px;
}

.drawer-header .close-drawer {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.drawer-header .close-drawer:hover {
    background: rgba(255,255,255,0.3);
}

.drawer-header .close-drawer i {
    font-size: 18px;
}

.drawer-header i:first-of-type {
    font-size: 32px;
    color: white;
}

.drawer-header h2 {
    font-size: 20px;
    margin-top: 8px;
    color: white;
}

.drawer-section {
    margin: 20px 0;
}

.drawer-section label {
    font-weight: 600;
    color: #555;
    display: block;
    margin-bottom: 8px;
}

/* Drawer Overlay */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1001;
    display: none;
    backdrop-filter: blur(2px);
}

.drawer-overlay.active {
    display: block;
}

/* Language Switch */
.language-switch {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Radius Slider */
.radius-value {
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    color: #2196F3;
    margin: 10px 0;
}

input[type="range"] {
    width: 100%;
    margin: 10px 0;
    -webkit-appearance: none;
    background: #ddd;
    height: 4px;
    border-radius: 2px;
}

input[type="range"]:focus {
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #2196F3;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.radius-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #999;
}

/* Categories */
.categories-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 350px;
    overflow-y: auto;
    padding: 5px;
}

.category-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 20px;
    background: #f0f0f0;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid transparent;
}

.category-chip:hover {
    transform: scale(1.02);
}

.category-chip i {
    font-size: 14px;
}

.category-chip.selected {
    color: white;
    border-color: rgba(255,255,255,0.3);
}

.category-chip.GROCERY.selected { background: #4CAF50; }
.category-chip.SUPERMARKET.selected { background: #4CAF50; }
.category-chip.HYPERMARKET.selected { background: #4CAF50; }
.category-chip.SHOPPING.selected { background: #4CAF50; }
.category-chip.RESTAURANT.selected { background: #FF5722; }
.category-chip.FAST_FOOD.selected { background: #FF5722; }
.category-chip.HAIRDRESSER.selected { background: #E91E63; }
.category-chip.SPA.selected { background: #9C27B0; }
.category-chip.DENTIST.selected { background: #00BCD4; }
.category-chip.HOSPITAL.selected { background: #00BCD4; }
.category-chip.PHARMACY.selected { background: #00BCD4; }
.category-chip.FLOWER_SHOP.selected { background: #FF9800; }
.category-chip.AUTO_REPAIR.selected { background: #795548; }
.category-chip.GAS_STATION.selected { background: #795548; }
.category-chip.CAR_WASH.selected { background: #795548; }
.category-chip.BANK.selected { background: #FFC107; }
.category-chip.ATM.selected { background: #FFC107; }
.category-chip.HOTEL.selected { background: #9E9E9E; }
.category-chip.SCHOOL.selected { background: #9E9E9E; }
.category-chip.GYM.selected { background: #FF5722; }
.category-chip.VETERINARY.selected { background: #00BCD4; }
.category-chip.LAUNDRY.selected { background: #4CAF50; }
.category-chip.POST_OFFICE.selected { background: #9E9E9E; }
.category-chip.GENERAL_SERVICES.selected { background: #9E9E9E; }

/* Search Button */
.search-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.search-btn i {
    margin-right: 8px;
}

/* Map */
#map {
    height: 100vh;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* Results Panel */
.results-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 45vh;
    background: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.results-panel.open {
    transform: translateY(0);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    background: white;
    border-radius: 20px 20px 0 0;
}

.results-header h3 {
    font-size: 18px;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.close-btn:hover {
    background: #f0f0f0;
}

.results-list {
    overflow-y: auto;
    padding: 16px;
    max-height: calc(45vh - 60px);
}

.result-item {
    padding: 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 8px;
    margin-bottom: 4px;
}

.result-item:hover {
    background: #f9f9f9;
    transform: translateX(4px);
}

.result-item h4 {
    margin-bottom: 6px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-item .address {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.result-item .distance {
    font-size: 11px;
    color: #2196F3;
    font-weight: 500;
}

.result-item .category {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

.badge-registered {
    background: #4CAF50;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    display: inline-block;
}

/* Mobile App Section */
.app-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 16px;
    margin: 20px 0;
    color: white;
}

.app-promo {
    text-align: center;
}

.app-promo i.fa-mobile-alt {
    font-size: 48px;
    margin-bottom: 12px;
}

.app-promo h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.app-promo p {
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 16px;
}

.app-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 12px;
}

.download-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: transform 0.2s;
}

.download-btn:hover {
    transform: translateY(-2px);
}

.download-btn.android {
    background: #3DDC84;
    color: #000;
}

.download-btn.ios {
    background: #000;
    color: white;
}

.app-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11px;
    padding: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    margin-top: 8px;
}

.drawer-footer {
    text-align: center;
    padding: 20px 0 10px;
    font-size: 11px;
    color: #999;
}

/* Floating Action Button */
.fab-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 950;
    display: none;
}

.fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

.fab i {
    font-size: 24px;
    color: white;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Notifications */
.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: white;
    padding: 12px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 2000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideIn 0.3s ease;
    border-left: 4px solid #2196F3;
}

.notification.error {
    border-left-color: #f44336;
}

.notification i {
    font-size: 20px;
}

.notification.info i {
    color: #2196F3;
}

.notification.error i {
    color: #f44336;
}

.notification.fade-out {
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-notification {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 12px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 2000;
    animation: slideUp 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Custom Marker Popup */
.custom-popup {
    min-width: 200px;
    max-width: 280px;
}

.custom-popup h4 {
    margin: 0 0 8px 0;
    color: #2196F3;
    display: flex;
    align-items: center;
    gap: 8px;
}

.custom-popup p {
    margin: 6px 0;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.custom-popup .badge {
    background: #4CAF50;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    display: inline-block;
}

/* Responsive */
@media (max-width: 768px) {
    .drawer {
        width: 100%;
        left: -100%;
        margin-top: 0;
    }
    
    .top-nav {
        padding: 0 12px;
    }
    
    .logo span {
        display: none;
    }
    
    .nav-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .user-menu-btn .user-name {
        display: none;
    }
    
    .user-status {
        top: 60px;
        right: 8px;
        font-size: 10px;
        padding: 4px 10px;
    }
    
    .dropdown-menu {
        min-width: 180px;
        right: -10px;
    }
    
    .fab-container {
        display: block;
    }
    
    .search-btn {
        display: none;
    }
    
    .toast-notification {
        bottom: 100px;
        width: 90%;
        text-align: center;
        justify-content: center;
    }
    
    .notification {
        top: 70px;
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
    }
}
/* Force visibility for user menu */
.user-menu-container {
    display: block !important;
}

#userMenuContainer {
    display: block !important;
}

.user-menu-btn {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.dropdown-menu {
    z-index: 9999 !important;
}

/* Force user menu visibility */
#userMenuContainer {
    display: none !important;
}

#userMenuContainer[style*="block"] {
    display: block !important;
}

.user-menu-container {
    position: relative;
    display: inline-block;
}

.user-menu-btn {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 8px 12px !important;
    background: #f0f0f0 !important;
    border: none !important;
    border-radius: 20px !important;
    cursor: pointer !important;
    font-size: 14px !important;
}

.user-menu-btn i:first-child {
    font-size: 20px !important;
    color: #2196F3 !important;
}

.user-menu-btn i:last-child {
    font-size: 12px !important;
    color: #666 !important;
}

.dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    margin-top: 8px !important;
    background: white !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15) !important;
    min-width: 200px !important;
    display: none !important;
    z-index: 9999 !important;
}

.dropdown-menu.show {
    display: block !important;
}

/* Принудительное отображение меню пользователя */
#userMenuContainer {
    display: none !important;
}

#userMenuContainer[style*="block"] {
    display: block !important;
}

.user-menu-container {
    display: inline-block !important;
    position: relative !important;
}

#userMenuBtn {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 8px 16px !important;
    background: #f0f0f0 !important;
    border: none !important;
    border-radius: 20px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: 500 !important;
}

#userMenuBtn i:first-child {
    font-size: 20px !important;
    color: #2196F3 !important;
}

#userNameNav {
    font-weight: 500 !important;
    color: #333 !important;
}