/* Preloader Styles */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #111111;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: all 1s ease;
}

.preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.preloader-content {
    text-align: center;
    position: relative;
}

/* Animated Heart Spinner */
.heart-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
}

.heart-spinner .heart {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    transform: translate(-50%, -50%) rotate(-45deg);
    animation: heartBeat 1.5s ease-in-out infinite;
}

.heart-spinner .heart::before,
.heart-spinner .heart::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 32px;
    background: linear-gradient(45deg, #C99B4B, #C99B4B);
    border-radius: 20px 20px 0 0;
    transform-origin: 0 100%;
}

.heart-spinner .heart::before {
    left: 20px;
    transform: rotate(-45deg);
}

.heart-spinner .heart::after {
    left: 0;
    transform: rotate(45deg);
}

/* Glowing Ring */
.glow-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    border: 2px solid transparent;
    border-top: 2px solid #C99B4B;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: spin 2s linear infinite;
    box-shadow:
        0 0 20px rgba(201, 155, 75, 0.3),
        inset 0 0 20px rgba(201, 155, 75, 0.1);
}

.glow-ring::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid transparent;
    border-bottom: 2px solid #C99B4B;
    border-radius: 50%;
    animation: spin 1.5s linear infinite reverse;
}

/* Preloader Text */
.preloader-text {
    color: #FDFDFD;
    font-family: 'Red Hat Display', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #FDFDFD, #C99B4B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textGlow 2s ease-in-out infinite alternate;
}

.preloader-subtitle {
    color: rgba(253, 253, 253, 0.7);
    font-family: 'Red Hat Display', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    animation: fadeInOut 3s ease-in-out infinite;
}

/* Floating Particles */
.preloader-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #C99B4B;
    border-radius: 50%;
    opacity: 0.3;
    animation: float 4s ease-in-out infinite;
}

.particle:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
}

.particle:nth-child(2) {
    left: 20%;
    animation-delay: 0.5s;
}

.particle:nth-child(3) {
    left: 30%;
    animation-delay: 1s;
}

.particle:nth-child(4) {
    left: 40%;
    animation-delay: 1.5s;
}

.particle:nth-child(5) {
    left: 50%;
    animation-delay: 2s;
}

.particle:nth-child(6) {
    left: 60%;
    animation-delay: 2.5s;
}

.particle:nth-child(7) {
    left: 70%;
    animation-delay: 3s;
}

.particle:nth-child(8) {
    left: 80%;
    animation-delay: 3.5s;
}

.particle:nth-child(9) {
    left: 90%;
    animation-delay: 4s;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(45deg, #C99B4B, #C99B4B);
    border: none;
    border-radius: 50%;
    color: #111111;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 8px 25px rgba(201, 155, 75, 0.3),
        0 0 0 0 rgba(201, 155, 75, 0.4);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.back-to-top:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow:
        0 15px 35px rgba(201, 155, 75, 0.4),
        0 0 30px rgba(201, 155, 75, 0.6),
        0 0 0 10px rgba(201, 155, 75, 0.1);
    background: linear-gradient(45deg, #C99B4B, #F5D76E);
}

.back-to-top:active {
    transform: translateY(-2px) scale(1.05);
}

/* Glow Effect on Hover */
.back-to-top::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, #C99B4B, #C99B4B, #C99B4B);
    border-radius: 50%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: rotate 3s linear infinite;
}

.back-to-top:hover::before {
    opacity: 1;
}

/* Progress Ring */
.back-to-top::after {
    content: '';
    position: absolute;
    inset: -4px;
    border: 2px solid transparent;
    border-top: 2px solid rgba(201, 155, 75, 0.6);
    border-radius: 50%;
    opacity: 0;
    transition: all 0.3s ease;
    animation: spin 2s linear infinite;
}

.back-to-top:hover::after {
    opacity: 1;
}

/* Button Icon */
.back-to-top i {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.back-to-top:hover i {
    transform: translateY(-2px);
}

/* Pulse Animation for Attention */
.back-to-top.pulse {
    animation: buttonPulse 2s ease-in-out infinite;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        font-size: 20px;
    }

    .preloader-text {
        font-size: 1.25rem;
    }

    .preloader-subtitle {
        font-size: 0.9rem;
    }

    .heart-spinner {
        width: 60px;
        height: 60px;
    }

    .heart-spinner .heart {
        width: 30px;
        height: 30px;
    }

    .heart-spinner .heart::before,
    .heart-spinner .heart::after {
        width: 15px;
        height: 24px;
    }

    .glow-ring {
        width: 80px;
        height: 80px;
    }
}

/* Animations */
@keyframes heartBeat {

    0%,
    100% {
        transform: translate(-50%, -50%) rotate(-45deg) scale(1);
        filter: drop-shadow(0 0 10px rgba(201, 155, 75, 0.3));
    }

    50% {
        transform: translate(-50%, -50%) rotate(-45deg) scale(1.2);
        filter: drop-shadow(0 0 20px rgba(201, 155, 75, 0.6));
    }
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes textGlow {
    0% {
        text-shadow: 0 0 10px rgba(201, 155, 75, 0.3);
    }

    100% {
        text-shadow: 0 0 20px rgba(201, 155, 75, 0.6);
    }
}

@keyframes fadeInOut {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.3;
    }

    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.8;
    }
}

@keyframes buttonPulse {

    0%,
    100% {
        box-shadow:
            0 8px 25px rgba(201, 155, 75, 0.3),
            0 0 0 0 rgba(201, 155, 75, 0.4);
    }

    50% {
        box-shadow:
            0 8px 25px rgba(201, 155, 75, 0.3),
            0 0 0 15px rgba(201, 155, 75, 0.1);
    }
}

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* Additional Glow Effects */
.back-to-top.glow {
    box-shadow:
        0 0 20px rgba(201, 155, 75, 0.5),
        0 0 40px rgba(201, 155, 75, 0.3),
        0 0 60px rgba(201, 155, 75, 0.1);
}

/* Loading Progress Bar */
.loading-progress {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 4px;
    background: rgba(201, 155, 75, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.loading-progress::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, #C99B4B, transparent);
    animation: loadingProgress 2s ease-in-out infinite;
}

@keyframes loadingProgress {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}