/* Ubit.fi Custom Styles */

/* Modern Custom Buttons with Gradients */
.cta-button {
    @apply bg-gradient-to-r from-ubitCyan to-cyan-400 hover:from-cyan-400 hover:to-ubitCyan text-ubitPurple px-8 py-4 rounded-xl font-bold shadow-lg hover:shadow-2xl transition-all duration-300 transform hover:scale-105;
}

.secondary-cta-button {
    @apply bg-transparent border-2 border-white hover:bg-white text-white hover:text-ubitPurple px-8 py-4 rounded-xl font-bold transition-all duration-300 transform hover:scale-105 shadow-md;
}

.primary-button {
    @apply bg-gradient-to-r from-ubitPurple to-ubitPurpleDark hover:from-ubitPurpleDark hover:to-ubitPurple text-white px-8 py-4 rounded-xl font-bold shadow-lg hover:shadow-2xl transition-all duration-300 transform hover:scale-105;
}

/* Footer links */
.footer-link {
    @apply hover:text-ubitCyan transition-colors duration-200;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #58d1ca #1a004d;
}

/* Webkit scrollbar (Chrome, Edge, Safari) */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1a004d;
}

::-webkit-scrollbar-thumb {
    background: #58d1ca;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6eddd6;
}

/* Barlow 400 is thinner than most sans-serifs – default to medium */
body {
    font-weight: 500;
}

/* Scroll reveal animations */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children inside a revealed grid/flex */
.reveal-children > * {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-children.revealed > * {
    opacity: 1;
    transform: translateY(0);
}

.reveal-children.revealed > *:nth-child(1) { transition-delay: 0.04s; }
.reveal-children.revealed > *:nth-child(2) { transition-delay: 0.08s; }
.reveal-children.revealed > *:nth-child(3) { transition-delay: 0.12s; }
.reveal-children.revealed > *:nth-child(4) { transition-delay: 0.16s; }
.reveal-children.revealed > *:nth-child(5) { transition-delay: 0.2s; }
.reveal-children.revealed > *:nth-child(6) { transition-delay: 0.24s; }

/* Image lightbox */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: background 0.35s ease, backdrop-filter 0.35s ease;
}

.lightbox-overlay.active {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    pointer-events: auto;
    cursor: zoom-out;
}

.lightbox-img {
    max-width: 92vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox-overlay.active .lightbox-img {
    opacity: 1;
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.2s ease;
}

.lightbox-overlay.active .lightbox-close {
    opacity: 1;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Lightbox-enabled image hover hint */
[data-lightbox] {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

[data-lightbox]:hover {
    transform: scale(1.015);
}

/* Floating hero cubes */
.hero-cube {
    position: absolute;
    border-radius: 4px;
    pointer-events: none;
    will-change: transform;
}

@keyframes heroCubeFloat {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: var(--cube-opacity);
    }
    25% {
        transform:
            translate(calc(var(--drift-x) * 0.6), calc(var(--drift-y) * -0.4))
            rotate(calc(var(--spin) * 0.25))
            scale(var(--scale-mid));
    }
    50% {
        transform:
            translate(var(--drift-x), var(--drift-y))
            rotate(calc(var(--spin) * 0.5))
            scale(1);
        opacity: calc(var(--cube-opacity) * 1.2);
    }
    75% {
        transform:
            translate(calc(var(--drift-x) * 0.3), calc(var(--drift-y) * 0.7))
            rotate(calc(var(--spin) * 0.75))
            scale(var(--scale-mid));
    }
    100% {
        transform: translate(0, 0) rotate(var(--spin)) scale(1);
        opacity: var(--cube-opacity);
    }
}

/* Cookie consent banner */
#cookie-consent-banner {
    position: fixed;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%) translateY(calc(100% + 2rem));
    z-index: 9998;
    background: linear-gradient(135deg, #220066 0%, #1a004d 100%);
    color: #fff;
    padding: 1.5rem 2rem;
    border-radius: 1rem;
    border: 1px solid rgba(88, 209, 202, 0.2);
    box-shadow: 0 20px 60px rgba(34, 0, 102, 0.4), 0 0 40px rgba(88, 209, 202, 0.08);
    backdrop-filter: blur(12px);
    width: calc(100% - 2.5rem);
    max-width: 720px;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.4s ease;
    opacity: 0;
}

#cookie-consent-banner.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.cookie-consent-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.cookie-consent-icon {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(88, 209, 202, 0.15);
    border-radius: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.cookie-consent-text {
    flex: 1;
}

.cookie-consent-text p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    opacity: 0.9;
}

.cookie-consent-text a {
    color: #58d1ca;
    text-decoration: none;
    font-weight: 600;
}

.cookie-consent-text a:hover {
    text-decoration: underline;
}

.cookie-details {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.3s ease, margin 0.3s ease;
    margin-top: 0;
}

.cookie-details.open {
    max-height: 300px;
    opacity: 1;
    margin-top: 0.75rem;
}

.cookie-details p {
    margin: 0 0 0.4rem;
    font-size: 0.8rem;
    opacity: 0.85;
}

.cookie-details p strong {
    color: #58d1ca;
}

.cookie-details ul {
    margin: 0 0 0.5rem;
    padding-left: 0;
    list-style: none;
}

.cookie-details ul li {
    font-size: 0.78rem;
    opacity: 0.75;
    padding: 0.15rem 0;
    position: relative;
    padding-left: 0.85rem;
}

.cookie-details ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5em;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #58d1ca;
}

.cookie-consent-buttons {
    display: flex;
    gap: 0.625rem;
    flex-shrink: 0;
}

.cookie-consent-buttons button {
    padding: 0.6rem 1.5rem;
    border-radius: 0.625rem;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    border: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cookie-consent-buttons button:hover {
    transform: scale(1.05);
}

#cookie-accept {
    background: linear-gradient(135deg, #58d1ca 0%, #6eddd6 100%);
    color: #220066;
    box-shadow: 0 4px 16px rgba(88, 209, 202, 0.3);
}

#cookie-accept:hover {
    box-shadow: 0 6px 24px rgba(88, 209, 202, 0.45);
}

#cookie-decline {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

#cookie-decline:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

/* When details are open, stack layout vertically */
#cookie-consent-banner:has(.cookie-details.open) .cookie-consent-content {
    flex-direction: column;
    align-items: stretch;
}

#cookie-consent-banner:has(.cookie-details.open) .cookie-consent-icon {
    display: none;
}

#cookie-consent-banner:has(.cookie-details.open) .cookie-consent-buttons {
    align-self: flex-end;
}

@media (max-width: 640px) {
    #cookie-consent-banner {
        bottom: 0.75rem;
        padding: 1.25rem;
    }
    .cookie-consent-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    .cookie-consent-icon {
        margin: 0 auto;
    }
    .cookie-consent-buttons {
        width: 100%;
    }
    .cookie-consent-buttons button {
        flex: 1;
    }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .reveal,
    .reveal-children > * {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .lightbox-img,
    .lightbox-overlay {
        transition: none;
    }
    .hero-cube {
        display: none;
    }
}
