/*
 * SunMystic Platform-Specific Stylesheet
 * Tarot-specific components extracted from views
 * Uses CSS variables from web.css
 */

/* ============================================
   Spread Cards (Home Page)
   ============================================ */
.spread-card {
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all 0.25s;
    background: var(--card);
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}
.spread-card:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 30px rgba(212, 32, 32, 0.1);
    transform: translateY(-4px);
    color: inherit;
}
.spread-card .sc-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* ============================================
   Suit Pills (Card Encyclopedia)
   ============================================ */
.suit-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--card);
    text-decoration: none;
    color: var(--foreground);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.suit-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--muted);
}

/* ============================================
   Trust Strip
   ============================================ */
.trust-strip {
    background: var(--muted);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

/* ============================================
   CTA Gradient Box
   ============================================ */
.cta-gradient {
    background: linear-gradient(135deg, #3b0d0d 0%, #b91c1c 100%);
    border-radius: 1.5rem;
    position: relative;
    overflow: hidden;
}
.cta-gradient::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.1);
    top: -100px;
    right: -80px;
}

/* ============================================
   Dark Card Header (for result cards)
   ============================================ */
.tarot-dark-card {
    background: linear-gradient(135deg, #450a0a, #7f1d1d);
    color: #fff;
}

/* ============================================
   Section Labels (public pages)
   ============================================ */
.tarot-section-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--primary);
    font-weight: 600;
}

/* ============================================
   Section Heading (public pages)
   ============================================ */
.tarot-section-heading {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--foreground);
    letter-spacing: -0.02em;
}

/* ============================================
   Info Box (contact, about)
   ============================================ */
.tarot-info-box {
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1rem;
}

/* ============================================
   FAQ Details
   ============================================ */
.tarot-faq details {
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
}
.tarot-faq summary {
    cursor: pointer;
    font-weight: 600;
}

/* ============================================
   Dashboard Card
   ============================================ */
.tarot-dash-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.25s;
    height: 100%;
}
.tarot-dash-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}
.tarot-dash-card .dash-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    display: block;
}

/* ============================================
   Keyword Badges
   ============================================ */
.kw-badge-upright {
    background: #f0fdf4;
    color: #065f46;
}
.kw-badge-reversed {
    background: #fef2f2;
    color: #991b1b;
}

/* ============================================
   Premium Card Background
   ============================================ */
.tarot-premium-bg {
    background: linear-gradient(135deg, #450a0a, #7f1d1d);
    color: #fff;
}

/* ============================================
   Advice Card
   ============================================ */
.tarot-advice-card {
    background: linear-gradient(135deg, #7f1d1d, #991b1b);
    color: #fff;
    border-radius: 0.75rem;
    padding: 1.5rem;
}

/* ============================================
   Warm Background Section
   ============================================ */
.tarot-warm-bg {
    background: var(--muted);
}

/* ============================================
   Card Encyclopedia Item
   ============================================ */
.tarot-card-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.75rem;
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
    transition: all 0.2s;
    text-align: center;
}
.tarot-card-item:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(212, 32, 32, 0.1);
    transform: translateY(-3px);
    color: inherit;
}

/* ============================================
   Pricing Card
   ============================================ */
.tarot-price-card {
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    background: var(--card);
    height: 100%;
}
.tarot-price-card.featured {
    border: 2px solid var(--primary);
}
.tarot-price-card .price {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--foreground);
}
.tarot-price-card.featured .price {
    color: var(--primary);
}

/* ============================================
   Chat layout
   ============================================ */
.tarot-chat-wrapper {
    min-height: 500px;
}
.tarot-chat-messages {
    overflow-y: auto;
    max-height: 400px;
}
.tarot-chat-sidebar {
    overflow-y: auto;
    max-height: 450px;
}
.tarot-chat-user-bubble {
    max-width: 80%;
    display: inline-block;
    padding: 0.5rem 0.75rem;
    border-radius: 0.75rem;
    background: var(--primary);
    color: #fff;
}
.tarot-chat-ai-bubble {
    max-width: 80%;
    display: inline-block;
    padding: 0.5rem 0.75rem;
    border-radius: 0.75rem;
    background: var(--muted);
}

/* ============================================
   Ask Result - Drawn Card Mini
   ============================================ */
.tarot-mini-card {
    width: 140px;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    overflow: hidden;
    text-align: center;
    background: var(--card);
}
.tarot-mini-card-header {
    background: linear-gradient(135deg, #450a0a, #7f1d1d);
    color: #fff;
    padding: 0.5rem;
    border-radius: 0.5rem 0.5rem 0 0;
}

/* ============================================
   Card Image Display
   ============================================ */
.tarot-card-img-wrap {
    aspect-ratio: 3 / 5;
    border-radius: 0.5rem;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(212,32,32,0.05), rgba(254,243,199,0.1));
    position: relative;
}
.tarot-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.5rem;
    transition: transform 0.3s ease;
}
.tarot-card-item:hover .tarot-card-img {
    transform: scale(1.03);
}
.tarot-card-img-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, rgba(212,32,32,0.06), rgba(254,243,199,0.12));
    border-radius: 0.5rem;
}

/* ============================================
   Card Draw Animations
   ============================================ */

/* 3D Card Flip */
.card-flip-container {
    perspective: 1000px;
}
.card-flip-inner {
    position: relative;
    transition: transform 0.7s ease;
    transform-style: preserve-3d;
}
.card-flip-inner.flipped {
    transform: rotateY(180deg);
}
.card-flip-front,
.card-flip-back {
    backface-visibility: hidden;
    position: absolute;
    inset: 0;
}
.card-flip-back {
    transform: rotateY(180deg);
}

/* Staggered card reveal for multi-card spreads */
.card-reveal {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    animation: cardReveal 0.5s ease forwards;
}
.card-reveal:nth-child(1) { animation-delay: 0.1s; }
.card-reveal:nth-child(2) { animation-delay: 0.3s; }
.card-reveal:nth-child(3) { animation-delay: 0.5s; }
.card-reveal:nth-child(4) { animation-delay: 0.7s; }
.card-reveal:nth-child(5) { animation-delay: 0.9s; }
.card-reveal:nth-child(6) { animation-delay: 1.1s; }
.card-reveal:nth-child(7) { animation-delay: 1.3s; }
.card-reveal:nth-child(8) { animation-delay: 1.5s; }
.card-reveal:nth-child(9) { animation-delay: 1.7s; }
.card-reveal:nth-child(10) { animation-delay: 1.9s; }
.card-reveal:nth-child(11) { animation-delay: 2.1s; }
.card-reveal:nth-child(12) { animation-delay: 2.3s; }

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

/* Card glow on hover */
.card-glow:hover {
    box-shadow: 0 0 20px rgba(212, 32, 32, 0.15), 0 0 40px rgba(212, 32, 32, 0.05);
}

/* Single card hero entrance */
.card-hero-enter {
    animation: cardHeroEnter 0.8s ease forwards;
}
@keyframes cardHeroEnter {
    from {
        opacity: 0;
        transform: scale(0.85) rotateY(-15deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotateY(0);
    }
}

/* Reversed card rotation */
.card-reversed {
    transform: rotate(180deg);
}

/* Breathing ritual animation
   Cycle: Inhale 4s → Hold 2s → Exhale 4s → Hold 2s = 12s total
   Keyframe mapping: 0%=start, 33%=inhale done, 50%=hold done, 83%=exhale done, 100%=hold done */
.breath-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 32, 32, 0.12), rgba(212, 32, 32, 0.03));
    border: 2px solid rgba(212, 32, 32, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    transition: transform 0.3s, border-color 0.3s, opacity 0.3s;
}
.breath-circle.breathing {
    animation: breathe 12s ease-in-out infinite;
}
@keyframes breathe {
    0% {
        transform: scale(0.7);
        opacity: 0.5;
        border-color: rgba(212, 32, 32, 0.15);
    }
    33% {
        transform: scale(1.25);
        opacity: 1;
        border-color: rgba(212, 32, 32, 0.5);
    }
    50% {
        transform: scale(1.25);
        opacity: 1;
        border-color: rgba(212, 32, 32, 0.45);
    }
    83% {
        transform: scale(0.7);
        opacity: 0.5;
        border-color: rgba(212, 32, 32, 0.15);
    }
    100% {
        transform: scale(0.7);
        opacity: 0.5;
        border-color: rgba(212, 32, 32, 0.15);
    }
}

/* Reading table themes */
.reading-theme-mystic {
    background: linear-gradient(135deg, #1a0a2e 0%, #2d1b4e 50%, #1a0a2e 100%);
}
.reading-theme-wooden {
    background: linear-gradient(135deg, #3e2723, #5d4037);
}
.reading-theme-velvet {
    background: linear-gradient(135deg, #4a0000, #8b0000);
}
.reading-theme-cosmic {
    background: linear-gradient(135deg, #0a0a2e, #1a1a4e);
}
.reading-theme-mandala {
    background: linear-gradient(135deg, #1a0a2e, #2d1b4e);
}

/* Reduce animations for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .card-reveal {
        animation: none;
        opacity: 1;
        transform: none;
    }
    .card-hero-enter {
        animation: none;
    }
    .card-flip-inner {
        transition: none;
    }
    .breath-circle.breathing {
        animation: none;
        transform: scale(1);
        opacity: 0.8;
    }
}

/* ============================================
   Horoscope Hero Section
   ============================================ */
.horoscope-hero {
    position: relative;
    border-radius: 1.25rem;
    overflow: hidden;
    isolation: isolate;
}
.horoscope-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 80%, rgba(212, 32, 32, 0.15), transparent),
        radial-gradient(ellipse 50% 50% at 85% 20%, rgba(254, 243, 199, 0.08), transparent),
        linear-gradient(160deg, #2a0505 0%, #450a0a 35%, #7f1d1d 70%, #991b1b 100%);
    z-index: 0;
}
.horoscope-hero-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 15% 25%, rgba(254, 243, 199, 0.04) 1px, transparent 1px),
        radial-gradient(circle at 75% 65%, rgba(254, 243, 199, 0.03) 1px, transparent 1px),
        radial-gradient(circle at 45% 85%, rgba(254, 243, 199, 0.02) 1px, transparent 1px),
        radial-gradient(circle at 90% 15%, rgba(254, 243, 199, 0.03) 1px, transparent 1px),
        radial-gradient(circle at 55% 35%, rgba(254, 243, 199, 0.02) 1px, transparent 1px);
    background-size: 100% 100%;
}
.horoscope-hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid rgba(254, 243, 199, 0.06);
    border-radius: 1.25rem;
}
.horoscope-hero-content {
    position: relative;
    z-index: 1;
    padding: 2rem 2rem 2.25rem;
}
.horoscope-hero-symbol {
    font-size: 2.5rem;
    line-height: 1;
    margin-bottom: 0.75rem;
    opacity: 0;
    animation: symbolReveal 0.6s ease forwards;
    filter: drop-shadow(0 0 12px rgba(254, 243, 199, 0.3));
}
@keyframes symbolReveal {
    from { opacity: 0; transform: scale(0.6) rotate(-20deg); }
    to   { opacity: 1; transform: scale(1) rotate(0deg); }
}
.horoscope-hero-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.horoscope-hero-sign {
    font-family: var(--font-display), serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    letter-spacing: -0.01em;
}
.horoscope-hero-dates {
    font-family: var(--font-mono), monospace;
    font-size: 0.7rem;
    color: rgba(254, 243, 199, 0.45);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.horoscope-hero-divider {
    width: 2.5rem;
    height: 2px;
    background: linear-gradient(90deg, rgba(254, 243, 199, 0.5), transparent);
    margin-bottom: 1.25rem;
}
.horoscope-hero-guidance {
    font-family: var(--font-serif), serif;
    font-size: 0.95rem;
    line-height: 1.9;
    color: rgba(255, 255, 255, 0.88);
    margin: 0;
    max-width: 44rem;
    opacity: 0;
    animation: guidanceFade 0.7s ease 0.25s forwards;
}
@keyframes guidanceFade {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================
   Horoscope Bottom Grid (Lucky Card + Action)
   ============================================ */
.horoscope-bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: guidanceFade 0.5s ease 0.5s forwards;
}

/* Lucky Card Block */
.lucky-card-block {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    background: var(--card);
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition: all 0.3s ease;
}
.lucky-card-block:hover {
    border-color: var(--primary);
    color: inherit;
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(212, 32, 32, 0.1);
}
.lucky-card-glow {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(254, 243, 199, 0.15), transparent 70%);
    top: -30px;
    left: -30px;
    pointer-events: none;
    transition: opacity 0.3s;
}
.lucky-card-block:hover .lucky-card-glow {
    opacity: 1.5;
}
.lucky-card-image-wrap {
    width: 64px;
    height: 96px;
    flex-shrink: 0;
    border-radius: 0.5rem;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(212, 32, 32, 0.04), rgba(254, 243, 199, 0.08));
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(212, 32, 32, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.lucky-card-block:hover .lucky-card-image-wrap {
    transform: rotate(-3deg) scale(1.05);
    box-shadow:
        0 6px 20px rgba(212, 32, 32, 0.15),
        0 0 0 1px rgba(212, 32, 32, 0.12);
}
.lucky-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.lucky-card-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
    min-width: 0;
}
.lucky-card-label {
    font-family: var(--font-mono), monospace;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--primary);
    font-weight: 600;
}
.lucky-card-name {
    font-family: var(--font-display), serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--foreground);
    line-height: 1.2;
}
.lucky-card-keywords {
    font-size: 0.72rem;
    color: var(--muted-foreground);
    line-height: 1.4;
}
.lucky-card-arrow {
    color: var(--muted-foreground);
    font-size: 0.85rem;
    transition: transform 0.25s, color 0.25s;
    flex-shrink: 0;
}
.lucky-card-block:hover .lucky-card-arrow {
    transform: translateX(3px);
    color: var(--primary);
}

/* Suggested Action Block */
.suggested-action-block {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1.25rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    background: var(--card);
}
.suggested-action-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--secondary), rgba(254, 243, 199, 0.6));
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.suggested-action-content {
    flex: 1;
    min-width: 0;
}
.suggested-action-label {
    font-family: var(--font-mono), monospace;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted-foreground);
    font-weight: 600;
    display: block;
    margin-bottom: 0.35rem;
}
.suggested-action-text {
    font-size: 0.85rem;
    line-height: 1.65;
    color: var(--foreground);
    margin: 0;
}

/* ============================================
   Responsive — Horoscope
   ============================================ */
@media (max-width: 767px) {
    .horoscope-hero-content {
        padding: 1.5rem;
    }
    .horoscope-hero-symbol {
        font-size: 2rem;
    }
    .horoscope-hero-sign {
        font-size: 1.4rem;
    }
    .horoscope-hero-guidance {
        font-size: 0.88rem;
        line-height: 1.8;
    }
    .horoscope-bottom-grid {
        grid-template-columns: 1fr;
    }
    .lucky-card-image-wrap {
        width: 52px;
        height: 78px;
    }
}

/* ============================================
   Responsive Utilities
   ============================================ */
@media (max-width: 767px) {
    .tarot-section-heading {
        font-size: 1.5rem;
    }
}
