/* ============================================================
   NEW CHAPTER CARE — COMPONENTS
   Theme Switcher, WhatsApp Float, CTA Banner, Misc
   ============================================================ */

/* ─────────────────────────────────────────────────────────── */
/*  THEME SWITCHER                                             */
/* ─────────────────────────────────────────────────────────── */
.theme-switcher {
    position: fixed;
    bottom: 7rem;
    right: 1.5rem;
    z-index: 900;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
}

.theme-switcher__label {
    font-family: 'Jost', sans-serif;
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    writing-mode: horizontal-tb;
    margin-bottom: 0.4rem;
    opacity: 0.7;
    transition: color 0.8s ease;
}

.theme-dots {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.theme-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--color-surface);
    cursor: pointer;
    position: relative;
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.theme-dot:hover {
    transform: scale(1.2);
}

.theme-dot.active {
    transform: scale(1.3);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.6),
                0 3px 12px rgba(0, 0, 0, 0.3);
}

.theme-dot[data-theme="gold"]  { background: #B8860B; }
.theme-dot[data-theme="teal"]  { background: #1B6B6B; }
.theme-dot[data-theme="rose"]  { background: #A0435A; }
.theme-dot[data-theme="navy"]  { background: #1A2E5C; }
.theme-dot[data-theme="sage"]  { background: #4A7A5C; }

/* Tooltip on hover */
.theme-dot::before {
    content: attr(data-label);
    position: absolute;
    right: 130%;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'Jost', sans-serif;
    font-size: 0.68rem;
    font-weight: 500;
    white-space: nowrap;
    background: var(--color-text);
    color: #FFFFFF;
    padding: 0.25rem 0.6rem;
    border-radius: 2px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.theme-dot:hover::before {
    opacity: 1;
}

/* Theme Progress Bar */
.theme-progress {
    position: fixed;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--color-primary);
    transition:
        width 0.05s linear,
        background 0.8s ease;
    z-index: 9999;
    opacity: 0.7;
}

/* ─────────────────────────────────────────────────────────── */
/*  WHATSAPP FLOATING BUTTON                                   */
/* ─────────────────────────────────────────────────────────── */
.whatsapp-float {
    position: fixed;
    bottom: 2rem;
    right: 1.5rem;
    z-index: 900;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.whatsapp-float__btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #25D366;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
    position: relative;
}

.whatsapp-float__btn:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 8px 30px rgba(37, 211, 102, 0.55);
}

/* Pulse ring */
.whatsapp-float__btn::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(37, 211, 102, 0.4);
    animation: whatsappPulse 2.2s ease-in-out infinite;
}

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

.whatsapp-float__btn svg {
    width: 30px;
    height: 30px;
    fill: #FFFFFF;
}

.whatsapp-float__label {
    background: #FFFFFF;
    color: var(--color-text);
    font-family: 'Jost', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 100px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateX(10px);
    border: 1px solid var(--color-border);
    transition:
        opacity 0.3s ease,
        transform 0.3s ease,
        background 0.8s ease,
        border-color 0.8s ease;
}

.whatsapp-float:hover .whatsapp-float__label {
    opacity: 1;
    transform: translateX(0);
}

/* ─────────────────────────────────────────────────────────── */
/*  CTA BANNER                                                 */
/* ─────────────────────────────────────────────────────────── */
.cta-banner {
    position: relative;
    overflow: hidden;
    padding: 6rem 0;
    text-align: center;
    background: var(--color-primary);
    transition: background 0.8s ease;
}

.cta-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('https://images.unsplash.com/photo-1559827291-72ee739d0d9a?w=1400&q=60');
    background-size: cover;
    background-position: center;
    opacity: 0.08;
}

.cta-banner__content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    margin: 0 auto;
}

.cta-banner .overline {
    display: inline-block;
    font-family: 'Jost', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1rem;
}

.cta-banner h2 {
    color: #FFFFFF;
    margin-bottom: 1.2rem;
}

.cta-banner p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 1.05rem;
    margin-bottom: 2.4rem;
}

.cta-banner__actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    flex-wrap: wrap;
}

/* ─────────────────────────────────────────────────────────── */
/*  BACK TO TOP                                                */
/* ─────────────────────────────────────────────────────────── */
.back-to-top {
    position: fixed;
    bottom: 7.5rem;
    left: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--color-primary);
    box-shadow: var(--shadow-card);
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition:
        opacity 0.3s ease,
        transform 0.3s ease,
        background 0.8s ease,
        border-color 0.8s ease,
        box-shadow 0.8s ease;
    z-index: 800;
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--color-primary);
    color: #FFFFFF;
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

/* ─────────────────────────────────────────────────────────── */
/*  ANIMATIONS                                                 */
/* ─────────────────────────────────────────────────────────── */
@keyframes shimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.shimmer-text {
    background: linear-gradient(
        90deg,
        var(--color-primary) 0%,
        var(--color-accent-soft) 50%,
        var(--color-primary) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s linear infinite;
    transition: background 0.8s ease;
}

/* ─────────────────────────────────────────────────────────── */
/*  PAGE LOADER                                                */
/* ─────────────────────────────────────────────────────────── */
.page-loader {
    position: fixed;
    inset: 0;
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1.2rem;
    z-index: 9999;
    transition:
        opacity 0.6s ease,
        visibility 0.6s ease;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.page-loader__name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.8rem;
    font-weight: 500;
    color: var(--color-primary);
    letter-spacing: 0.08em;
    animation: loaderPulse 1.5s ease-in-out infinite;
    transition: color 0.8s ease;
}

.page-loader__bar {
    width: 120px;
    height: 1px;
    background: var(--color-border);
    position: relative;
    overflow: hidden;
    transition: background 0.8s ease;
}

.page-loader__bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--color-primary);
    animation: loaderBar 1.5s ease-in-out infinite;
    transition: background 0.8s ease;
}

@keyframes loaderPulse {
    0%, 100% { opacity: 0.6; }
    50%       { opacity: 1; }
}

@keyframes loaderBar {
    0%   { left: -100%; }
    100% { left: 100%;  }
}

/* ─────────────────────────────────────────────────────────── */
/*  PRINT OVERRIDE                                             */
/* ─────────────────────────────────────────────────────────── */
@media print {
    .navbar,
    .theme-switcher,
    .whatsapp-float,
    .back-to-top,
    .page-loader {
        display: none !important;
    }
}
