/* styles.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: #000000;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}




/* Кнопка прокрутки наверх */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    background: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    padding: 0;
    overflow: visible;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(198, 164, 126, 0.3);
}

.scroll-to-top:active {
    transform: translateY(-1px);
}

/* SVG прогресс-кольцо */
.progress-ring {
    position: absolute;
    top: 0;
    left: 0;
    transform: rotate(-90deg);
    pointer-events: none;
}

.progress-ring-bg {
    fill: none;
    stroke: rgba(198, 164, 126, 0.1);
    stroke-width: 3;
}

.progress-ring-fill {
    fill: none;
    stroke: rgb(22, 22, 22);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 163.36; /* 2 * PI * 26 */
    stroke-dashoffset: 163.36;
    transition: stroke-dashoffset 0.15s ease-out;
}

/* Иконка стрелки */
.scroll-to-top-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgb(2, 2, 2);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.scroll-to-top:hover .scroll-to-top-icon {
    transform: translate(-50%, -50%) translateY(-2px);
}

/* Анимация при появлении */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.scroll-to-top.visible {
    animation: fadeInUp 0.5s ease-out;
}

/* Пульсация при достижении конца страницы */
@keyframes pulse {
    0% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    }
    50% {
        box-shadow: 0 4px 30px rgba(198, 164, 126, 0.4);
    }
    100% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    }
}

.scroll-to-top.pulse {
    animation: pulse 2s infinite;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 48px;
        height: 48px;
    }

    .progress-ring {
        width: 48px;
        height: 48px;
    }

    .progress-ring-bg,
    .progress-ring-fill {
        cx: 24;
        cy: 24;
        r: 22;
    }

    .progress-ring-fill {
        stroke-dasharray: 138.23; /* 2 * PI * 22 */
        stroke-dashoffset: 138.23;
    }

    .scroll-to-top-icon svg {
        width: 20px;
        height: 20px;
    }
}

/* Эффект ряби при клике */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.scroll-to-top::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(198, 164, 126, 0.3);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    pointer-events: none;
}

.scroll-to-top.clicked::after {
    animation: ripple 0.6s ease-out;
}

/* Tooltip при наведении */
.scroll-to-top::before {
    content: 'Наверх';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.scroll-to-top:hover::before {
    transform: translateX(-50%) translateY(-8px);
    opacity: 1;
}

/* Темная тема (опционально) */
@media (prefers-color-scheme: dark) {
    .scroll-to-top {
        background: #2a2a2a;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }

    .scroll-to-top:hover {
        box-shadow: 0 8px 30px rgba(198, 164, 126, 0.5);
    }
}
