/* CRM Sale - Дополнительные стили */

/* ========== ДЕКОРАТИВНЫЕ ФИГУРЫ (ЛЕГКИЕ!) ========== */
body::before,
body::after {
    content: '';
    position: fixed;
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
}

body::before {
    top: 10%;
    left: -5%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(135, 133, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: slowFloat 25s ease-in-out infinite;
}

body::after {
    bottom: 15%;
    right: -8%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(2, 204, 203, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    animation: slowFloat 30s ease-in-out infinite reverse;
}

@keyframes slowFloat {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(15px, -15px); }
}

/* Все элементы контента выше декора */
.site-header,
.main-content,
.site-footer {
    position: relative;
    z-index: 1;
}

/* ========== SCROLL PROGRESS BAR ========== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, #02CCCB 0%, #8785FF 100%);
    z-index: 9999;
    transition: width 0.1s ease;
    box-shadow: 0 0 10px rgba(2, 204, 203, 0.5);
}

/* ========== КНОПКА ВВЕРХ ========== */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #02CCCB 0%, #8785FF 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 4px 15px rgba(2, 204, 203, 0.4);
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0% {
        box-shadow: 0 0 0 0 rgba(2, 204, 203, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(2, 204, 203, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(2, 204, 203, 0);
    }
}

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

.scroll-to-top:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 25px rgba(2, 204, 203, 0.6);
    animation: none;
}

.scroll-to-top::after {
    content: '↑';
    font-size: 24px;
    color: #FFFFFF;
    font-weight: bold;
}

/* Анимация появления элементов */
.fade-in {
    animation: fadeInUp 0.6s ease-out forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Липкий header */
.site-header.scrolled {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    background-color: rgba(26, 27, 46, 0.95);
}

.site-header.header-hidden {
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

/* Кнопка копирования кода */
.copy-code-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 12px;
    background-color: rgba(2, 204, 203, 0.2);
    border: 1px solid #02CCCB;
    color: #02CCCB;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.copy-code-btn:hover {
    background-color: #02CCCB;
    color: #161729;
}

/* Ошибки в формах */
input.error,
textarea.error {
    border-color: #ff4444 !important;
    background-color: rgba(255, 68, 68, 0.1);
}

/* Улучшение читабельности */
::selection {
    background-color: #02CCCB;
    color: #161729;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #1A1B2E;
}

::-webkit-scrollbar-thumb {
    background: #8785FF;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #02CCCB;
}

/* Прелоадер (опционально) */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #161729;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.preloader.hidden {
    opacity: 0;
    pointer-events: none;
}

.preloader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(2, 204, 203, 0.3);
    border-top-color: #02CCCB;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Утилиты */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}
