/* ========================================
   Навикод — Главные стили
   ======================================== */

/* === Base Styles === */
* {
    font-family: 'Inter', sans-serif;
}

html {
    scroll-behavior: smooth;
}

/* === Gradients === */
.gradient-bg {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0c4a6e 100%);
}

.bg-section-gradient {
    background: linear-gradient(180deg, #0f172a 0%, #0c1929 50%, #0f172a 100%);
}

.gradient-text {
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* === Cards & Hover Effects === */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(56, 189, 248, 0.15);
}

/* === Navigation === */
.nav-blur {
    backdrop-filter: blur(12px);
    background: rgba(15, 23, 42, 0.85);
}

/* Dropdown Menu */
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown-menu:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown:hover .nav-dropdown-btn svg {
    transform: rotate(180deg);
}

/* Mobile Dropdown */
.mobile-dropdown-btn.active svg {
    transform: rotate(180deg);
}


/* === Glow Effect === */
.glow {
    box-shadow: 0 0 40px rgba(56, 189, 248, 0.3);
}

/* === Animations === */
.animate-float {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* === Hexagon Pattern === */
.hexagon-pattern {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0l25.98 15v30L30 60 4.02 45V15z' fill='none' stroke='%2338bdf8' stroke-opacity='0.05' stroke-width='1'/%3E%3C/svg%3E");
}

/* === Tabs === */
.tab-active {
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    color: white;
}

.tab-panel {
    display: none;
}

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

/* === Accordion === */
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-content.open {
    max-height: 2500px;
}

/* === Counter Animation === */
.counter {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.counter.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === Three.js Container === */
#three-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* === Scroll to Top Button === */
.scroll-top-btn {
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
}

/* === Telegram Button === */
.telegram-btn {
    animation: pulse-telegram 2s infinite;
}

@keyframes pulse-telegram {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 136, 204, 0.4);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(0, 136, 204, 0);
    }
}

/* === Smart Exit Intent Popup === */
.exit-popup {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(4px);
}

.exit-popup.visible {
    opacity: 1;
    visibility: visible;
}

.exit-popup.visible > div {
    animation: popupSlideIn 0.4s ease-out;
}

@keyframes popupSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Pulse animation for popup icon */
.animate-pulse-slow {
    animation: pulse-slow 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-slow {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Mobile optimizations for popup */
@media (max-width: 640px) {
    .exit-popup {
        padding: 1rem;
    }
    
    .exit-popup > div {
        padding: 1.5rem;
        max-width: 100%;
    }
    
    #exit-popup-title {
        font-size: 1.5rem;
    }
    
    #exit-popup-description {
        font-size: 0.875rem;
    }
}

/* === Language Switcher === */
.lang-switch {
    cursor: pointer;
}

.lang-switch:hover {
    color: #38bdf8;
}

/* === Modal === */
.modal {
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.visible {
    opacity: 1;
    visibility: visible;
}

/* === Testimonials Slider === */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.testimonial-slide {
    flex: 0 0 calc(100% - 24px);
    min-width: calc(100% - 24px);
    scroll-snap-align: start;
}

@media (min-width: 768px) {
    .testimonial-slide {
        flex: 0 0 calc(50% - 12px);
        min-width: calc(50% - 12px);
    }
}

@media (min-width: 1024px) {
    .testimonial-slide {
        flex: 0 0 calc(33.3333% - 16px);
        min-width: calc(33.3333% - 16px);
    }
}

.testimonial-card {
    position: relative;
}

.testimonial-card::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 80px;
    font-family: Georgia, serif;
    color: rgba(56, 189, 248, 0.12);
    line-height: 1;
    z-index: 0;
}

/* === MapLibre Map === */
#maplibre-map {
    height: 450px;
    width: 100%;
    border-radius: 1rem;
    z-index: 1;
}

@media (min-width: 768px) {
    #maplibre-map {
        height: 500px;
    }
}

/* MapLibre Popup Styles */
.maplibre-popup .maplibregl-popup-content {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 0.75rem;
    backdrop-filter: blur(8px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    padding: 12px 16px;
    color: #f1f5f9;
    font-family: 'Inter', sans-serif;
}

.maplibre-popup .maplibregl-popup-tip {
    border-top-color: rgba(15, 23, 42, 0.95);
    border-bottom-color: rgba(15, 23, 42, 0.95);
    border-left-color: rgba(15, 23, 42, 0.95);
    border-right-color: rgba(15, 23, 42, 0.95);
}

.maplibre-popup .maplibregl-popup-close-button {
    color: #94a3b8;
    font-size: 20px;
    padding: 0;
    width: 24px;
    height: 24px;
}

.maplibre-popup .maplibregl-popup-close-button:hover {
    background: transparent;
    color: #38bdf8;
}

.popup-title {
    font-weight: 600;
    color: #38bdf8;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.popup-region {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

.popup-stats {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.popup-stat {
    text-align: center;
}

.popup-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #22d3ee;
}

.popup-stat-label {
    font-size: 0.625rem;
    color: #64748b;
    text-transform: uppercase;
}

/* Custom Marker Styles */
.custom-marker {
    display: flex;
    align-items: center;
    justify-content: center;
}

.marker-pin {
    width: 30px;
    height: 30px;
    border-radius: 50% 50% 50% 0;
    background: linear-gradient(135deg, #22d3ee, #6366f1);
    position: relative;
    transform: rotate(-45deg);
    box-shadow: 0 4px 12px rgba(34, 211, 238, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.marker-pin::after {
    content: '';
    width: 14px;
    height: 14px;
    background: #0f172a;
    position: absolute;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.marker-pin.moscow {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.marker-pin.moscow::after {
    width: 16px;
    height: 16px;
}

/* Cluster Marker Styles */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
    background: rgba(34, 211, 238, 0.3);
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
    background: linear-gradient(135deg, #22d3ee, #6366f1);
    color: white;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
}

/* Dark Theme for MapLibre Controls */
.maplibregl-ctrl-group button {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.maplibregl-ctrl-group button:hover {
    background: rgba(30, 41, 59, 0.95);
}

.maplibregl-ctrl-group button .maplibregl-ctrl-icon {
    background-color: #38bdf8;
}

.maplibregl-ctrl-attrib {
    background: rgba(15, 23, 42, 0.8);
    color: #64748b;
    font-size: 10px;
}

.maplibregl-ctrl-attrib a {
    color: #38bdf8;
}

/* Region Legend Styles */
.region-legend {
    transition: all 0.2s ease;
}

.region-legend:hover {
    transform: translateX(4px);
}

.region-legend.active {
    background: rgba(56, 189, 248, 0.1);
    border-left: 2px solid #38bdf8;
    padding-left: calc(0.5rem + 2px);
    margin-left: -2px;
}

/* Polygon Styles */
.maplibregl-canvas-container canvas {
    transition: all 0.3s ease;
}

/* === Hero Stats Mobile === */
@media (max-width: 640px) {
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }
    .hero-stats > div {
        text-align: center;
    }
}

/* === Form States === */
.form-loading {
    opacity: 0.7;
    pointer-events: none;
}

.form-success {
    animation: successPulse 0.5s ease;
}

@keyframes successPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

/* === Toast Notifications === */
.toast {
    position: fixed;
    bottom: 100px;
    right: 24px;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    transform: translateX(120%);
    transition: transform 0.3s ease;
}

.toast.visible {
    transform: translateX(0);
}

.toast.success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.toast.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

