/* ==========================================================================
   TarotAI Core Stylesheet - Cosmic & Gold Theme
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&display=swap');

:root {
    --bg-space: #090810;
    --bg-space-dark: #050408;
    --color-gold: #D2A078;
    --color-gold-light: #f0dfcd;
    --color-violet: #5c3bc4;
    --color-violet-light: #8e54e9;
    --color-text: #f3f3f6;
    --color-muted: #a09eb0;
    --font-primary: 'Montserrat', sans-serif;
    --font-heading: 'Playfair Display', serif;
    --color-bg: #0d0c14;
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-space-dark);
    color: var(--color-text);
    font-family: var(--font-primary);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Custom Tarot AI Scrollbars (Gold & Cosmic Dark) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 14, 28, 0.8);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(210, 160, 120, 0.5) 0%, rgba(184, 134, 11, 0.7) 100%);
    border-radius: 10px;
    border: 1px solid rgba(210, 160, 120, 0.3);
    transition: var(--transition-smooth);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, rgba(210, 160, 120, 0.9) 0%, rgba(210, 160, 120, 1) 100%);
    box-shadow: 0 0 10px rgba(210, 160, 120, 0.5);
}

::-webkit-scrollbar-corner {
    background: rgba(15, 14, 28, 0.8);
}

/* Firefox Scrollbar Support */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(210, 160, 120, 0.5) rgba(15, 14, 28, 0.8);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--color-gold-light);
}

a {
    color: var(--color-gold);
    text-decoration: none;
    transition: var(--transition-smooth);
}

a:hover {
    color: #fff;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.6);
}

/* Background Layers */
#wrap {
    position: relative;
    width: 100%;
    min-height: 100vh;
    z-index: 2;
}

/* Navigation & Header */
header#header {
    background: rgba(9, 8, 16, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition-smooth);
}

header#header.scrolled {
    padding: 2px 0;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
}

.navbar-brand img {
    transition: var(--transition-smooth);
}

.navbar-brand img:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.5));
}

.nav-link {
    font-family: var(--font-heading);
    font-weight: 500;
    color: var(--color-text) !important;
    padding: 8px 16px !important;
    margin: 0 4px;
    border-radius: 4px;
    transition: var(--transition-smooth);
    white-space: nowrap;
}

.navbar-nav .nav-item {
    flex-shrink: 0;
}

.navbar-brand {
    flex-shrink: 0;
}

.navbar-nav .btn {
    white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
    color: var(--color-gold) !important;
    background: rgba(92, 59, 196, 0.15);
    text-shadow: 0 0 5px rgba(212, 175, 55, 0.3);
}

/* Header & User Dropdown Menu Clipping Fix */
#header, 
.site-navigation, 
.site-navigation .container, 
.site-navigation .navbar,
.user-wrapper-nav,
#userMenu,
#loginMenu {
    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
    z-index: 1050 !important;
}

#header {
    position: relative;
    z-index: 1050 !important;
}

.dropdown-menu,
#userMenu .dropdown-menu,
.nav-item.dropdown .dropdown-menu,
.user-wrapper-nav .dropdown-menu {
    z-index: 99999 !important;
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
    margin-top: 8px !important;
    background: rgba(18, 12, 32, 0.98) !important;
    border: 1px solid var(--color-gold) !important;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.85), 0 0 20px rgba(212, 175, 55, 0.3) !important;
    border-radius: 12px !important;
    backdrop-filter: blur(12px) !important;
    min-width: 220px !important;
}

.dropdown-item {
    color: var(--color-text);
    transition: var(--transition-smooth);
    padding: 10px 20px;
}

.dropdown-item:hover {
    background: rgba(92, 59, 196, 0.3);
    color: var(--color-gold);
}

/* Home Section Check */
.divcheck {
    position: relative;
    padding: 40px 0 80px;
    background: radial-gradient(circle at center, rgba(92, 59, 196, 0.15) 0%, transparent 70%);
}

.section-title h2 {
    font-size: clamp(1.8rem, 3.5vw, 3.4rem);
    font-weight: 800;
    text-align: center;
    background: linear-gradient(135deg, var(--color-gold-light) 30%, var(--color-gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 15px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.tracuu p {
    font-size: 1.2rem;
    color: var(--color-muted);
}

/* Homepage 3-Card Animation */
.cards-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 0;
    margin-top: 20px;
    perspective: 1000px;
}

.card-one {
    width: 160px;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform-origin: bottom center;
    cursor: pointer;
    position: relative;
}

.card-one img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    border: 2px solid rgba(212, 175, 55, 0.3);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    animation: floatCard 4s ease-in-out infinite alternate;
}

.card-one:nth-child(1) {
    transform: rotate(-22deg) translateX(40px);
    z-index: 1;
}

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

.card-one:nth-child(2) {
    transform: rotate(0deg) translateY(-25px);
    z-index: 2;
}

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

.card-one:nth-child(3) {
    transform: rotate(22deg) translateX(-40px);
    z-index: 1;
}

.card-one:nth-child(3) img {
    animation-delay: 0.5s;
}

.card-one:hover {
    transform: translateY(-45px) rotate(0deg) scale(1.15);
    z-index: 10;
}

.card-one:hover img {
    border-color: var(--color-gold);
    box-shadow: 0 20px 45px rgba(212, 175, 55, 0.4);
}

@keyframes floatCard {
    0% { transform: translateY(0); }
    100% { transform: translateY(-12px); }
}

/* Call to Action Buttons */
.submit-tracuu a.btn {
    background: linear-gradient(135deg, var(--color-violet) 0%, var(--color-violet-dark) 100%);
    border: 1px solid var(--color-gold);
    color: var(--color-gold-light);
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 700;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(92, 59, 196, 0.4);
    transition: var(--transition-smooth);
}

.submit-tracuu a.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
    background: linear-gradient(135deg, var(--color-violet-light) 0%, var(--color-violet) 100%);
    color: #fff;
}

/* Parallax Section */
.parallax-2 {
    background: linear-gradient(rgba(5, 4, 8, 0.95), rgba(9, 8, 16, 0.9)), url("../assets/moon-phasing.png") bottom right no-repeat;
    background-size: contain;
    padding: 80px 0;
    border-top: 1px solid rgba(212, 175, 55, 0.15);
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
}

.hand-wrap {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.left-hand, .right-hand {
    width: 45%;
}

.left-hand img {
    animation: floatLeftHand 3s ease-in-out infinite alternate;
}

.right-hand img {
    animation: floatRightHand 3s ease-in-out infinite alternate;
}

@keyframes floatLeftHand {
    0% { transform: translateY(0) rotate(0); }
    100% { transform: translateY(-8px) rotate(-3deg); }
}

@keyframes floatRightHand {
    0% { transform: translateY(0) rotate(0); }
    100% { transform: translateY(8px) rotate(3deg); }
}

#aboutct p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 20px;
    color: #d1d0db;
}

/* Services / Features */
.our-services {
    padding: 80px 0;
    background: rgba(5, 4, 8, 0.5);
}

.our-services h2 {
    font-size: 2.2rem;
    margin-bottom: 15px;
}

.bar {
    width: 60px;
    height: 3px;
    background: var(--color-gold);
    margin: 0 auto 40px;
    border-radius: 2px;
}

.box-center .box {
    background: rgba(15, 14, 28, 0.6);
    border: 1px solid rgba(212, 175, 55, 0.15);
    padding: 30px 25px;
    border-radius: 10px;
    height: 100%;
    transition: var(--transition-smooth);
    backdrop-filter: blur(10px);
}

.box-center .box:hover {
    transform: translateY(-8px);
    border-color: var(--color-gold);
    box-shadow: 0 10px 30px rgba(92, 59, 196, 0.25);
    background: rgba(15, 14, 28, 0.85);
}

.box h4 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--color-gold);
}

.box ul {
    list-style: none;
}

.box ul li {
    font-size: 0.95rem;
    color: var(--color-muted);
    margin-bottom: 10px;
    position: relative;
    padding-left: 20px;
}

.box ul li::before {
    content: "✦";
    position: absolute;
    left: 0;
    color: var(--color-gold);
}

/* Blog Section */
.blog {
    padding: 80px 0;
}

.p-wrap {
    background: rgba(15, 14, 28, 0.4);
    border: 1px solid rgba(212, 175, 55, 0.1);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 30px;
    transition: var(--transition-smooth);
}

.p-wrap:hover {
    transform: translateY(-5px);
    border-color: var(--color-gold);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.p-head img {
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.p-wrap:hover .p-head img {
    transform: scale(1.05);
}

.p-title {
    padding: 20px;
}

.p-title h3 {
    font-size: 1.1rem;
    line-height: 1.5;
}

.p-title a {
    color: var(--color-text);
}

.p-title a:hover {
    color: var(--color-gold);
}

.p-footer {
    padding: 0 20px 20px;
}

.blog_icon_list {
    list-style: none;
    font-size: 0.85rem;
    color: var(--color-muted);
}

/* Footer styling */
#footer {
    background: var(--bg-space);
    border-top: 1px solid rgba(212, 175, 55, 0.15);
    padding: 60px 0 30px;
    color: var(--color-muted);
}

.footer-title {
    font-size: 1.3rem;
    color: var(--color-gold);
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}

.footer-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background: var(--color-gold);
}

.ftul {
    list-style: none;
}

.ftul li {
    margin-bottom: 12px;
}

.ftul li a {
    color: var(--color-muted);
}

.ftul li a:hover {
    color: var(--color-gold);
}

.footer-social a {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    color: var(--color-gold-light);
    margin-right: 10px;
    transition: var(--transition-smooth);
}

.footer-social a:hover {
    background: var(--color-gold);
    color: var(--bg-space);
    transform: translateY(-3px);
}

/* Support Icons Floating */
.support {
    position: fixed;
    right: 25px;
    bottom: 30px;
    z-index: 1000;
}

.fix-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    transition: var(--transition-smooth);
    background: rgba(9, 8, 16, 0.9);
    border: 1px solid var(--color-gold);
}

.fix-icon:hover {
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.4);
}

.fix-icon i {
    font-size: 20px;
    color: var(--color-gold-light);
}

.zalo-icon img {
    width: 32px;
    height: 32px;
    filter: invert(88%) sepia(34%) saturate(456%) hue-rotate(344deg) brightness(98%) contrast(93%);
}

/* Mobile Phonebar */
.phonebar {
    width: 100%;
    background: rgba(9, 8, 16, 0.95);
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 0;
    z-index: 999;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.5);
}

.phonebar a {
    color: var(--color-text);
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.phonebar a i {
    font-size: 1.2rem;
    color: var(--color-gold);
}

.phonebar a img {
    width: 20px;
    height: 20px;
}

/* API Settings Modal Trigger */
.api-settings-trigger {
    background: transparent;
    border: none;
    color: var(--color-gold);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    padding: 8px;
    display: flex;
    align-items: center;
}

/* Force rounder corners for all buttons and boxes as requested */
.btn, .box, .auth-btn-primary, .auth-form-control, .p-wrap {
    border-radius: 30px !important;
}

.api-settings-trigger:hover {
    color: #fff;
    transform: rotate(45deg);
}

/* Modal Form Styles */
.custom-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    z-index: 1100;
    align-items: center;
    justify-content: center;
}

.custom-modal.active {
    display: flex;
}

.modal-content {
    background: #0f0e1a;
    border: 1px solid var(--color-gold);
    border-radius: 12px;
    width: 90%;
    margin: 0 auto;
    max-width: 500px;
    padding: 30px;
    position: relative;
    box-shadow: 0 10px 40px rgba(92, 59, 196, 0.4);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.8rem;
    color: var(--color-muted);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.modal-close:hover {
    color: #fff;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-family: var(--font-heading);
    color: var(--color-gold-light);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 6px;
    padding: 12px 16px;
    color: #fff;
    transition: var(--transition-smooth);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-gold);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
    opacity: 1; /* Override Firefox's default opacity */
}

/* 78 Cards Meaning Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.grid-card-item {
    background: rgba(15, 14, 28, 0.4);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.grid-card-item:hover {
    transform: translateY(-5px);
    border-color: var(--color-gold);
    box-shadow: 0 8px 20px rgba(92, 59, 196, 0.25);
    background: rgba(15, 14, 28, 0.7);
}

.grid-card-item img {
    max-width: 100px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.grid-card-item p {
    font-size: 0.9rem;
    font-weight: 600;
}

/* ==========================================================================
   3D Card Deck Fanning and Flipping Mechanics
   ========================================================================== */

.card-spread-container {
    overflow: hidden;
    position: relative;
    padding: 40px 0;
}

.card-deck {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    height: 300px;
    margin: 30px auto;
    width: 100%;
    max-width: 1000px;
    perspective: 1000px;
    transition: transform 0.3s ease-out;
}

.tarot-card {
    position: absolute;
    width: 120px;
    height: 200px;
    cursor: pointer;
    transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.4s ease;
    transform-origin: bottom center;
    z-index: 10;
}

/* Fan arrangement using CSS variables provided by JS */
.tarot-card {
    transform: translate(var(--tx, 0px), var(--ty, 0px)) rotate(var(--rot, 0deg));
}

.tarot-card:hover {
    transform: translate(var(--tx, 0px), calc(var(--ty, 0px) - 30px)) rotate(var(--rot, 0deg)) scale(1.1) !important;
    z-index: 100 !important;
}

.card-wrap {
    position: relative;
    width: 100%;
    height: 100%;
}

.card-name {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    text-align: center;
    font-size: 0.75rem;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
    color: var(--color-gold-light);
    text-shadow: 0 0 5px rgba(0,0,0,0.8);
}

.card.revealed + .card-name {
    /* Only show label after flipped */
    opacity: 1;
}

/* Card 3D Structure */
.card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    background: transparent;
}

.card-back, .card-front {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.25);
}

.card-back img, .card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-back {
    background: #0d0c1e;
    transform: rotateY(0deg);
}

.card-front {
    background: #0f0e1a;
    transform: rotateY(180deg);
}

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

/* Card selection glow */
.card.selected {
    box-shadow: 0 0 20px var(--color-gold), 0 0 5px rgba(212, 175, 55, 0.8);
    border: 1px solid var(--color-gold);
}

/* Custom selection badge order removed as requested */

/* Reveal card face up */
.card.revealed {
    transform: rotateY(180deg);
}

/* Cards fly-out animation (vanish unchosen cards) */
.tarot-card.fly-out {
    opacity: 0 !important;
    transform: translateY(-200px) rotate(45deg) scale(0.2) !important;
    pointer-events: none !important;
    transition: all 0.4s cubic-bezier(0.55, 0.085, 0.68, 0.53);
}

/* Position variables for the 3 selected cards */
.tarot-card.selected.final-state {
    position: absolute;
    left: 50%;
    top: 50%;
    transform-origin: center center;
    z-index: 200 !important;
}

.tarot-card.selected.final-pos-1 {
    transform: translate(-180px, -50%) scale(1.15) !important;
    z-index: 203 !important;
}

.tarot-card.selected.final-pos-2 {
    transform: translate(-50%, -50%) scale(1.15) !important;
    z-index: 202 !important;
}

.tarot-card.selected.final-pos-3 {
    transform: translate(60px, -50%) scale(1.15) !important;
    z-index: 201 !important;
}

/* Fade out deck container */
.card-deck.fade-out {
    pointer-events: none;
}

/* --- Responsive Card Layout for Mobile --- */
@media (max-width: 767px) {
    .card-spread-container {
        /* Prevent iOS Safari from clipping 3D transformed elements */
        overflow: visible !important;
    }

    .card-deck {
        width: 100%;
        height: 250px;
        margin: 20px 0;
        transform: none !important; /* Disable any leftover drag transform */
    }

    .tarot-card {
        width: 70px; /* Slightly smaller for mobile */
        height: 122px;
        position: absolute; /* Enforce absolute positioning */
        left: calc(50% - 35px); /* Center exactly */
        margin: 0;
        transform-style: preserve-3d; /* Fix Safari 3D bug */
    }

    .tarot-card:hover {
        /* Maintain arc position, just lift up slightly */
        transform: translate(var(--tx, 0px), calc(var(--ty, 0px) - 15px)) rotate(var(--rot, 0deg)) scale(1.1) !important;
    }

    .tarot-card.selected.final-state {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        transform: none !important;
        margin: 0 2% !important;
        width: 28% !important; /* 28% of container ~ 105px on standard mobile, 50% larger than 70px */
        height: auto !important;
        aspect-ratio: 2 / 3.5 !important;
        opacity: 1 !important;
    }

    .tarot-card.selected.final-pos-1,
    .tarot-card.selected.final-pos-2,
    .tarot-card.selected.final-pos-3 {
        left: auto !important;
        top: auto !important;
        transform: none !important;
    }
    
    .card.selected::after {
        top: -4px;
        right: -4px;
        width: 16px;
        height: 16px;
        line-height: 16px;
        font-size: 0.65rem;
    }
}

/* Visibility utilities */
.-hidden {
    display: none !important;
}

/* Results Card Image formatting */
.tarot-card-img {
    border-radius: 8px;
    border: 2px solid rgba(212, 175, 55, 0.3);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    max-height: 320px;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.tarot-card-img.reversed {
    transform: rotate(180deg);
}

.tarot-card-img:hover {
    border-color: var(--color-gold);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.4);
}

/* ==========================================================================
   Redesigned Draw Mode UI
   ========================================================================== */

/* Draw Mode Overrides */
body.draw-mode .tarot-topic {
    display: none !important;
}

body.draw-mode {
}

/* Topic Indicator */
.topic-indicator-btn {
    background: transparent;
    border: 1px solid #d4af37;
    color: #d4af37;
    padding: 8px 30px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-family: var(--font-heading);
}

/* Counter Circle */
.counter-circle {
    position: relative;
    width: 64px;
    height: 64px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(212,175,55,0.1) 0%, transparent 70%);
}

.counter-circle .sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #d4af37;
    border-radius: 50%;
    box-shadow: 0 0 5px #d4af37;
}

.spark-1 { top: 0; left: 50%; transform: translate(-50%, -50%); }
.spark-2 { bottom: 0; left: 50%; transform: translate(-50%, 50%); }
.spark-3 { left: 0; top: 50%; transform: translate(-50%, -50%); }
.spark-4 { right: 0; top: 50%; transform: translate(50%, -50%); }


/* Fan & Card proportion fixes */
.card-deck {
    max-width: 1400px;
}

.tarot-card {
    width: 110px; /* fixed visual width */
    aspect-ratio: 2 / 3.5; /* maintain realistic card proportions */
    height: auto;
    transform-origin: 50% 90%; /* pivot near bottom for fan */
}

.tarot-card .card-back img, .tarot-card .card-front img {
    border-radius: 8px;
    object-fit: cover;
    width: 100%;
    height: 100%;
}

/* Reduce hover lift so layout remains tidy */
.tarot-card:hover {
    transform: translate(var(--tx, 0px), calc(var(--ty, 0px) - 12px)) rotate(var(--rot, 0deg)) scale(1.05) !important;
}

/* Slightly tighter spacing on large screens */
@media (min-width: 1200px) {
    .tarot-card { width: 120px; aspect-ratio: 2 / 3.5; }
}

@media (max-width: 767px) {
    .tarot-card { width: 72px; aspect-ratio: 2 / 3.5; }
}



@keyframes cardWiggle {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-4px) rotate(0.8deg); }
    100% { transform: translateY(2px) rotate(-0.5deg); }
}

.tarot-card .card-wrap {
    animation: cardWiggle 3.5s ease-in-out infinite alternate;
}

.tarot-card:nth-child(even) .card-wrap {
    animation-delay: -1.2s;
    animation-duration: 4s;
}

.tarot-card:nth-child(3n) .card-wrap {
    animation-delay: -2.5s;
    animation-duration: 3.2s;
}

.tarot-card:nth-child(5n) .card-wrap {
    animation-delay: -0.8s;
    animation-duration: 4.5s;
}

.tarot-card.selected .card-wrap {
    animation: none !important;
}








.tarot-card.selected {
    transform: translate(var(--tx, 0px), calc(var(--ty, 0px) - 25px)) rotate(var(--rot, 0deg));
}

/* Global override for text-muted to improve contrast on dark background */
.text-muted {
    color: #b3b3b3 !important;
}

/* AI Chat Styles */
.chat-container {
    background: rgba(15, 14, 28, 0.5);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
}

.chat-messages {
    height: 350px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px inset rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}
.chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}
.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.3);
    border-radius: 3px;
}

.chat-msg {
    max-width: 85%;
    display: flex;
    word-break: break-word;
}

.chat-msg.user-msg {
    align-self: flex-end;
}

.chat-msg.ai-msg {
    align-self: flex-start;
}

.msg-bubble {
    padding: 10px 15px;
    border-radius: 15px;
    line-height: 1.5;
    font-size: 0.95rem;
    overflow-wrap: break-word;
    word-wrap: break-word;
    white-space: normal;
}

.user-msg .msg-bubble {
    background: linear-gradient(135deg, rgba(92, 59, 196, 0.6) 0%, rgba(65, 41, 145, 0.6) 100%);
    border: 1px solid rgba(92, 59, 196, 0.8);
    border-bottom-right-radius: 2px;
}

.ai-msg .msg-bubble {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-bottom-left-radius: 2px;
    color: #e0e0e0;
}

/* Seamless Rounded Chat Pill Input matching reference mockup */
.chat-input-area {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    border-radius: 50px !important;
    border: 1px solid rgba(212, 175, 55, 0.4) !important;
    background: rgba(18, 14, 28, 0.85) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(212, 175, 55, 0.15) !important;
    overflow: hidden !important;
    padding: 4px 4px 4px 16px !important;
    transition: all 0.3s ease !important;
}

.chat-input-area:focus-within {
    border-color: var(--color-gold) !important;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4) !important;
}

.chat-input-area input#chatInput,
.chat-input-area input {
    flex: 1 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #ffffff !important;
    padding: 10px 10px !important;
    font-size: 0.95rem !important;
    border-radius: 0 !important;
}

.chat-input-area input::placeholder {
    color: rgba(255, 255, 255, 0.55) !important;
}

.chat-input-area input:focus {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

.chat-input-area button#btnSendChat,
.chat-input-area button {
    margin: 0 !important;
    border: none !important;
    border-radius: 50px !important;
    background-color: var(--color-gold) !important;
    color: #000000 !important;
    font-weight: 700 !important;
    padding: 10px 24px !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
}

.chat-input-area button#btnSendChat:hover,
.chat-input-area button:hover {
    background-color: var(--color-gold-light) !important;
    color: #000 !important;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.7) !important;
    transform: scale(1.02);
}

/* AI Locked Section Styles */
.ai-locked-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.blurred-content {
    filter: blur(6px);
    opacity: 0.5;
    pointer-events: none;
    user-select: none;
    transition: all 0.5s ease-in-out;
}

.ai-unlock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(15, 14, 28, 0.4);
    z-index: 10;
}

/* Premium Warm Gold Theme Unlock Button */
#btnUnlockAI {
    background: linear-gradient(135deg, #e4b891 0%, #d2a078 50%, #b58356 100%) !important;
    color: #0d0a18 !important;
    font-weight: 700 !important;
    font-size: 1.05rem !important;
    letter-spacing: 0.3px !important;
    padding: 14px 32px !important;
    max-width: 90% !important;
    border-radius: 50px !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(210, 160, 120, 0.5) !important;
    text-shadow: none !important;
    cursor: pointer !important;
    transition: all 0.3s ease-in-out !important;
    animation: unlockBtnPulse 3s infinite ease-in-out !important;
    position: relative !important;
    z-index: 20 !important;
    display: inline-block !important;
    text-align: center !important;
    white-space: nowrap !important;
}

@media (max-width: 767.98px) {
    #btnUnlockAI {
        white-space: normal !important;
        font-size: 0.95rem !important;
        padding: 12px 24px !important;
        line-height: 1.4 !important;
    }
}

#btnUnlockAI:hover {
    background: linear-gradient(135deg, #ffffff 0%, #e4b891 50%, #d2a078 100%) !important;
    color: #000000 !important;
    transform: scale(1.03) translateY(-2px) !important;
    box-shadow: 0 0 25px rgba(210, 160, 120, 0.8) !important;
}

@keyframes unlockBtnPulse {
    0%, 100% {
        box-shadow: 0 0 12px rgba(210, 160, 120, 0.4), 0 0 25px rgba(210, 160, 120, 0.2);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 22px rgba(210, 160, 120, 0.7), 0 0 35px rgba(210, 160, 120, 0.4);
        transform: scale(1.02);
    }
}

/* Fix layout for fixed header */
.tarot-card-area { padding-top: 120px !important; }
.tarot-view-button { scroll-margin-top: 120px; }


/* Mystical Loader */
.mystical-loader {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}
.glow-orb {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212,175,55,0.4) 0%, rgba(92,59,196,0.1) 70%, transparent 100%);
    box-shadow: 0 0 20px 5px rgba(212, 175, 55, 0.3);
    animation: pulse-orb 2s infinite ease-in-out;
}
.center-eye {
    position: absolute;
    font-size: 2.5rem;
    color: var(--color-gold);
    animation: float-eye 3s infinite ease-in-out;
}
.stars-orbit {
    position: absolute;
    width: 100%;
    height: 100%;
    animation: spin-orbit 4s infinite linear;
}
.stars-orbit i {
    position: absolute;
    color: var(--color-gold);
    font-size: 0.8rem;
    filter: drop-shadow(0 0 5px var(--color-gold));
}
.star-1 { top: 0; left: 50%; transform: translateX(-50%); }
.star-2 { bottom: 15%; left: 15%; }
.star-3 { bottom: 15%; right: 15%; }

@keyframes pulse-orb {
    0% { transform: scale(0.8); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.8); opacity: 0.5; }
}
@keyframes float-eye {
    0% { transform: translateY(0); }
    50% { transform: translateY(-5px); text-shadow: 0 0 15px var(--color-gold); }
    100% { transform: translateY(0); }
}
@keyframes spin-orbit {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 15px;
  width: fit-content;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background-color: var(--color-gold);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: translateY(0);
  } 
  40% {
    transform: translateY(-6px);
  }
}

/* Fix disabled input background */
#chatInput:disabled {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* --- FLYING TAROT CARDS LOADER --- */
.tarot-loader-container {
    position: relative;
    width: 200px;
    height: 180px;
    margin: 0 auto 30px auto;
    perspective: 1000px;
}

.tarot-loading-card {
    position: absolute;
    width: 50px;
    height: 80px;
    top: 50px;
    left: 75px;
    background: linear-gradient(135deg, var(--color-gold) 0%, #a67c00 100%);
    border-radius: 6px;
    border: 2px solid #fff;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
    transform-origin: bottom center;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--color-bg);
    font-size: 1.2rem;
    animation-duration: 4s;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
}

.tarot-loading-card::before {
    content: '';
    position: absolute;
    inset: 3px;
    border: 1px dashed rgba(255,255,255,0.5);
    border-radius: 4px;
    z-index: 0;
}

.tarot-loading-card i {
    position: relative;
    z-index: 2;
    color: var(--color-bg);
    font-size: 1.5rem;
}

.tarot-card-1 { animation-name: flyCard1; z-index: 1; }
.tarot-card-2 { animation-name: flyCard2; z-index: 2; }
.tarot-card-3 { animation-name: flyCard3; z-index: 5; }
.tarot-card-4 { animation-name: flyCard4; z-index: 4; }
.tarot-card-5 { animation-name: flyCard5; z-index: 3; }

/* 5 Cards fanning out wide and floating, then returning */
@keyframes flyCard1 {
    0%, 100% { transform: translateY(0) translateX(0) rotate(0deg) scale(1); opacity: 0.5; }
    40%, 60% { transform: translateY(20px) translateX(-70px) rotate(-40deg) scale(1.1); box-shadow: 0 0 25px rgba(212, 175, 55, 0.8); opacity: 1; }
}

@keyframes flyCard2 {
    0%, 100% { transform: translateY(0) translateX(0) rotate(0deg) scale(1); opacity: 0.5; }
    40%, 60% { transform: translateY(-5px) translateX(-35px) rotate(-20deg) scale(1.15); box-shadow: 0 0 30px rgba(212, 175, 55, 0.9); opacity: 1; }
}

@keyframes flyCard3 {
    0%, 100% { transform: translateY(0) translateX(0) rotate(0deg) scale(1); opacity: 1; box-shadow: 0 0 10px rgba(212, 175, 55, 0.8); }
    40%, 60% { transform: translateY(-20px) translateX(0) rotate(0deg) scale(1.2); box-shadow: 0 0 40px rgba(212, 175, 55, 1); }
}

@keyframes flyCard4 {
    0%, 100% { transform: translateY(0) translateX(0) rotate(0deg) scale(1); opacity: 0.5; }
    40%, 60% { transform: translateY(-5px) translateX(35px) rotate(20deg) scale(1.15); box-shadow: 0 0 30px rgba(212, 175, 55, 0.9); opacity: 1; }
}

@keyframes flyCard5 {
    0%, 100% { transform: translateY(0) translateX(0) rotate(0deg) scale(1); opacity: 0.5; }
    40%, 60% { transform: translateY(20px) translateX(70px) rotate(40deg) scale(1.1); box-shadow: 0 0 25px rgba(212, 175, 55, 0.8); opacity: 1; }
}

.tarot-loader-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: radial-gradient(circle, rgba(212,175,55,0.3) 0%, transparent 60%);
    animation: pulseGlow 4s infinite ease-in-out;
    z-index: 0;
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(0.6); opacity: 0.3; }
    50% { transform: scale(1.4); opacity: 1; }
}

/* Mobile-specific fix for 3-card animation on homepage */
@media (max-width: 768px) {
    /* Disable individual card pop-up on mobile tap */
    .card-one:nth-child(1):hover, .card-one:nth-child(1):active {
        transform: rotate(-22deg) translateX(40px) !important;
        z-index: 1 !important;
    }
    .card-one:nth-child(2):hover, .card-one:nth-child(2):active {
        transform: rotate(0deg) translateY(-25px) !important;
        z-index: 2 !important;
    }
    .card-one:nth-child(3):hover, .card-one:nth-child(3):active {
        transform: rotate(22deg) translateX(-40px) !important;
        z-index: 1 !important;
    }

    /* Animate the entire container upwards when tapped */
    .cards-container {
        transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    }
    .cards-container:active {
        transform: translateY(-30px);
    }
}

/* Responsive logo scaling to prevent header overflow */
@media (max-width: 1199px) {
    .navbar-brand img {
        width: 42px !important;
    }
    .logo-text-wrapper {
        font-size: 1.5rem !important;
    }
    .logo-text-wrapper i.ph-sparkle {
        font-size: 1.2rem !important;
        top: -10px !important;
        right: -20px !important;
    }
}

@media (max-width: 767px) {
    .navbar-brand img {
        width: 31px !important;
    }
    .logo-text-wrapper {
        font-size: 1.2rem !important;
        margin-top: 2px !important;
    }
    .logo-text-wrapper i.ph-sparkle {
        font-size: 1rem !important;
        top: -8px !important;
        right: -15px !important;
    }
}

/* Mobile Navbar Grid Layout Fix */
@media (max-width: 991.98px) {
    .site-navigation .navbar {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }
    .site-navigation .navbar-brand {
        grid-column: 1;
        grid-row: 1;
        width: 100%;
        margin-right: 15px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .site-navigation .navbar-brand .logo-text-wrapper {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: inline-block;
        vertical-align: middle;
        max-width: calc(100% - 35px);
    }
    .site-navigation .user-wrapper-nav {
        grid-column: 2;
        grid-row: 1;
    }
    .site-navigation .navbar-collapse {
        grid-column: 1 / span 2;
        grid-row: 2;
    }
}

/* Priority+ Nested Dropdown Fix */
.dropdown-menu .dropdown {
    position: relative;
}
.dropdown-menu .dropdown-menu {
    display: none;
    position: absolute;
    left: 100%;
    top: -5px;
    margin-top: 0;
}
.dropdown-menu .dropdown:hover > .dropdown-menu {
    display: block;
}
.dropdown-menu .dropdown-toggle::after {
    transform: rotate(-90deg);
}

/* Ticker Marquee */
.ticker-wrap {
    width: 100%;
    overflow: hidden;
    background-color: transparent;
    padding-top: 1.2rem;
    padding-bottom: 1.2rem;
    box-sizing: border-box;
    border-top: 1px solid var(--color-gold);
    border-bottom: 1px solid var(--color-gold);
    box-shadow: 0 -5px 15px rgba(220, 169, 107, 0.25), 0 5px 15px rgba(220, 169, 107, 0.25);
    white-space: nowrap;
}
.ticker {
    display: inline-block;
    white-space: nowrap;
    padding-right: 100%;
    box-sizing: content-box;
    animation: ticker 40s linear infinite;
    color: var(--color-gold);
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: 3px;
    text-shadow: 0 0 8px rgba(220, 169, 107, 0.5);
}
@keyframes ticker {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-50%, 0, 0); }
}

/* Modern Article Titles (Times New Roman style) */
.article-title-serif {
    font-family: 'Times New Roman', Times, serif !important;
    font-weight: 300 !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.article-title-serif-sm {
    font-family: 'Times New Roman', Times, serif !important;
    font-weight: 300 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 1.1rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   Chatbot Assistant Widget Styles
   ========================================================================== */
.chatbot-window {
    position: fixed;
    bottom: 90px;
    right: 25px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: rgba(13, 12, 22, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(210, 160, 120, 0.35);
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7), 0 0 25px rgba(92, 59, 196, 0.25);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    animation: chatbotPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes chatbotPop {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.chatbot-header {
    background: linear-gradient(135deg, rgba(30, 24, 50, 0.95), rgba(15, 13, 28, 0.95));
    padding: 14px 18px;
    border-bottom: 1px solid rgba(210, 160, 120, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--color-gold-light);
    font-weight: 600;
    font-size: 1rem;
}

.chatbot-header span {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-gold);
    font-family: var(--font-heading);
}

.chatbot-close {
    background: transparent;
    border: none;
    color: #a09eb0;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 50%;
    transition: var(--transition-smooth);
}

.chatbot-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.chatbot-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}
.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(210, 160, 120, 0.3);
    border-radius: 10px;
}

.chat-message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.9rem;
    line-height: 1.5;
    word-break: break-word;
}

.chat-message.bot-message {
    align-self: flex-start;
    background: rgba(35, 30, 55, 0.85);
    color: #e5e3f0;
    border: 1px solid rgba(142, 84, 233, 0.25);
    border-top-left-radius: 4px;
}

.chat-message.bot-message a {
    color: var(--color-gold);
    text-decoration: underline;
}

.chat-message.user-message {
    align-self: flex-end;
    background: linear-gradient(135deg, #d2a078, #b88258);
    color: #0d0c14;
    font-weight: 500;
    border-top-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(210, 160, 120, 0.2);
}

.chatbot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 16px 10px 16px;
}

.chat-chip {
    background: rgba(92, 59, 196, 0.2);
    border: 1px solid rgba(210, 160, 120, 0.3);
    color: var(--color-gold-light);
    font-size: 0.78rem;
    padding: 5px 10px;
    border-radius: 15px;
    cursor: pointer;
    transition: var(--transition-smooth);
    white-space: nowrap;
}

.chat-chip:hover {
    background: rgba(210, 160, 120, 0.25);
    color: #fff;
    border-color: var(--color-gold);
}

.chatbot-input {
    padding: 12px 16px;
    background: rgba(20, 18, 32, 0.95);
    border-top: 1px solid rgba(210, 160, 120, 0.2);
    display: flex;
    gap: 10px;
    align-items: center;
}

.chatbot-input input {
    flex: 1;
    background: rgba(35, 30, 55, 0.6);
    border: 1px solid rgba(210, 160, 120, 0.3);
    border-radius: 20px;
    padding: 8px 16px;
    color: #fff;
    font-size: 0.88rem;
    outline: none;
    transition: var(--transition-smooth);
}

.chatbot-input input:focus {
    border-color: var(--color-gold);
    box-shadow: 0 0 10px rgba(210, 160, 120, 0.2);
}

.chatbot-input button {
    background: linear-gradient(135deg, var(--color-violet) 0%, var(--color-violet-light) 100%);
    border: 1px solid var(--color-gold);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.chatbot-input button:hover {
    transform: scale(1.08);
    box-shadow: 0 0 12px rgba(142, 84, 233, 0.6);
}

.typing-indicator {
    color: var(--color-gold);
    font-style: italic;
    font-size: 0.85rem;
}

.chat-typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 4px;
}

.chat-typing-dots span {
    width: 8px;
    height: 8px;
    background-color: var(--color-gold);
    border-radius: 50%;
    display: inline-block;
    animation: typingBlink 1.4s infinite ease-in-out both;
}

.chat-typing-dots span:nth-child(1) {
    animation-delay: 0s;
}

.chat-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBlink {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.3;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
        box-shadow: 0 0 10px var(--color-gold);
    }
}

/* ==========================================================================
   Mobile Display Centering, Viewport Overflow & Alignment Fixes
   ========================================================================== */
html, body {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
}

#wrap, .container, .container-fluid {
    max-width: 100vw !important;
    overflow-x: hidden !important;
}

.ticker-wrap {
    width: 100% !important;
    max-width: 100vw !important;
    overflow: hidden !important;
    contain: paint !important;
}

@media (max-width: 767.98px) {
    .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        width: 100% !important;
    }
    
    .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    #selected-cards-display > [class*="col-"] {
        display: flex !important;
        justify-content: center !important;
        width: 100% !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .card-result-item {
        width: 100% !important;
        max-width: 320px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .result-card-wrapper img {
        margin: 0 auto !important;
        display: block !important;
    }

    #offline-reading-content,
    #ai-reading-wrapper,
    .loading-indicator-inline,
    .result-box,
    .tracuu, 
    .hand-wrap, 
    #aboutleft, 
    #aboutct, 
    .section-title, 
    .featured-blogs-magazine {
        margin-left: auto !important;
        margin-right: auto !important;
        width: 100% !important;
        text-align: center !important;
    }

    .hand-wrap {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 15px !important;
        margin: 0 auto 20px auto !important;
    }

    .hand-wrap .left-hand, 
    .hand-wrap .right-hand {
        display: inline-block !important;
        margin: 0 auto !important;
    }

    /* Center align mobile action buttons */
    .tracuu .btn, 
    .divcheck .btn,
    .btn-outline-light.rounded-pill,
    .btn-gold {
        margin-left: auto !important;
        margin-right: auto !important;
        text-align: center !important;
    }

    .result-summary h4, 
    .card-details h4,
    .result-title-h1 {
        text-align: center !important;
    }
}

@media (min-width: 768px) {
    .text-nowrap-md {
        white-space: nowrap !important;
    }
}

/* Tạo lề hai bên cho header và footer bằng cách giới hạn max-width của container */
@media (min-width: 992px) {
    #header .container, #footer .container {
        max-width: 90% !important;
    }
}

@media (min-width: 1400px) {
    #header .container, #footer .container {
        max-width: 80% !important;
    }
}
