/* =====================================================
   TAROT VELVET - Custom Styles
   ===================================================== */

/* ----- Font Definitions ----- */
h1, h2, h3, h4, h5, h6,
.font-heading {
    font-family: 'Cormorant Garamond', serif;
}

body,
.font-body {
    font-family: 'Inter', sans-serif;
}

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

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

::-webkit-scrollbar-thumb {
    background: #2d1b4e;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3d2a5e;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #2d1b4e #1a0a2e;
}

/* ----- Alpine.js Cloak ----- */
[x-cloak] {
    display: none !important;
}

/* ----- Velvet Background Texture ----- */
.velvet-bg {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(45, 27, 78, 0.6) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(61, 42, 94, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(45, 27, 78, 0.5) 0%, transparent 50%),
        linear-gradient(180deg, #1a0a2e 0%, #0d0518 100%);
}

.velvet-texture {
    position: relative;
}

.velvet-texture::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 1px,
            rgba(255, 255, 255, 0.003) 1px,
            rgba(255, 255, 255, 0.003) 2px
        );
    pointer-events: none;
    z-index: 1;
}

/* ----- Gold Shimmer Text Animation ----- */
.gold-shimmer {
    background: linear-gradient(
        120deg,
        #b8923f 0%,
        #d4a853 20%,
        #e8c97a 40%,
        #f5dea0 50%,
        #e8c97a 60%,
        #d4a853 80%,
        #b8923f 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 4s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% {
        background-position: 0% center;
    }
    50% {
        background-position: 200% center;
    }
}

/* ----- Card Flip Animation ----- */
.card-perspective {
    perspective: 1000px;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.card-flipped .card-inner,
.card-inner.card-flipped {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 0.75rem;
    overflow: hidden;
}

.card-back {
    transform: rotateY(180deg);
}

/* ----- Card Hover Effects ----- */
.card-hover {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 0 20px rgba(212, 168, 83, 0.15),
        0 0 60px rgba(212, 168, 83, 0.08),
        0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Card Glow */
.card-glow {
    position: relative;
}

.card-glow::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 0.875rem;
    background: linear-gradient(
        135deg,
        rgba(212, 168, 83, 0.3),
        rgba(212, 168, 83, 0),
        rgba(212, 168, 83, 0.15),
        rgba(212, 168, 83, 0)
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.card-glow:hover::after {
    opacity: 1;
}

/* ----- Card Reveal Animation ----- */
.card-reveal {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    animation: cardReveal 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes cardReveal {
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.card-reveal:nth-child(1) { animation-delay: 0.1s; }
.card-reveal:nth-child(2) { animation-delay: 0.25s; }
.card-reveal:nth-child(3) { animation-delay: 0.4s; }
.card-reveal:nth-child(4) { animation-delay: 0.55s; }
.card-reveal:nth-child(5) { animation-delay: 0.7s; }

/* ----- Floating Card Animation (Hero) ----- */
.float-card {
    animation: floatCard 6s ease-in-out infinite;
}

.float-card:nth-child(1) {
    animation-delay: 0s;
}

.float-card:nth-child(2) {
    animation-delay: 1s;
}

.float-card:nth-child(3) {
    animation-delay: 2s;
}

@keyframes floatCard {
    0%, 100% {
        transform: translateY(0) rotate(var(--rotation, 0deg));
    }
    50% {
        transform: translateY(-15px) rotate(var(--rotation, 0deg));
    }
}

/* ----- Hero Fanned Cards ----- */
.fanned-cards {
    position: relative;
    width: 280px;
    height: 360px;
}

.fanned-cards .fanned-card {
    position: absolute;
    width: 180px;
    height: 280px;
    border-radius: 12px;
    background: linear-gradient(145deg, #2d1b4e, #1a0a2e);
    border: 1px solid rgba(212, 168, 83, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    top: 50%;
    left: 50%;
}

.fanned-cards .fanned-card:nth-child(1) {
    --rotation: -15deg;
    transform: translate(-50%, -50%) rotate(-15deg);
    z-index: 1;
}

.fanned-cards .fanned-card:nth-child(2) {
    --rotation: 0deg;
    transform: translate(-50%, -55%) rotate(0deg);
    z-index: 2;
}

.fanned-cards .fanned-card:nth-child(3) {
    --rotation: 15deg;
    transform: translate(-50%, -50%) rotate(15deg);
    z-index: 1;
}

.fanned-cards:hover .fanned-card:nth-child(1) {
    transform: translate(-80%, -50%) rotate(-20deg);
}

.fanned-cards:hover .fanned-card:nth-child(2) {
    transform: translate(-50%, -58%) rotate(0deg) scale(1.05);
}

.fanned-cards:hover .fanned-card:nth-child(3) {
    transform: translate(-20%, -50%) rotate(20deg);
}

/* Fanned card back pattern */
.card-back-pattern {
    background:
        repeating-conic-gradient(
            rgba(212, 168, 83, 0.08) 0% 25%,
            transparent 0% 50%
        ) 0 0 / 20px 20px,
        radial-gradient(circle at center, rgba(212, 168, 83, 0.12) 0%, transparent 70%),
        linear-gradient(145deg, #2d1b4e, #1a0a2e);
    border: 1px solid rgba(212, 168, 83, 0.2);
}

.card-back-pattern::before {
    content: '';
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(212, 168, 83, 0.15);
    border-radius: 8px;
}

/* ----- Smooth Page Transitions ----- */
.page-transition {
    animation: pageIn 0.5s ease-out;
}

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

/* ----- Section Fade In on Scroll ----- */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ----- Gold Gradient Border ----- */
.gold-border {
    position: relative;
    border: 1px solid transparent;
    background-clip: padding-box;
}

.gold-border::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(212, 168, 83, 0.5), rgba(212, 168, 83, 0.1), rgba(212, 168, 83, 0.3));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* ----- Glow Button ----- */
.btn-glow {
    position: relative;
    overflow: hidden;
}

.btn-glow::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        rgba(212, 168, 83, 0.3) 60deg,
        transparent 120deg
    );
    animation: glowSpin 4s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-glow:hover::before {
    opacity: 1;
}

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

/* ----- Star / Sparkle Effect ----- */
.sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #d4a853;
    border-radius: 50%;
    animation: sparkle 3s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ----- Horizontal Scroll (Featured Cards) ----- */
.horizontal-scroll {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1rem;
    scrollbar-width: none;
}

.horizontal-scroll::-webkit-scrollbar {
    display: none;
}

.horizontal-scroll > * {
    scroll-snap-align: center;
    flex-shrink: 0;
}

/* ----- Zodiac Grid ----- */
.zodiac-icon {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.zodiac-icon:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 30px rgba(212, 168, 83, 0.15);
}

/* ----- Testimonial Card ----- */
.testimonial-card {
    position: relative;
}

.testimonial-card::before {
    content: '\201C';
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 5rem;
    font-family: 'Cormorant Garamond', serif;
    color: rgba(212, 168, 83, 0.15);
    line-height: 1;
    pointer-events: none;
}

/* ----- Pulse Ring (CTA) ----- */
.pulse-ring {
    position: relative;
}

.pulse-ring::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    border: 2px solid rgba(212, 168, 83, 0.4);
    animation: pulseRing 2s ease-out infinite;
}

@keyframes pulseRing {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.15);
        opacity: 0;
    }
}

/* ----- Responsive Adjustments ----- */
@media (max-width: 768px) {
    .fanned-cards {
        width: 220px;
        height: 300px;
    }

    .fanned-cards .fanned-card {
        width: 140px;
        height: 220px;
    }

    .gold-shimmer {
        background-size: 300% auto;
    }
}

@media (max-width: 480px) {
    .fanned-cards {
        width: 180px;
        height: 260px;
    }

    .fanned-cards .fanned-card {
        width: 110px;
        height: 180px;
    }
}

/* ----- Selection Color ----- */
::selection {
    background: rgba(212, 168, 83, 0.3);
    color: #ffffff;
}

::-moz-selection {
    background: rgba(212, 168, 83, 0.3);
    color: #ffffff;
}
