:root {
    --uae-red: #A50000;
    --uae-green: #007A33;
    --uae-white: #FFFFFF;
    --uae-black: #111111;
    --uae-gray: #E5E7EB;

    --primary: var(--uae-green);
    --secondary: var(--uae-red);
    --bg-app: #F3F4F6;
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(0, 0, 0, 0.1);
}


.bg-uae-red {
    background-color: var(--uae-red) !important;
}

.bg-uae-green {
    background-color: var(--uae-green) !important;
}

.text-uae-red {
    color: var(--uae-red) !important;
}

.text-uae-green {
    color: var(--uae-green) !important;
}

.border-uae-red {
    border-color: var(--uae-red) !important;
}

.border-uae-green {
    border-color: var(--uae-green) !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', 'Outfit', sans-serif;
    background: var(--bg-app);
    color: var(--uae-black);
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#app {
    width: 100%;
    max-width: 430px;
    height: 100%;
    position: relative;
    background: #000;
    box-shadow: 0 0 100px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.step-container {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.step-container.active {
    display: flex;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

/* Authentication Styling */
#step-auth,
#step-verify {
    justify-content: center;
    align-items: center;
    padding: 25px;
    z-index: 100;
}

#step-auth .glass,
#step-verify .glass {
    width: 100%;
    border-radius: 2.5rem;
    padding: 3.5rem 2rem !important;
}

.lang-dropdown-container {
    position: absolute;
    top: 25px;
    right: 25px;
    z-index: 1000;
}

.lang-current {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 8px 14px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #111827;
    font-size: 13px;
    font-weight: 800;
    transition: all 0.2s;
}

.lang-current:hover {
    background: rgba(0, 0, 0, 0.08);
}

.lang-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    display: none;
    flex-direction: column;
    min-width: 100%;
    width: max-content;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.lang-menu.show {
    display: flex;
    animation: slideDown 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lang-opt {
    padding: 10px 14px;
    color: #111827;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    transition: background 0.2s;
    text-align: center;
}

.lang-opt:hover {
    background: rgba(0, 0, 0, 0.05);
}

.title-uae-red {
    color: var(--uae-red) !important;
}

/* MAP SECTION */
#step-2.active {
    display: block;
}

#map {
    width: 100% !important;
    height: 100% !important;
    position: absolute !important;
    z-index: 1;
}

/* UI OVERLAY */
.map-ui-overlay {
    position: absolute;
    inset: 0;
    z-index: 8000;
    pointer-events: none;
    display: flex;
    flex-direction: column;
}

/* TOP UI */
.map-top-section {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.map-top-left-area {
    flex: 1;
    pointer-events: auto;
    position: relative;
    max-width: calc(100% - 70px);
}

.map-right-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: auto;
    align-items: flex-end;
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 2000;
    transition: transform 0.3s ease;
}

/* Visibility logic for global controls */
.global-controls {
    display: none;
}

#step-2.active~.global-controls,
#step-profile.active~.global-controls,
#step-3-solo.active~.global-controls,
#step-radius.active~.global-controls,
#step-match.active~.global-controls,
#step-selective.active~.global-controls,
#step-history.active~.global-controls,
#step-searching.active~.global-controls,
#step-buddy-survey.active~.global-controls,
#step-admin.active~.global-controls,
#step-survey.active~.global-controls {
    display: flex !important;
}

/* Ensure stacks don't overlap if something else is there */
.map-right-stack:empty {
    display: none !important;
}

.stack-btn {
    width: 46px;
    height: 46px;
    background: rgba(26, 26, 26, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111827;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
    padding: 0;
}


.stack-btn:active {
    transform: scale(0.92);
}

.stack-btn.profile-stack-btn {
    border: 2px solid var(--uae-green);
}

#custom-layers-anchor {
    width: 46px;
    height: 46px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
}

/* CUSTOM LAYERS DROPDOWN */
#custom-layers-anchor {
    position: relative;
    pointer-events: auto;
    z-index: 3000;
}

.layers-dropdown {
    position: relative;
    width: 44px;
    height: 44px;
}

.layers-toggle-btn {
    width: 44px;
    height: 44px;
    background: rgba(26, 26, 26, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111827;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: all 0.2s;
}

.layers-toggle-btn:active {
    transform: scale(0.92);
}

.layers-menu {
    position: absolute;
    right: 54px;
    top: 0;
    background: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    padding: 6px;
    display: none;
    flex-direction: column;
    gap: 4px;
    min-width: 130px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    animation: slideInRight 0.2s ease-out;
}

.layers-menu.show {
    display: flex;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.layer-opt {
    padding: 10px 14px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-weight: 700;
}

.layer-opt i {
    width: 16px;
    height: 16px;
    opacity: 0.6;
}

.layer-opt:hover {
    background: rgba(0, 0, 0, 0.03);
    color: #111827;
}

.layer-opt.active {
    background: rgba(16, 185, 129, 0.15);
    color: #10B981;
}

.layer-opt.active i {
    opacity: 1;
}

/* Search Box & Timer Styles */
.map-search-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    height: 52px;
    display: flex;
    align-items: center;
    padding: 0 18px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 0, 0, 0.05);
    width: 100%;
}

.map-search-input {
    width: 100%;
    border: none !important;
    background: transparent !important;
    padding: 0 10px !important;
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    color: #111 !important;
    outline: none !important;
}

.search-icon {
    color: #333;
}

#active-walk-overlay {
    display: none;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    height: 52px;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    width: 100%;
    gap: 8px;
}

#active-walk-overlay.active {
    display: flex !important;
}



/* BOTTOM SECTION */
.map-bottom-section {
    margin-top: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    pointer-events: auto;
}

.ready-btn {
    width: 100%;
    background: rgba(26, 26, 26, 0.45);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #111827;
    padding: 18px;
    border-radius: 22px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    pointer-events: auto;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.ready-btn:active {
    transform: scale(0.96);
    background: rgba(26, 26, 26, 0.85);
}

/* Option Cards (Solo/Paw Selection) */
.option-card {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 65px;
}

.option-card.active {
    border-color: var(--uae-green);
    background: rgba(0, 122, 51, 0.15);
    box-shadow: 0 4px 20px rgba(0, 122, 51, 0.2);
}

.option-card:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Cascading Menu Restored Look */
.walk-cascade-menu {
    display: none;
    flex-direction: column;
    gap: 10px;
    position: absolute;
    bottom: 110px;
    left: 20px;
    right: 20px;
    z-index: 9000;
    pointer-events: auto;
}

.walk-cascade-menu.show {
    display: flex;
}

.cascade-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(15px);
    padding: 1rem;
    border-radius: 1.5rem;
    display: flex;
    align-items: center;
    gap: 14px;
    color: #111827;
    cursor: pointer;
}

/* OVERLAY PAGES */
#step-profile,
#step-history,
#step-3-solo,
#step-radius,
#step-selective,
#step-searching,
#step-buddy-survey,
#step-survey,
#step-weather,
#step-aqi,
#step-sos,
#step-match,
#step-leaderboard,
#step-group-walks,
#step-health,
#step-admin-user-profile,
#step-admin {
    background: rgba(0, 0, 0, 0.7) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    z-index: 9999 !important;
    justify-content: center !important;
    align-items: center !important;
    display: none;
}

#step-profile.active,
#step-history.active,
#step-3-solo.active,
#step-radius.active,
#step-selective.active,
#step-searching.active,
#step-buddy-survey.active,
#step-survey.active,
#step-weather.active,
#step-aqi.active,
#step-sos.active,
#step-match.active,
#step-leaderboard.active,
#step-group-walks.active,
#step-health.active,
#step-admin-user-profile.active,
#step-admin.active {
    display: flex !important;
}

#step-profile>.glass,
#step-history>.glass,
#step-3-solo>.glass,
#step-radius>.glass,
#step-selective>.glass,
#step-weather>.glass,
#step-aqi>.glass,
#step-sos>.glass,
#step-match>.glass,
#step-leaderboard>.glass,
#step-group-walks>.glass,
#step-health>.glass,
#step-admin-user-profile>.glass,
#step-admin>.glass {
    width: 92%;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 2.5rem;
    padding: 2.5rem !important;
    position: relative;
    /* Hide scrollbar */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE 10+ */
}

@keyframes slideUp {
    from {
        transform: translate3d(0, 30px, 0);
        opacity: 0;
    }
    to {
        transform: translate3d(0, 0, 0);
        opacity: 1;
    }
}

#step-profile.active>.glass,
#step-history.active>.glass,
#step-3-solo.active>.glass,
#step-radius.active>.glass,
#step-selective.active>.glass,
#step-weather.active>.glass,
#step-aqi.active>.glass,
#step-sos.active>.glass,
#step-match.active>.glass,
#step-leaderboard.active>.glass,
#step-group-walks.active>.glass,
#step-health.active>.glass,
#step-admin-user-profile.active>.glass,
#step-admin.active>.glass {
    animation: slideUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    will-change: transform, opacity;
}

/* Hide scrollbar utility */
.no-scrollbar {
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE 10+ */
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Edge */
}

/* Specific containers scrollbar hiding */
#step-profile>.glass::-webkit-scrollbar,
#step-history>.glass::-webkit-scrollbar,
#step-3-solo>.glass::-webkit-scrollbar,
#step-radius>.glass::-webkit-scrollbar,
#step-selective>.glass::-webkit-scrollbar,
#step-match>.glass::-webkit-scrollbar,
#step-leaderboard>.glass::-webkit-scrollbar,
#step-group-walks>.glass::-webkit-scrollbar,
#step-health>.glass::-webkit-scrollbar,
#step-admin-user-profile>.glass::-webkit-scrollbar,
#step-admin>.glass::-webkit-scrollbar {
    display: none;
}

/* Form Styling */
input,
select {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    border-radius: 14px;
    padding: 12px 16px;
    color: #111827 !important;
    outline: none !important;
    width: 100%;
    font-size: 0.95rem;
}

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2em;
    cursor: pointer;
}

select option {
    background: #f3f4f6;
    color: #111827;
}

/* Beautiful styling for Profile form elements */
#step-profile input,
#step-profile select {
    background: rgba(0, 0, 0, 0.03) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-radius: 12px;
    padding: 14px 16px;
    color: #111827 !important;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#step-profile input:focus,
#step-profile select:focus {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid var(--uae-green) !important;
    box-shadow: 0 0 0 3px rgba(0, 122, 51, 0.2);
    transform: translateY(-1px);
}

#step-profile select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2334d399' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

#step-profile select option {
    background: #f3f4f6;
    color: #111827fff;
    padding: 12px;
    font-size: 0.95rem;
}

#step-profile label {
    font-size: 11px !important;
}

/* Buttons */
.btn-primary {
    width: 100%;
    background: var(--uae-green);
    color: #111827;
    padding: 16px;
    border-radius: 16px;
    font-weight: bold;
    border: none;
    cursor: pointer;
}

/* Selective Walking & Radius Elements */
.sel-radius {
    transition: all 0.2s;
}

.check-item {
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.check-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.check-item.active {
    border-color: var(--uae-green) !important;
    background: rgba(0, 122, 51, 0.1) !important;
}

/* Chat Styling Refined */
#chat-overlay {
    background: rgba(26, 26, 26, 0.9);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -15px 50px rgba(0, 0, 0, 0.8);
}

.chat-bubble-me {
    background: rgba(59, 130, 246, 0.15) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    color: #111827 !important;
    border-top-right-radius: 4px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.chat-bubble-buddy {
    background: rgba(0, 0, 0, 0.03) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    color: #e5e7eb !important;
    border-top-left-radius: 4px !important;
}

.chat-bubble-system {
    background: rgba(255, 255, 255, 0.03) !important;
    color: #9ca3af !important;
    font-style: italic;
    font-size: 10px;
    text-align: center;
    width: 100%;
    padding: 8px !important;
    border-radius: 12px !important;
}

#chat-input-container {
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(0, 0, 0, 0.03);
}

#chat-input {
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    color: #111827 !important;
}

.chat-header-bar {
    width: 45px;
    height: 5px;
    background: linear-gradient(90deg, #3b82f6, #60a5fa, #3b82f6);
    border-radius: 10px;
    margin: 14px auto;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}



.snail-map-icon {
    color: var(--uae-green) !important;
}

.snail-map-icon i,
.snail-map-icon svg {
    width: 28px !important;
    height: 28px !important;
    color: var(--uae-green) !important;
    stroke: var(--uae-green) !important;
    filter: drop-shadow(0 0 5px rgba(0, 122, 51, 0.4));
}

.star-btn {
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: rgba(0, 0, 0, 0.1);
}

.star-btn i {
    width: 36px;
    height: 36px;
    stroke-width: 1.5px;
}

.star-btn.active,
.star-btn.hover-active {
    color: #FBBF24 !important;
    /* Golden/Yellow */
}

.star-btn.active i,
.star-btn.hover-active i {
    fill: #FBBF24;
    stroke: #FBBF24 !important;
    filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.6));
}

.star-btn:hover {
    transform: scale(1.2);
}

/* POI Marker Styles */
.poi-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
}

.poi-marker-icon {
    background: #EF4444;
    padding: 8px;
    border-radius: 14px;
    border: 2px solid white;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.poi-marker-icon:hover {
    transform: scale(1.1);
}

.poi-label {
    background: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(8px);
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    margin-top: 5px;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

/* Admin Dashboard Styles */
.admin-tab {
    padding: 10px 24px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 14px;
    color: #666;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    transition: all 0.3s;
    border: 1px solid transparent;
    white-space: nowrap;
}

.admin-tab.active {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
    border-color: rgba(168, 85, 247, 0.3);
}

.admin-user-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.03);
    padding: 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}



.admin-activity-item {
    font-size: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: #888;
}

.admin-activity-item b {
    color: #ddd;
}
