/* ============================================
   УНИКАЛЬНЫЕ КОМПОНЕНТЫ CSKT 2026
   Префикс: cskt- (гарантия отсутствия конфликтов)
   ============================================ */

/* --------------------------------------------
   1. ПРЕЛОАДЕР С ПУЛЬСИРУЮЩИМИ ТОЧКАМИ
   Цвета: #07337a (синий) и #ff6b35 (оранжевый)
-------------------------------------------- */
#cskt-preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent !important;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

#cskt-preloader.cskt-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    display: none !important;
}


.cskt-loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

.cskt-spinner-dots {
    width: 56px;
    height: 56px;
    color: #ff6b35;
}

.cskt-spinner-dots .cskt-dot {
    animation: cskt-dot-pulse 0.6s ease-in-out infinite alternate;
}

@keyframes cskt-dot-pulse {
    0% {
        r: 1;
        opacity: 0.3;
    }
    100% {
        r: 2.5;
        opacity: 1;
    }
}

.cskt-spinner-rotate {
    animation: cskt-spin-slow 8s linear infinite;
    transform-origin: center;
}

@keyframes cskt-spin-slow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.cskt-loader-brand {
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-family: 'Open Sans', sans-serif;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: cskt-text-pulse 2s ease-in-out infinite;
}

.cskt-loader-brand span {
    color: #ff6b35;
    font-weight: 600;
}

@keyframes cskt-text-pulse {
    0%, 100% {
        opacity: 0.4;
    }
    50% {
        opacity: 0.9;
    }
}

@media (prefers-color-scheme: light) {
    #cskt-preloader {
        background: linear-gradient(145deg, #f0f4f8 0%, #e8edf5 50%, #f0f4f8 100%);
    }
    .cskt-loader-brand {
        color: rgba(0, 0, 0, 0.25);
    }
    .cskt-loader-brand span {
        color: #ff6b35;
    }
}

@media (max-width: 480px) {
    .cskt-spinner-dots {
        width: 40px;
        height: 40px;
    }
    .cskt-loader-brand {
        font-size: 9px;
        letter-spacing: 1.5px;
    }
}

/* --------------------------------------------
   2. КОМПАКТНЫЙ ЛОГОТИП ДЛЯ ВЕРХНЕЙ ПЛАНКИ
-------------------------------------------- */
.cskt-brand-compact {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.08);
    padding: 5px 14px;
    border-radius: 50px;
    transition: all 0.2s ease;
    position: relative;
    cursor: pointer;
}

.cskt-brand-compact:hover {
    background: rgba(255, 255, 255, 0.12);
}

.cskt-logo-compact img {
    width: 38px;
    height: auto;
    transition: transform 0.2s;
}

.cskt-logo-compact:hover img {
    transform: scale(1.02);
}

.cskt-brand-text-compact {
    line-height: 1.2;
}

.cskt-slogan-top-compact {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.3px;
}

.cskt-slogan-bottom-compact {
    font-size: 11px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cskt-brand-compact .cskt-contacts-tooltip {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 280px;
    max-width: 320px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 10000;
    pointer-events: none;
}

.cskt-brand-compact:hover .cskt-contacts-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.cskt-brand-compact .cskt-contacts-tooltip::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid white;
    z-index: 10001;
}

.cskt-contacts-tooltip h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 700;
    color: #07337a;
    border-bottom: 2px solid #ff6b35;
    padding-bottom: 4px;
}

.cskt-contacts-tooltip .cskt-tooltip-contact {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    font-size: 13px;
    color: #333;
    border-bottom: 1px solid #eee;
}

.cskt-contacts-tooltip .cskt-tooltip-contact:last-child {
    border-bottom: none;
}

.cskt-contacts-tooltip .cskt-tooltip-contact i {
    width: 20px;
    font-size: 16px;
    color: #ff6b35;
    flex-shrink: 0;
    margin-top: 2px;
}

.cskt-contacts-tooltip .cskt-tooltip-contact span {
    flex: 1;
    word-break: break-word;
}

.cskt-address-multiline {
    display: block;
    line-height: 1.4;
}

/* --------------------------------------------
   3. ВЕРХНЯЯ ПЛАНКА (ТОП-БАР)
-------------------------------------------- */
.cskt-top-bar {
    background: linear-gradient(135deg, #0a2540 0%, #0f2d4a 100%);
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.cskt-top-bar-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 50px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.cskt-auth-modern {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.1);
    padding: 6px 16px;
    border-radius: 40px;
    font-size: 13px;
    color: white;
}

.cskt-auth-modern i {
    font-size: 18px;
    color: #ff6b35;
}

.cskt-auth-exit {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    margin-left: 8px;
    transition: color 0.2s;
}

.cskt-auth-exit:hover {
    color: #ff6b35;
}

.cskt-auth-guest {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    padding: 6px 16px;
    border-radius: 40px;
    font-size: 13px;
    color: white;
}

.cskt-places-modern {
    background: rgba(255,107,53,0.15);
    border-radius: 60px;
    transition: all 0.3s ease;
}

.cskt-places-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 20px;
    text-decoration: none;
    color: white;
}

.cskt-places-link i {
    font-size: 20px;
    color: #ff6b35;
}

.cskt-places-info {
    display: flex;
    flex-direction: column;
}

.cskt-places-label {
    font-size: 11px;
    opacity: 0.8;
}

.cskt-places-date {
    font-size: 12px;
    font-weight: 600;
}

.cskt-places-numbers {
    display: flex;
    gap: 12px;
}

.cskt-places-city, .cskt-places-village {
    background: rgba(255,255,255,0.15);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
}

.cskt-places-city {
    color: #ff6b35;
}

.cskt-admin-modern {
    background: rgba(255,255,255,0.1);
    border-radius: 40px;
    padding: 4px 12px;
}

.cskt-admin-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cskt-admin-form input {
    width: 60px;
    padding: 8px;
    text-align: center;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    background: white;
}

.cskt-admin-form button {
    background: #ff6b35;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: transform 0.2s;
}

.cskt-admin-form button:hover {
    transform: scale(1.05);
}

.cskt-admin-data-exists {
    padding: 6px 12px;
    font-size: 12px;
    color: #4caf50;
}

.cskt-social-modern {
    display: flex;
    gap: 12px;
}

.cskt-social-modern a {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: all 0.3s;
}

.cskt-social-modern a:hover {
    background: #ff6b35;
    transform: translateY(-2px);
}

.cskt-search-modern form {
    display: flex;
    background: rgba(255,255,255,0.15);
    border-radius: 40px;
    overflow: hidden;
}

.cskt-search-modern input {
    background: transparent;
    border: none;
    padding: 8px 16px;
    color: white;
    font-size: 13px;
    width: 160px;
}

.cskt-search-modern input::placeholder {
    color: rgba(255,255,255,0.6);
}

.cskt-search-modern input:focus {
    outline: none;
}

.cskt-search-modern button {
    background: #ff6b35;
    border: none;
    padding: 0 16px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.cskt-search-modern button:hover {
    background: #e55a2b;
}

.cskt-vision-modern {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #ff6b35, #ff8c42);
    padding: 8px 16px;
    border-radius: 40px;
    text-decoration: none;
    color: white;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(255,107,53,0.3);
    white-space: nowrap;
}

.cskt-vision-modern i {
    font-size: 16px;
}

.cskt-vision-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255,107,53,0.4);
}

/* --------------------------------------------
   4. НАВИГАЦИЯ И ВЫПАДАЮЩИЕ МЕНЮ
-------------------------------------------- */
.cskt-navbar {
    background: #07337a;
    padding: 0;
    position: relative;
    z-index: 999;
}

.cskt-nav-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 50px;
    display: flex;
    align-items: center;
}

.cskt-nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: transparent;
    border: none;
    padding: 10px;
    cursor: pointer;
}

.cskt-nav-toggle span {
    display: block;
    width: 28px;
    height: 3px;
    background: white;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.cskt-nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.cskt-nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.cskt-nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.cskt-nav-menu {
    flex: 1;
}

.cskt-nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
}

.cskt-nav-item {
    position: relative;
}

.cskt-nav-link {
    display: block;
    padding: 14px 20px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.cskt-nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ff6b35;
}

/* ---- Dropdown Menu ---- */
.cskt-dropdown {
    position: relative;
}

.cskt-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    z-index: 1000;
    pointer-events: none;
    list-style: none;
    margin: 0;
}

.cskt-dropdown-menu li {
    position: relative;
}

.cskt-dropdown-menu li a {
    display: block;
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.cskt-dropdown-menu li a:hover {
    background: #f5f5f5;
    color: #07337a;
}

/* Показываем меню при наведении на десктопе */
@media (min-width: 992px) {
    .cskt-dropdown:hover > .cskt-dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }
    
    .cskt-dropdown-menu li:hover > .cskt-dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }
}

/* ---- Mega Menu ---- */
.cskt-dropdown-mega {
    min-width: 680px;
    padding: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
}

@media (min-width: 992px) {
    .cskt-dropdown:hover > .cskt-dropdown-mega {
        transform: translateX(-50%) translateY(0);
    }
}

.cskt-mega-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.cskt-mega-col h4 {
    font-size: 13px;
    font-weight: 700;
    color: #07337a;
    margin: 0 0 10px 0;
    padding-bottom: 6px;
    border-bottom: 2px solid #ff6b35;
}

.cskt-mega-col a {
    display: block;
    padding: 6px 0;
    color: #555;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
}

.cskt-mega-col a:hover {
    color: #ff6b35;
    padding-left: 6px;
}

/* ---- Мобильная версия ---- */
@media (max-width: 991px) {
    .cskt-nav-toggle {
        display: flex;
        margin-right: 16px;
    }
    
    .cskt-nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #07337a;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease;
        visibility: hidden;
    }
    
    .cskt-nav-menu.active {
        max-height: 80vh;
        visibility: visible;
        overflow-y: auto;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }
    
    .cskt-nav-list {
        flex-direction: column;
        padding: 8px 0;
    }
    
    .cskt-nav-link {
        padding: 12px 20px;
        white-space: normal;
    }
    
    body.cskt-no-scroll {
        overflow: hidden;
    }
    
    .cskt-dropdown-menu {
        position: static;
        box-shadow: none;
        border-radius: 0;
        background: rgba(255, 255, 255, 0.05);
        padding: 0;
        opacity: 0;
        visibility: hidden;
        transform: none;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, opacity 0.3s ease;
        pointer-events: none;
        width: 100%;
    }
    
    .cskt-dropdown.open > .cskt-dropdown-menu {
        opacity: 1;
        visibility: visible;
        max-height: 800px;
        pointer-events: auto;
        padding: 8px 0;
    }
    
    .cskt-dropdown-menu li a {
        color: rgba(255, 255, 255, 0.9);
        padding: 10px 20px 10px 40px;
        font-size: 14px;
        white-space: normal;
    }
    
    .cskt-dropdown-menu li a:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #ff6b35;
    }
    
    .cskt-dropdown-mega {
        min-width: auto;
        padding: 0;
    }
    
    .cskt-mega-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 0 20px;
    }
    
    .cskt-mega-col h4 {
        color: rgba(255, 255, 255, 0.7);
        font-size: 12px;
        border-bottom-color: #ff6b35;
        margin-top: 10px;
    }
    
    .cskt-mega-col a {
        color: rgba(255, 255, 255, 0.8);
        font-size: 13px;
        padding: 6px 0 6px 20px;
    }
    
    .cskt-mega-col a:hover {
        color: #ff6b35;
    }
    
    .cskt-dropdown-toggle .fa-chevron-down {
        transition: transform 0.3s ease;
        font-size: 12px;
        margin-left: 6px;
    }
    
    .cskt-dropdown.open > .cskt-dropdown-toggle .fa-chevron-down {
        transform: rotate(180deg);
    }
}

/* --------------------------------------------
   5. МОДАЛЬНОЕ ОКНО С МЕСТАМИ
-------------------------------------------- */
.cskt-modal-places {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);
    z-index: 10001;
    display: none;
}

.cskt-modal-places:target {
    display: block;
}

.cskt-modal-container {
    background: white;
    border-radius: 24px;
    width: 90%;
    max-width: 800px;
    margin: 5% auto;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.cskt-modal-header {
    background: linear-gradient(135deg, #07337a, #0a4aad);
    color: white;
    padding: 24px;
    position: relative;
}

.cskt-modal-header h3 {
    margin: 0 0 8px 0;
    font-size: 22px;
}

.cskt-modal-header p {
    margin: 0;
    opacity: 0.9;
}

.cskt-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 24px;
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.cskt-modal-close:hover {
    opacity: 1;
}

.cskt-modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.cskt-places-year {
    margin-bottom: 20px;
}

.cskt-year-title {
    font-size: 20px;
    font-weight: 700;
    color: #07337a;
    border-left: 4px solid #ff6b35;
    padding-left: 12px;
    margin-bottom: 12px;
}

.cskt-places-month {
    margin-bottom: 12px;
}

.cskt-month-title {
    font-size: 16px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
}

.cskt-places-day {
    display: flex;
    justify-content: space-between;
    padding: 8px 0 8px 20px;
    border-bottom: 1px solid #eee;
}

/* --------------------------------------------
   6. ТЁМНАЯ ТЕМА
-------------------------------------------- */
@media (prefers-color-scheme: dark) {
    .cskt-modal-container {
        background: #1e1e2e;
        color: #eee;
    }
    
    .cskt-modal-body {
        background: #1e1e2e;
    }
    
    .cskt-year-title {
        color: #ff6b35;
    }
    
    .cskt-month-title {
        color: #aaa;
    }
    
    .cskt-places-day {
        border-bottom-color: #333;
    }
    
    .cskt-brand-compact .cskt-contacts-tooltip {
        background: #2a2a2a;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    }
    
    .cskt-brand-compact .cskt-contacts-tooltip::before {
        border-bottom-color: #2a2a2a;
    }
    
    .cskt-contacts-tooltip h4 {
        color: #ff6b35;
    }
    
    .cskt-contacts-tooltip .cskt-tooltip-contact {
        color: #ddd;
        border-bottom-color: #444;
    }
    
    .cskt-dropdown-menu {
        background: #2a2a2a;
    }
    
    .cskt-dropdown-menu li a {
        color: #ddd;
    }
    
    .cskt-dropdown-menu li a:hover {
        background: #3a3a3a;
        color: #ff6b35;
    }
    
    .cskt-mega-col h4 {
        color: #ff6b35;
    }
    
    .cskt-mega-col a {
        color: #bbb;
    }
    
    .cskt-mega-col a:hover {
        color: #ff6b35;
    }
}

/* --------------------------------------------
   7. МОБИЛЬНАЯ АДАПТАЦИЯ
-------------------------------------------- */
@media (max-width: 992px) and (min-width: 769px) {
    .cskt-top-bar-container {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
        padding: 0 20px;
    }
    
    .cskt-places-link {
        justify-content: center;
    }
    
    .cskt-places-numbers {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .cskt-top-bar {
        padding: 10px 0;
    }
    
    .cskt-top-bar-container {
        display: flex;
        flex-direction: column;
        padding: 0 16px;
        gap: 12px;
    }
    
    .cskt-brand-compact {
        order: 1;
        align-self: center;
        justify-content: center;
        padding: 4px 12px;
        gap: 6px;
        background: rgba(255, 255, 255, 0.06);
    }
    
    .cskt-logo-compact img {
        width: 28px;
    }
    
    .cskt-brand-text-compact {
        text-align: center;
    }
    
    .cskt-slogan-top-compact {
        font-size: 6px;
        letter-spacing: 0.2px;
    }
    
    .cskt-slogan-bottom-compact {
        font-size: 8px;
        letter-spacing: 0.3px;
    }
    
    .cskt-places-modern {
        order: 2;
    }
    
    .cskt-places-link {
        padding: 8px 12px;
        gap: 10px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .cskt-places-info {
        flex-direction: row;
        gap: 6px;
        align-items: baseline;
    }
    
    .cskt-places-label {
        font-size: 9px;
    }
    
    .cskt-places-date {
        font-size: 10px;
    }
    
    .cskt-places-numbers {
        gap: 8px;
    }
    
    .cskt-places-city, .cskt-places-village {
        padding: 3px 8px;
        font-size: 11px;
    }
    
    .cskt-social-modern {
        order: 3;
        justify-content: center;
    }
    
    .cskt-search-modern {
        order: 4;
        width: 100%;
    }
    
    .cskt-search-modern form {
        width: 100%;
    }
    
    .cskt-search-modern input {
        flex: 1;
        width: auto;
    }
    
    .cskt-vision-modern {
        order: 5;
        justify-content: center;
        width: 100%;
    }
    
    .cskt-top-left {
        order: 6;
        width: 100%;
    }
    
    .cskt-auth-modern, .cskt-auth-guest {
        width: 100%;
        justify-content: center;
    }
    
    .cskt-admin-modern {
        order: 7;
        width: 100%;
    }
    
    .cskt-admin-form {
        justify-content: center;
    }
    
    .cskt-nav-container {
        padding: 0 16px;
    }
}

@media (max-width: 480px) {
    .cskt-brand-compact {
        padding: 3px 8px;
        gap: 4px;
    }
    
    .cskt-logo-compact img {
        width: 24px;
    }
    
    .cskt-slogan-top-compact {
        font-size: 5px;
    }
    
    .cskt-slogan-bottom-compact {
        font-size: 7px;
    }
    
    .cskt-places-link {
        flex-direction: column;
        align-items: center;
        gap: 6px;
    }
    
    .cskt-places-info {
        flex-direction: row;
    }
    
    .cskt-modal-header h3 {
        font-size: 16px;
    }
    
    .cskt-modal-header p {
        font-size: 12px;
    }
}

@media (min-width: 401px) and (max-width: 480px) {
    .cskt-brand-text-compact {
        display: block;
    }
    
    .cskt-slogan-top-compact {
        font-size: 5px;
    }
    
    .cskt-slogan-bottom-compact {
        font-size: 7px;
    }
}