:root {
    --bg-primary: #000000;
        --bg-secondary: #000000;
        --text-primary: #e0e0e0;
        --text-secondary: #ffffff;
        --border-color: #000000;
        --chart-bg: #000000;
        --chart-bg-inner: #000000;
        --chart-text: #e0e0e0;
        --chart-border: #000000;
        --stats-bg: #000000;
        --input-bg: #000000;
        --input-border: #000000;
        --shadow: rgba(0,0,0,0.8);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #000000;
        --bg-secondary: #000000;
        --text-primary: #e0e0e0;
        --text-secondary: #ffffff;
        --border-color: #000000;
        --chart-bg: #000000;
        --chart-bg-inner: #000000;
        --chart-text: #e0e0e0;
        --chart-border: #000000;
        --stats-bg: #000000;
        --input-bg: #000000;
        --input-border: #000000;
        --shadow: rgba(0,0,0,0.8);
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    margin: 40px;
    margin-bottom: 0;
    padding-bottom: 0;
    transition: background-color 0.3s, color 0.3s;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.4s ease-out;
    overflow: visible;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* 3D 区块加载占位：主模型加载完成前显示，避免长时间空白 */
.section-3d-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(10, 10, 20, 0.95);
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    border-radius: 8px;
    pointer-events: none;
}
/* 主模型未出来前不显示 loading，延迟约 600ms 后才显示，避免一闪而过 */
.section-3d-loading.loading-delayed {
    opacity: 0;
    visibility: hidden;
}
.section-3d-loading.hidden {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.section-3d-loading::before {
    content: "";
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #2dd4bf;
    border-radius: 50%;
    animation: section-3d-spin 0.8s linear infinite;
}
@keyframes section-3d-spin {
    to { transform: rotate(360deg); }
}

/* Loading: 9 panels – Caloogy → Bar → RF → MCMC → Candle → Line → LSTM-XGBoost → CNN → Transformer, 18s */
/* Scale up: desktop base, then tablet/mobile via media queries */
.loading-chart-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    min-height: 132px;
    min-width: 280px;
    transform: scale(1.5);
    transform-origin: center center;
}
@media (max-width: 1024px) {
    .loading-chart-wrap { min-height: 120px; min-width: 260px; transform: scale(1.35); }
}
@media (max-width: 768px) {
    .loading-chart-wrap { min-height: 110px; min-width: 240px; transform: scale(1.2); }
}

.loading-panel {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

.loading-panel-caloogy { animation: loading-cycle-caloogy 18s ease-in-out infinite; }
.loading-panel-bar     { animation: loading-cycle-bar     18s ease-in-out infinite; }
.loading-panel-rf      { animation: loading-cycle-rf      18s ease-in-out infinite; }
.loading-panel-mcmc    { animation: loading-cycle-mcmc    18s ease-in-out infinite; }
.loading-panel-candle  { animation: loading-cycle-candle  18s ease-in-out infinite; }
.loading-panel-line    { animation: loading-cycle-line     18s ease-in-out infinite; }
.loading-panel-lstm    { animation: loading-cycle-lstm    18s ease-in-out infinite; }
.loading-panel-cnn     { animation: loading-cycle-cnn     18s ease-in-out infinite; }
.loading-panel-transformer { animation: loading-cycle-transformer 18s ease-in-out infinite; }

/* 9 panels: each ~11.1%, crossfade at boundaries */
@keyframes loading-cycle-caloogy {
    0% { opacity: 1; }
    9.5% { opacity: 1; }
    11% { opacity: 0.35; }
    11.11% { opacity: 0; }
    99% { opacity: 0; }
    100% { opacity: 1; }
}
@keyframes loading-cycle-bar {
    0% { opacity: 0; }
    10.8% { opacity: 0; }
    11.11% { opacity: 0.35; }
    12.5% { opacity: 1; }
    21% { opacity: 1; }
    22.22% { opacity: 0; }
    100% { opacity: 0; }
}
@keyframes loading-cycle-rf {
    0% { opacity: 0; }
    21% { opacity: 0; }
    22.22% { opacity: 0.35; }
    23.6% { opacity: 1; }
    32% { opacity: 1; }
    33.33% { opacity: 0; }
    100% { opacity: 0; }
}
@keyframes loading-cycle-mcmc {
    0% { opacity: 0; }
    32% { opacity: 0; }
    33.33% { opacity: 0.35; }
    34.7% { opacity: 1; }
    43% { opacity: 1; }
    44.44% { opacity: 0; }
    100% { opacity: 0; }
}
@keyframes loading-cycle-candle {
    0% { opacity: 0; }
    43% { opacity: 0; }
    44.44% { opacity: 0.35; }
    45.8% { opacity: 1; }
    54% { opacity: 1; }
    55.55% { opacity: 0; }
    100% { opacity: 0; }
}
@keyframes loading-cycle-line {
    0% { opacity: 0; }
    54% { opacity: 0; }
    55.55% { opacity: 0.35; }
    57% { opacity: 1; }
    65.5% { opacity: 1; }
    66.67% { opacity: 0; }
    100% { opacity: 0; }
}
@keyframes loading-cycle-lstm {
    0% { opacity: 0; }
    65.5% { opacity: 0; }
    66.67% { opacity: 0.35; }
    68% { opacity: 1; }
    76.5% { opacity: 1; }
    77.78% { opacity: 0; }
    100% { opacity: 0; }
}
@keyframes loading-cycle-cnn {
    0% { opacity: 0; }
    76.5% { opacity: 0; }
    77.78% { opacity: 0.35; }
    79% { opacity: 1; }
    87.5% { opacity: 1; }
    88.89% { opacity: 0; }
    100% { opacity: 0; }
}
@keyframes loading-cycle-transformer {
    0% { opacity: 0; }
    87.5% { opacity: 0; }
    88.89% { opacity: 0.35; }
    90% { opacity: 1; }
    98% { opacity: 1; }
    99% { opacity: 0.35; }
    100% { opacity: 0; }
}

.loading-chart-svg {
    width: 280px;
    height: 80px;
    display: block;
}

.loading-candle-svg,
.loading-bar-svg,
.loading-mcmc-svg,
.loading-rf-svg {
    width: 260px;
}
@media (max-width: 1024px) {
    .loading-chart-svg { width: 260px; height: 74px; }
    .loading-candle-svg, .loading-bar-svg, .loading-mcmc-svg, .loading-rf-svg { width: 240px; }
}
@media (max-width: 768px) {
    .loading-chart-svg { width: 240px; height: 68px; }
    .loading-candle-svg, .loading-bar-svg, .loading-mcmc-svg, .loading-rf-svg { width: 220px; }
}

.loading-grid {
    stroke: rgba(255, 255, 255, 0.06);
    stroke-width: 0.5;
}

.loading-axis {
    stroke: rgba(255, 255, 255, 0.12);
    stroke-width: 0.8;
}

/* 3D wrapper for RF, MCMC, Candle, Line panels */
.loading-panel-3d {
    perspective: 520px;
    transform-style: preserve-3d;
    transform: rotateX(14deg) rotateY(-1deg);
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.35));
    animation: loading-panel-3d-float 4s ease-in-out infinite;
}
@keyframes loading-panel-3d-float {
    0%, 100% { transform: rotateX(14deg) rotateY(-1deg); }
    50% { transform: rotateX(12deg) rotateY(1deg); }
}

/* Panel 1: stepped line */
.loading-step-line {
    fill: none;
    stroke: url(#loading-line-gradient);
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: loading-draw-step 2.2s ease-in-out infinite;
}

@keyframes loading-draw-step {
    0% { stroke-dashoffset: 1; }
    70% { stroke-dashoffset: 0; }
    82% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: 1; }
}

/* Panel 2: dense candlestick – time-series growth + sweep line */
.loading-candle {
    opacity: 0;
    transform-origin: center;
    animation: loading-candle-grow 2.8s ease-out infinite;
    animation-delay: calc(0.08s * var(--i, 0));
}

.loading-candle .loading-wick {
    stroke: rgba(255, 255, 255, 0.35);
    stroke-width: 0.8;
    stroke-linecap: round;
}

.loading-candle .loading-candle-body.up {
    fill: url(#loading-candle-up);
}

.loading-candle .loading-candle-body.down {
    fill: url(#loading-candle-down);
}

.loading-sweep-wrap {
    animation: loading-sweep-move 2.2s ease-in-out infinite;
}

.loading-sweep {
    stroke: rgba(20, 184, 166, 0.7);
    stroke-width: 0.5;
    stroke-dasharray: 2 2;
}

@keyframes loading-sweep-move {
    0% { transform: translateX(0); opacity: 0.8; }
    80% { transform: translateX(220px); opacity: 1; }
    100% { transform: translateX(240px); opacity: 0.8; }
}

@keyframes loading-candle-grow {
    0% { opacity: 0; transform: scaleY(0.4); }
    12% { opacity: 1; transform: scaleY(1); }
    78% { opacity: 1; transform: scaleY(1); }
    100% { opacity: 0; transform: scaleY(0.4); }
}

/* Panel 3: bar chart – bars grow from bottom in sequence */
.loading-bar {
    fill: url(#loading-bar-gradient);
    transform-origin: 50% 100%;
    transform-box: fill-box;
    animation: loading-bar-grow 2.4s ease-out infinite;
    animation-delay: calc(0.14s * var(--i, 0));
}

@keyframes loading-bar-grow {
    0% { opacity: 0; transform: scaleY(0); }
    15% { opacity: 1; transform: scaleY(1); }
    75% { opacity: 1; transform: scaleY(1); }
    100% { opacity: 0; transform: scaleY(0); }
}

/* Panel 4: MCMC – chain samples appear along path, path draws */
.loading-mcmc-target {
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
}

.loading-mcmc-path {
    fill: none;
    stroke: url(#loading-mcmc-dot);
    stroke-width: 1.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    opacity: 0.5;
    animation: loading-mcmc-path-draw 2.4s ease-out infinite;
}

.loading-mcmc-dot {
    fill: url(#loading-mcmc-dot);
    transform-origin: center;
    opacity: 0;
    animation: loading-mcmc-dot-appear 2.4s ease-out infinite;
    animation-delay: calc(0.2s * var(--i, 0));
}

@keyframes loading-mcmc-path-draw {
    0% { stroke-dashoffset: 1; }
    70% { stroke-dashoffset: 0; }
    85% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: 1; }
}

@keyframes loading-mcmc-dot-appear {
    0% { opacity: 0; transform: scale(0.3); }
    15% { opacity: 1; transform: scale(1); }
    75% { opacity: 0.9; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.3); }
}

/* Panel 5: Random forest – tree branches draw root to leaves, nodes light up */
.loading-rf-branch {
    fill: none;
    stroke: url(#loading-rf-branch);
    stroke-width: 1.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: loading-rf-draw 2.2s ease-out infinite;
    animation-delay: calc(0.12s * var(--i, 0));
}

.loading-rf-node {
    fill: url(#loading-rf-node-fill);
    transform-origin: center;
    opacity: 0;
    animation: loading-rf-node-appear 2.2s ease-out infinite;
    animation-delay: calc(0.1s * var(--i, 0));
}

@keyframes loading-rf-draw {
    0% { stroke-dashoffset: 1; }
    25% { stroke-dashoffset: 0; }
    80% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: 1; }
}

@keyframes loading-rf-node-appear {
    0% { opacity: 0; transform: scale(0.5); }
    20% { opacity: 1; transform: scale(1); }
    75% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.5); }
}

/* Panel 6: Caloogy – Google-style colored letters, staggered glow */
.loading-caloogy-letters {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 42px;
    font-weight: 700;
    letter-spacing: 1px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
@media (max-width: 1024px) {
    .loading-caloogy-letters { font-size: 38px; }
}
@media (max-width: 768px) {
    .loading-caloogy-letters { font-size: 34px; }
}

.loading-caloogy-char {
    color: var(--c);
    opacity: 0;
    transform: scale(0.6);
    animation: loading-caloogy-char 2.5s ease-out infinite;
    animation-delay: calc(0.08s * var(--i, 0));
    text-shadow: 0 0 14px var(--c), 0 0 24px rgba(255,255,255,0.15);
}

@keyframes loading-caloogy-char {
    0% { opacity: 0; transform: scale(0.6); }
    15% { opacity: 1; transform: scale(1.05); }
    25% { opacity: 1; transform: scale(1); }
    75% { opacity: 1; transform: scale(1); }
    90% { opacity: 0.9; transform: scale(1.02); }
    100% { opacity: 0; transform: scale(0.6); }
}

/* ========== 3D panels (LSTM-XGBoost, CNN, Transformer) ========== */
.loading-3d-scene {
    width: 280px;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
}
@media (max-width: 1024px) {
    .loading-3d-scene { width: 260px; height: 82px; }
}
@media (max-width: 768px) {
    .loading-3d-scene { width: 240px; height: 76px; }
}

.loading-3d-box {
    transform-style: preserve-3d;
    animation: loading-3d-float 3s ease-in-out infinite;
}

@keyframes loading-3d-float {
    0%, 100% { transform: rotateY(-2deg) rotateX(4deg); }
    50% { transform: rotateY(2deg) rotateX(-4deg); }
}

/* Panel 7: LSTM-XGBoost 3D */
.loading-lstm-xgb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
}

.loading-lstm-chain {
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
}

.loading-lstm-cell {
    width: 18px;
    height: 22px;
    background: linear-gradient(145deg, #0f766e 0%, #14b8a6 50%, #0d9488 100%);
    border-radius: 3px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.15);
    transform: rotateY(-12deg) translateZ(0);
    opacity: 0;
    animation: loading-lstm-cell 2.2s ease-out infinite;
    animation-delay: calc(0.18s * var(--i, 0));
}

.loading-lstm-recur {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(20,184,166,0.6), transparent);
    border-radius: 1px;
    opacity: 0;
    animation: loading-lstm-recur 2.2s ease-out infinite 0.8s;
}

@keyframes loading-lstm-cell {
    0% { opacity: 0; transform: rotateY(-12deg) scale(0.6); }
    18% { opacity: 1; transform: rotateY(-12deg) scale(1); }
    75% { opacity: 1; transform: rotateY(-12deg) scale(1); }
    100% { opacity: 0; transform: rotateY(-12deg) scale(0.6); }
}

@keyframes loading-lstm-recur {
    0%, 30% { opacity: 0; }
    40% { opacity: 0.7; }
    70% { opacity: 0.7; }
    100% { opacity: 0; }
}

.loading-xgb-trees {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.loading-xgb-tree {
    width: 24px;
    height: 28px;
    background: linear-gradient(160deg, #134e4a 0%, #0d9488 40%, #2dd4bf 100%);
    border-radius: 2px 2px 0 0;
    box-shadow: 0 3px 8px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.2);
    transform: rotateX(25deg) rotateY(5deg) translateZ(4px);
    transform-origin: bottom center;
    opacity: 0;
    animation: loading-xgb-tree 2.2s ease-out infinite;
    animation-delay: calc(0.35s * var(--i, 0));
}

@keyframes loading-xgb-tree {
    0% { opacity: 0; transform: rotateX(25deg) rotateY(5deg) translateZ(4px) scaleY(0); }
    25% { opacity: 1; transform: rotateX(25deg) rotateY(5deg) translateZ(4px) scaleY(1); }
    75% { opacity: 1; transform: rotateX(25deg) rotateY(5deg) translateZ(4px) scaleY(1); }
    100% { opacity: 0; transform: rotateX(25deg) rotateY(5deg) translateZ(4px) scaleY(0); }
}

/* Panel 8: CNN 3D – 8 convolutional layers + sliding kernel (pink) */
.loading-cnn-stack {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    position: relative;
    width: 260px;
    height: 64px;
}

.loading-cnn-layer {
    position: relative;
    width: 28px;
    height: 32px;
    background: linear-gradient(165deg, #9d174d 0%, #ec4899 40%, #f472b6 70%, rgba(244,114,182,0.4) 100%);
    border: 1px solid rgba(236,72,153,0.5);
    border-radius: 3px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.4), inset 0 0 16px rgba(244,114,182,0.2);
    transform: rotateX(20deg) rotateY(-10deg) translateZ(0);
    opacity: 0;
    animation: loading-cnn-layer 2.2s ease-out infinite;
    animation-delay: calc(0.18s * var(--i, 0));
}
.loading-cnn-layer:nth-child(2) { transform: rotateX(20deg) rotateY(-7deg) translateZ(6px); }
.loading-cnn-layer:nth-child(3) { transform: rotateX(20deg) rotateY(-4deg) translateZ(12px); }
.loading-cnn-layer:nth-child(4) { transform: rotateX(20deg) rotateY(-1deg) translateZ(18px); }
.loading-cnn-layer:nth-child(5) { transform: rotateX(20deg) rotateY(2deg) translateZ(24px); }
.loading-cnn-layer:nth-child(6) { transform: rotateX(20deg) rotateY(5deg) translateZ(30px); }
.loading-cnn-layer:nth-child(7) { transform: rotateX(20deg) rotateY(8deg) translateZ(36px); }
.loading-cnn-layer:nth-child(8) { transform: rotateX(20deg) rotateY(11deg) translateZ(42px); }

.loading-cnn-layer::before {
    content: '';
    position: absolute;
    inset: 3px;
    background-image: linear-gradient(rgba(255,255,255,0.12) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,0.12) 1px, transparent 1px);
    background-size: 5px 5px;
    border-radius: 2px;
    pointer-events: none;
}

.loading-cnn-kernel {
    position: absolute;
    width: 12px;
    height: 12px;
    left: 12%;
    top: 50%;
    margin-top: -6px;
    background: linear-gradient(145deg, #ec4899, #be185d);
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(236,72,153,0.6);
    transform: rotateX(20deg) translateZ(24px);
    animation: loading-cnn-kernel 2s ease-in-out infinite;
}

@keyframes loading-cnn-layer {
    0% { opacity: 0; }
    22% { opacity: 1; }
    75% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes loading-cnn-kernel {
    0%, 100% { left: 15%; opacity: 0.9; }
    50% { left: 75%; opacity: 1; }
}

/* Panel 9: Transformer 3D – multi-head attention */
.loading-transformer-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.loading-attn-heads {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
    max-width: 320px;
}

.loading-attn-head {
    width: 18px;
    height: 18px;
    background: linear-gradient(145deg, #0f766e 0%, #14b8a6 50%, #2dd4bf 100%);
    border-radius: 4px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.4), 0 0 12px rgba(20,184,166,0.3);
    transform: rotateX(15deg) rotateY(-10deg) translateZ(0);
    opacity: 0;
    animation: loading-attn-head 2s ease-out infinite;
    animation-delay: calc(0.1s * var(--i, 0));
}
.loading-attn-head:nth-child(2) { transform: rotateX(15deg) rotateY(-7deg) translateZ(2px); }
.loading-attn-head:nth-child(3) { transform: rotateX(15deg) rotateY(-4deg) translateZ(4px); }
.loading-attn-head:nth-child(4) { transform: rotateX(15deg) rotateY(-1deg) translateZ(6px); }
.loading-attn-head:nth-child(5) { transform: rotateX(15deg) rotateY(2deg) translateZ(8px); }
.loading-attn-head:nth-child(6) { transform: rotateX(15deg) rotateY(5deg) translateZ(10px); }
.loading-attn-head:nth-child(7) { transform: rotateX(15deg) rotateY(8deg) translateZ(12px); }
.loading-attn-head:nth-child(8) { transform: rotateX(15deg) rotateY(11deg) translateZ(14px); }
.loading-attn-head:nth-child(9) { transform: rotateX(15deg) rotateY(14deg) translateZ(16px); }
.loading-attn-head:nth-child(10) { transform: rotateX(15deg) rotateY(17deg) translateZ(18px); }
.loading-attn-head:nth-child(11) { transform: rotateX(15deg) rotateY(20deg) translateZ(20px); }
.loading-attn-head:nth-child(12) { transform: rotateX(15deg) rotateY(23deg) translateZ(22px); }

.loading-transformer-flow {
    width: 180px;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(20,184,166,0.7), transparent);
    border-radius: 2px;
    transform: rotateX(15deg) translateZ(-5px);
    opacity: 0;
    animation: loading-transformer-flow 2s ease-out infinite 0.5s;
}

@keyframes loading-attn-head {
    0% { opacity: 0; transform: rotateX(15deg) rotateY(-10deg) translateZ(0) scale(0.4); }
    20% { opacity: 1; transform: rotateX(15deg) rotateY(-10deg) translateZ(0) scale(1); }
    70% { opacity: 1; }
    100% { opacity: 0; transform: rotateX(15deg) rotateY(-10deg) translateZ(0) scale(0.4); }
}
.loading-attn-head:nth-child(2) { animation: loading-attn-head-2 2s ease-out infinite 0.08s; }
.loading-attn-head:nth-child(3) { animation: loading-attn-head-3 2s ease-out infinite 0.16s; }
.loading-attn-head:nth-child(4) { animation: loading-attn-head-4 2s ease-out infinite 0.24s; }
.loading-attn-head:nth-child(5) { animation: loading-attn-head-5 2s ease-out infinite 0.32s; }
.loading-attn-head:nth-child(6) { animation: loading-attn-head-6 2s ease-out infinite 0.40s; }
.loading-attn-head:nth-child(7) { animation: loading-attn-head-7 2s ease-out infinite 0.48s; }
.loading-attn-head:nth-child(8) { animation: loading-attn-head-8 2s ease-out infinite 0.56s; }
.loading-attn-head:nth-child(9) { animation: loading-attn-head-9 2s ease-out infinite 0.64s; }
.loading-attn-head:nth-child(10) { animation: loading-attn-head-10 2s ease-out infinite 0.72s; }
.loading-attn-head:nth-child(11) { animation: loading-attn-head-11 2s ease-out infinite 0.80s; }
.loading-attn-head:nth-child(12) { animation: loading-attn-head-12 2s ease-out infinite 0.88s; }
@keyframes loading-attn-head-2 { 0% { opacity: 0; transform: rotateX(15deg) rotateY(-7deg) translateZ(2px) scale(0.4); } 20% { opacity: 1; transform: rotateX(15deg) rotateY(-7deg) translateZ(2px) scale(1); } 70% { opacity: 1; } 100% { opacity: 0; transform: rotateX(15deg) rotateY(-7deg) translateZ(2px) scale(0.4); } }
@keyframes loading-attn-head-3 { 0% { opacity: 0; transform: rotateX(15deg) rotateY(-4deg) translateZ(4px) scale(0.4); } 20% { opacity: 1; transform: rotateX(15deg) rotateY(-4deg) translateZ(4px) scale(1); } 70% { opacity: 1; } 100% { opacity: 0; transform: rotateX(15deg) rotateY(-4deg) translateZ(4px) scale(0.4); } }
@keyframes loading-attn-head-4 { 0% { opacity: 0; transform: rotateX(15deg) rotateY(-1deg) translateZ(6px) scale(0.4); } 20% { opacity: 1; transform: rotateX(15deg) rotateY(-1deg) translateZ(6px) scale(1); } 70% { opacity: 1; } 100% { opacity: 0; transform: rotateX(15deg) rotateY(-1deg) translateZ(6px) scale(0.4); } }
@keyframes loading-attn-head-5 { 0% { opacity: 0; transform: rotateX(15deg) rotateY(2deg) translateZ(8px) scale(0.4); } 20% { opacity: 1; transform: rotateX(15deg) rotateY(2deg) translateZ(8px) scale(1); } 70% { opacity: 1; } 100% { opacity: 0; transform: rotateX(15deg) rotateY(2deg) translateZ(8px) scale(0.4); } }
@keyframes loading-attn-head-6 { 0% { opacity: 0; transform: rotateX(15deg) rotateY(5deg) translateZ(10px) scale(0.4); } 20% { opacity: 1; transform: rotateX(15deg) rotateY(5deg) translateZ(10px) scale(1); } 70% { opacity: 1; } 100% { opacity: 0; transform: rotateX(15deg) rotateY(5deg) translateZ(10px) scale(0.4); } }
@keyframes loading-attn-head-7 { 0% { opacity: 0; transform: rotateX(15deg) rotateY(8deg) translateZ(12px) scale(0.4); } 20% { opacity: 1; transform: rotateX(15deg) rotateY(8deg) translateZ(12px) scale(1); } 70% { opacity: 1; } 100% { opacity: 0; transform: rotateX(15deg) rotateY(8deg) translateZ(12px) scale(0.4); } }
@keyframes loading-attn-head-8 { 0% { opacity: 0; transform: rotateX(15deg) rotateY(11deg) translateZ(14px) scale(0.4); } 20% { opacity: 1; transform: rotateX(15deg) rotateY(11deg) translateZ(14px) scale(1); } 70% { opacity: 1; } 100% { opacity: 0; transform: rotateX(15deg) rotateY(11deg) translateZ(14px) scale(0.4); } }
@keyframes loading-attn-head-9 { 0% { opacity: 0; transform: rotateX(15deg) rotateY(14deg) translateZ(16px) scale(0.4); } 20% { opacity: 1; transform: rotateX(15deg) rotateY(14deg) translateZ(16px) scale(1); } 70% { opacity: 1; } 100% { opacity: 0; transform: rotateX(15deg) rotateY(14deg) translateZ(16px) scale(0.4); } }
@keyframes loading-attn-head-10 { 0% { opacity: 0; transform: rotateX(15deg) rotateY(17deg) translateZ(18px) scale(0.4); } 20% { opacity: 1; transform: rotateX(15deg) rotateY(17deg) translateZ(18px) scale(1); } 70% { opacity: 1; } 100% { opacity: 0; transform: rotateX(15deg) rotateY(17deg) translateZ(18px) scale(0.4); } }
@keyframes loading-attn-head-11 { 0% { opacity: 0; transform: rotateX(15deg) rotateY(20deg) translateZ(20px) scale(0.4); } 20% { opacity: 1; transform: rotateX(15deg) rotateY(20deg) translateZ(20px) scale(1); } 70% { opacity: 1; } 100% { opacity: 0; transform: rotateX(15deg) rotateY(20deg) translateZ(20px) scale(0.4); } }
@keyframes loading-attn-head-12 { 0% { opacity: 0; transform: rotateX(15deg) rotateY(23deg) translateZ(22px) scale(0.4); } 20% { opacity: 1; transform: rotateX(15deg) rotateY(23deg) translateZ(22px) scale(1); } 70% { opacity: 1; } 100% { opacity: 0; transform: rotateX(15deg) rotateY(23deg) translateZ(22px) scale(0.4); } }

@keyframes loading-transformer-flow {
    0%, 25% { opacity: 0; }
    35% { opacity: 0.8; }
    75% { opacity: 0.8; }
    100% { opacity: 0; }
}

.loading-text {
    margin-top: 88px;
    font-size: 16px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 2px;
    text-transform: uppercase;
    font-variant-numeric: tabular-nums;
    animation: loading-text-pulse 2s ease-in-out infinite;
}
@media (max-width: 1024px) {
    .loading-text { margin-top: 80px; font-size: 15px; }
}
@media (max-width: 768px) {
    .loading-text { margin-top: 72px; font-size: 14px; }
}

@keyframes loading-text-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

h1 {
    margin-bottom: 30px;
    color: var(--text-primary);
}

/* Chart container styles */
.chart-container {
    background: var(--chart-bg);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 10px var(--shadow);
}

/* Stats cards */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--stats-bg);
    border-radius: 8px;
    padding: 16px;
    border: 1px solid var(--chart-border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--chart-text);
    margin-bottom: 4px;
}

.stat-value.positive {
    color: #26a69a;
}

.stat-value.negative {
    color: #ef5350;
}

.stat-secondary {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-asset {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
    font-weight: 500;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
}

.stat-change.positive {
    background: rgba(38, 166, 154, 0.15);
    color: #26a69a;
}

.stat-change.negative {
    background: rgba(239, 83, 80, 0.15);
    color: #ef5350;
}

.data-quality-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-quality-badge.okx {
    background: rgba(38, 166, 154, 0.15);
    color: #26a69a;
}

.data-quality-badge.mixed {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
}

.data-quality-badge.kraken {
    background: rgba(33, 150, 243, 0.15);
    color: #2196f3;
}

.chart-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-group label {
    color: var(--chart-text);
    font-size: 14px;
    font-weight: 500;
}

.control-group select {
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--chart-text);
    font-size: 14px;
    cursor: pointer;
    min-width: 120px;
    transition: border-color 0.2s;
}

.control-group select:hover {
    border-color: #555;
}

.control-group select:focus {
    outline: none;
    border-color: #26a69a;
}

.refresh-btn {
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid #ff9900;
    background: #ff9900;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.refresh-btn:hover {
    background: #f5b616;
    border-color: #f5b616;
}

.refresh-btn:active {
    transform: scale(0.98);
}

/* Tools Panel (Below Chart) */
.tools-panel {
    margin-top: 20px;
    padding: 20px;
    background: #000000;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow);
    border: 1px solid var(--border-color);
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.tools-section {
    flex: 1;
    min-width: 250px;
}

.tools-header {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
}

.tools-title {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.tools-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tools-divider {
    width: 1px;
    background: var(--border-color);
    margin: 0 10px;
}

.tool-btn {
    padding: 8px 14px;
    border-radius: 6px;
    border: 1.5px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tool-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.tool-btn.indicator-btn:hover {
    border-color: #26a69a;
    background: rgba(38, 166, 154, 0.08);
    color: #26a69a;
}

.tool-btn.indicator-btn.active {
    background: linear-gradient(135deg, #26a69a 0%, #2bbbad 100%);
    border-color: #26a69a;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.tool-btn.drawing-btn:hover {
    border-color: #ffc107;
    background: rgba(255, 193, 7, 0.08);
    color: #ffc107;
}

.tool-btn.drawing-btn.active {
    background: linear-gradient(135deg, #ffc107 0%, #ffb300 100%);
    border-color: #ffc107;
    color: #000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.tool-btn.clear-btn:hover {
    border-color: #ef5350;
    background: rgba(239, 83, 80, 0.08);
    color: #ef5350;
}

/* Quantitative Data Section */
.quant-data-section {
    margin-top: 30px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow);
}

.section-title {
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.data-tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 20px;
}

.data-table-card {
    background: var(--chart-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: transform 0.2s;
}

.data-table-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.table-card-header {
    background: var(--stats-bg);
    color: var(--chart-text);
    padding: 12px 16px;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
}

.table-container {
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
    color: var(--chart-text);
}

.table-container table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.table-container th {
    background: var(--stats-bg);
    color: var(--chart-text);
    padding: 8px;
    text-align: left;
    font-weight: 600;
    position: sticky;
    top: 0;
    border-bottom: 2px solid var(--border-color);
}

.table-container td {
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
    color: var(--chart-text);
}

.table-container tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.value-positive {
    color: #26a69a;
    font-weight: 500;
}

.value-negative {
    color: #ef5350;
    font-weight: 500;
}

.value-neutral {
    color: var(--text-secondary);
}

/* Chart wrapper with asset list panel */
.chart-wrapper {
    display: flex;
    gap: 12px;
    position: relative;
    width: 100%;
}

.chart-plot {
    flex: 1;
    min-width: 0; /* Allow flex item to shrink below content size */
    height: 600px;
    background: var(--chart-bg-inner);
    border-radius: 4px;
}

/* Asset List Panel */
.asset-list-panel {
    width: 200px;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 2px 8px var(--shadow);
    max-height: 600px;
    overflow-y: auto;
    flex-shrink: 0;
}

.asset-list-header {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.asset-list-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.asset-list-loading {
    color: var(--text-secondary);
    text-align: center;
    padding: 20px;
    font-size: 12px;
}

.asset-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: var(--input-bg);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.asset-item:hover {
    background: var(--chart-bg);
    border-color: var(--border-color);
    transform: translateX(-2px);
}

.asset-item.active {
    background: var(--chart-bg);
    border-color: #26a69a;
    box-shadow: 0 0 8px rgba(38, 166, 154, 0.3);
}

.asset-symbol {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
}

.asset-price {
    font-size: 13px;
    font-weight: 700;
    animation: assetPriceBreathe 3s ease-in-out infinite;
    white-space: nowrap;
    color: var(--text-primary); /* White color for all asset prices */
}

.asset-price.price-up {
    color: #26a69a;
}

.asset-price.price-down {
    color: #ef5350;
}

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

/* Caloogy AI Main Section */
.caloogy-ai-main-section {
    margin: 30px 0;
    padding: 30px;
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--shadow);
    border: 1px solid var(--border-color);
}

.caloogy-ai-title-wrap {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 0 10px 0;
    pointer-events: none;
    transform-origin: center center;
    will-change: transform;
    backface-visibility: hidden;
}

.caloogy-ai-title {
    color: #ffffff;
    font-size: 96px;
    font-weight: 300;
    font-family: 'Georgia', 'Times New Roman', serif;
    letter-spacing: 2px;
    margin: 0;
    text-align: center;
    opacity: 0;
    animation: titleFadeIn 1.2s ease-out forwards;
    transform: translateZ(0) scale(var(--caloogy-ai-title-scale, 1));
    transform-origin: center center;
    will-change: transform;
    backface-visibility: hidden;
}

.caloogy-ai-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 18px;
    font-weight: 300;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 1px;
    margin: 0 0 40px 0;
    text-align: center;
    text-transform: none;
    opacity: 0;
    animation: subtitleFadeIn 1.5s ease-out 0.3s forwards;
}

@keyframes subtitleFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 0.6;
        transform: translateY(0);
    }
}

@keyframes titleFadeIn {
    0% {
        opacity: 0;
    }
    60% {
        opacity: 1;
    }
    100% {
        opacity: 1;
    }
}

.caloogy-ai-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.caloogy-ai-input-wrapper {
    position: relative;
    opacity: 0;
    transform: translateY(20px) scale(0.98);
    transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.caloogy-ai-input-wrapper.scroll-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.caloogy-ai-input-container {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(42, 42, 42, 0.6);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 24px;
    padding: 16px 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.caloogy-ai-input-container:focus-within {
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1), 
                0 8px 24px rgba(0, 0, 0, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    background: rgba(42, 42, 42, 0.7);
}

.caloogy-ai-main-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 16px;
    padding: 0;
    margin: 0;
    width: 100%;
}

.caloogy-ai-main-input::placeholder {
    color: transparent;
}

.caloogy-ai-suggestions {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #888888;
    font-size: 16px;
    pointer-events: none;
    transition: opacity 0.3s, visibility 0.3s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 60px);
    visibility: visible;
}

.caloogy-ai-send-btn {
    background: #ffffff;
    border: 1px solid #ffffff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #000000;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-left: 16px;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.2);
}

.caloogy-ai-send-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.caloogy-ai-send-btn:active {
    transform: scale(0.95);
}

.caloogy-ai-send-btn:disabled {
    background: #555555;
    border-color: #555555;
    cursor: not-allowed;
    opacity: 0.4;
}

.caloogy-ai-response {
    max-height: 400px;
    background: linear-gradient(135deg, #1a1a1a 0%, #252525 100%);
    border-radius: 20px;
    border: 1px solid linear-gradient(135deg, #1a1a1a 0%, #252525 100%);
    display: none;
    flex-direction: column;
    box-shadow: inset 0 2px 8px linear-gradient(135deg, #1a1a1a 0%, #252525 100%);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.caloogy-ai-response.has-messages {
    display: flex;
    opacity: 1;
    transform: translateY(0);
    animation: responseFadeIn 0.5s ease-out forwards;
}

.caloogy-ai-response-header {
    padding: 16px 24px 12px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.caloogy-ai-clear-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 6px 16px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.caloogy-ai-clear-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.caloogy-ai-clear-btn:active {
    transform: translateY(0);
}

.caloogy-ai-messages-container {
    max-height: 320px;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

/* Custom scrollbar for modern look */
.caloogy-ai-messages-container::-webkit-scrollbar {
    width: 8px;
}

.caloogy-ai-messages-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.caloogy-ai-messages-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    transition: background 0.3s;
}

.caloogy-ai-messages-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.caloogy-ai-message {
    padding: 16px 20px;
    border-radius: 16px;
    animation: fadeIn 0.4s ease-out;
    backdrop-filter: blur(10px);
}

.caloogy-ai-message.user-message {
    background: #2482a1;
    border: 1px solid rgba(255, 255, 255, 0.2);
    align-self: flex-end;
    max-width: 80%;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
}

.caloogy-ai-message.ai-message {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    align-self: flex-start;
    max-width: 90%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.caloogy-ai-message-content {
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    line-height: 1.8;
    letter-spacing: 0.3px;
}

.caloogy-ai-message-content strong {
    color: #ffffff;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.caloogy-ai-loading-dots {
    display: inline-flex;
    gap: 4px;
    margin-left: 8px;
}

.caloogy-ai-loading-dots span {
    width: 8px;
    height: 8px;
    background: #ffffff;
    border-radius: 50%;
    animation: loadingDot 1.4s infinite ease-in-out;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.caloogy-ai-loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.caloogy-ai-loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes loadingDot {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

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

/* Media Sections - Common Styles */
.video-section,
.image-section,
.video-section-2 {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    height: 100vh;
    min-height: 800px;
    margin-top: 0;
    margin-bottom: 0;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* First media section has top margin */
.caloogy-ai-main-section + .video-section,
.caloogy-ai-main-section + .image-section {
    margin-top: 60px;
}

/* Remove margin between adjacent media sections */
.video-section + .image-section,
.video-section + .video-section-2,
.image-section + .video-section,
.image-section + .video-section-2,
.video-section-2 + .video-section,
.video-section-2 + .image-section {
    margin-top: 0;
}

/* Cross → Video：顶部渐变与 Cross 底部同色，过渡丝滑 */
.cross-section + .video-section-2 {
    position: relative;
}
.cross-section + .video-section-2::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 35%;
    background: linear-gradient(180deg, #5eb8e8 0%, rgba(94, 184, 232, 0.4) 40%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}

/* Last media section has bottom margin */
.video-section-2:last-of-type {
    margin-bottom: 60px;
}

.video-section.media-visible,
.image-section.media-visible,
.video-section-2.media-visible {
    opacity: 1;
    transform: scale(1);
}

.video-container,
.image-container,
.video-container-2 {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.chaos-video,
.sea-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: translate(0, 0);
    opacity: 0;
    transition: opacity 0.1s ease-out,
                transform 0.1s ease-out,
                filter 0.1s ease-out;
    z-index: 1;
    will-change: transform, opacity, filter;
    backface-visibility: hidden;
}

.bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: translate(0, 0);
    opacity: 0;
    transition: opacity 0.1s ease-out,
                transform 0.1s ease-out,
                filter 0.1s ease-out;
    z-index: 1;
    will-change: transform, opacity, filter;
    backface-visibility: hidden;
}

.video-overlay,
.image-overlay,
.video-overlay-2 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2;
    pointer-events: none;
}

.video-text,
.image-text,
.video-text-2 {
    color: #ffffff;
    font-family: 'Georgia', 'Times New Roman', 'Playfair Display', serif;
    font-weight: 300;
    font-size: 72px;
    letter-spacing: 4px;
    text-align: center;
    text-transform: uppercase;
    opacity: 0;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) translateY(50px) scale(0.9);
    transition: opacity 0.1s ease-out,
                transform 0.1s ease-out;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8),
                 0 2px 10px rgba(0, 0, 0, 0.6),
                 0 0 40px rgba(255, 255, 255, 0.3),
                 0 0 60px rgba(255, 255, 255, 0.2);
    white-space: nowrap;
    will-change: transform, opacity, filter;
    filter: blur(0px);
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

.video-text.text-visible,
.image-text.text-visible,
.video-text-2.text-visible {
    opacity: 1;
    transform: translate(-50%, -50%) translateY(0) scale(1);
}

.video-text-top,
.image-text-top {
    font-size: 80px;
    letter-spacing: 6px;
    margin-top: -60px;
}

.video-text-bottom,
.image-text-bottom {
    font-size: 64px;
    letter-spacing: 5px;
    margin-top: 60px;
}

.video-text-single {
    font-size: 80px;
    letter-spacing: 6px;
    margin-top: 0;
}

/* Responsive media text */
@media (max-width: 1024px) {
    .video-text-top,
    .image-text-top {
        font-size: 56px;
        letter-spacing: 4px;
    }
    
    .video-text-bottom,
    .image-text-bottom {
        font-size: 44px;
        letter-spacing: 3px;
    }
    
    .video-text-single {
        font-size: 56px;
        letter-spacing: 4px;
    }
}

@media (max-width: 768px) {
    .video-section,
    .image-section,
    .video-section-2 {
        height: 70vh;
        min-height: 600px;
        margin-top: 0;
        margin-bottom: 0;
    }
    
    .video-section:first-of-type {
        margin-top: 40px;
    }
    
    .video-section-2:last-of-type,
    .image-section:last-of-type {
        margin-bottom: 40px;
    }
    
    .video-text-top,
    .image-text-top {
        font-size: 36px;
        letter-spacing: 2px;
        margin-bottom: 30px;
    }
    
    .video-text-bottom,
    .image-text-bottom {
        font-size: 28px;
        letter-spacing: 2px;
    }
    
    .video-text-single {
        font-size: 36px;
        letter-spacing: 2px;
    }
    
    .video-text,
    .image-text,
    .video-text-2 {
        padding: 0 20px;
        white-space: normal;
        line-height: 1.3;
    }
}

@media (max-width: 480px) {
    .video-section,
    .image-section,
    .video-section-2 {
        height: 60vh;
        min-height: 500px;
        margin-top: 0;
        margin-bottom: 0;
    }
    
    .video-section:first-of-type {
        margin-top: 30px;
    }
    
    .video-section-2:last-of-type,
    .image-section:last-of-type {
        margin-bottom: 30px;
    }
    
    .video-text-top,
    .image-text-top {
        font-size: 28px;
        letter-spacing: 1px;
        margin-bottom: 20px;
    }
    
    .video-text-bottom,
    .image-text-bottom {
        font-size: 22px;
        letter-spacing: 1px;
    }
    
    .video-text-single {
        font-size: 28px;
        letter-spacing: 1px;
    }
}

.expander {
    background: var(--bg-secondary);
    border-radius: 6px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px var(--shadow);
}

.expander-header {
    padding: 12px 16px;
    font-weight: bold;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.expander-body {
    display: none;
    padding: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th, td {
    border: 1px solid var(--border-color);
    padding: 6px;
    text-align: center;
    color: var(--text-primary);
}

th {
    background: var(--bg-primary);
    font-weight: 600;
}

/* Stats below chart - hidden on desktop */
.stats-below-chart {
    display: none;
}

/* Tablet responsive design (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    body {
        margin: 30px;
    }
    
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .chart-plot {
        height: 550px;
    }
    
    .chart-wrapper {
        flex-direction: column;
        gap: 15px;
    }
    
    .asset-list-panel {
        width: 100%;
        max-height: 400px;
    }
    
    /* Stats layout for tablet: show only Current Price and Last Update above chart */
    .stats-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    /* Hide 24h Change, 24h High, and Volume above chart, show them below */
    .stats-container .stat-card:nth-child(2),
    .stats-container .stat-card:nth-child(3),
    .stats-container .stat-card:nth-child(4) {
        display: none;
    }
    
    /* Show Last Update (5th card) above chart */
    .stats-container .stat-card:nth-child(5) {
        display: block;
    }
    
    /* Show stats below chart */
    .stats-below-chart {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 10px;
        margin-top: 15px;
    }
    
    .stats-below-chart .stat-card {
        display: block !important;
    }
    
    .caloogy-footer {
        padding: 120px 40px 0;
        min-height: 450px;
    }
    
    .footer-brand {
        font-size: clamp(120px, 15vw, 180px);
    }
}

/* Mobile responsive design */
@media (max-width: 768px) {
    body {
        margin: 20px;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .chart-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-group {
        width: 100%;
    }
    
    .control-group select {
        width: 100%;
    }
    
    .chart-plot {
        height: 400px;
    }
    
    .chart-wrapper {
        flex-direction: column;
        gap: 15px;
    }
    
    .asset-list-panel {
        width: 100%;
        max-height: 400px;
        order: 2; /* Place after chart */
    }
    
    .chart-plot {
        order: 1; /* Place before asset list */
    }
    
    /* Stats layout for mobile: show only Current Price and Last Update above chart */
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    /* Hide 24h Change, 24h High, and Volume above chart */
    .stats-container .stat-card:nth-child(2),
    .stats-container .stat-card:nth-child(3),
    .stats-container .stat-card:nth-child(4) {
        display: none;
    }
    
    /* Show Last Update (5th card) above chart */
    .stats-container .stat-card:nth-child(5) {
        display: block;
    }
    
    /* Show stats below chart (24h Change, 24h High, Volume) */
    .stats-below-chart {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 10px;
        margin-top: 15px;
    }
    
    .stats-below-chart .stat-card {
        display: block !important;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    .stat-value {
        font-size: 18px;
    }
    
    .stat-time {
        font-size: 20px !important;
    }
    
    h1 {
        font-size: 24px;
        margin: 20px 0;
    }
    
    .chart-container {
        padding: 15px;
        margin: 10px 0;
    }
    
    .caloogy-ai-main-section {
        margin: 20px 0;
        padding: 20px;
    }
    
    .caloogy-ai-title {
        font-size: 48px;
        margin-bottom: 8px;
        letter-spacing: 1px;
        animation: titleFadeIn 1s ease-out forwards;
    }
    
    .caloogy-ai-subtitle {
        font-size: 14px;
        margin-bottom: 25px;
        animation: subtitleFadeIn 1.2s ease-out 0.2s forwards;
    }
    
    .caloogy-ai-input-wrapper {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    
    .caloogy-ai-input-wrapper.scroll-visible {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    
    .caloogy-ai-input-container {
        border-radius: 20px;
        padding: 14px 20px;
        backdrop-filter: blur(15px) saturate(180%);
        -webkit-backdrop-filter: blur(15px) saturate(180%);
    }
    
    .caloogy-ai-send-btn {
        width: 36px;
        height: 36px;
    }
    
    .caloogy-ai-response {
        border-radius: 16px;
        padding: 20px;
    }
    
    .caloogy-ai-message {
        padding: 14px 18px;
        border-radius: 14px;
    }
    
    .caloogy-ai-response {
        max-height: 300px;
    }
    
    .tools-panel {
        padding: 15px;
    }
    
    .caloogy-footer {
        margin-top: 40px;
    }
    
    .footer-brand {
        font-size: 60px;
    }
}

/* Current Price Styling with Continuous Breathing Animation */
.stat-price {
    font-size: 40px !important;
    font-weight: 820;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    animation: priceBreathe 2s ease-in-out infinite;
}

.stat-price.price-up {
    color: #26a69a !important;
}

.stat-price.price-down {
    color: #ef5350 !important;
}

/* Continuous breathing effect for price */
@keyframes priceBreathe {
    0%, 100% { 
        opacity: 0.85; 
        transform: scale(1);
        filter: brightness(1);
    }
    50% { 
        opacity: 1; 
        transform: scale(1.02);
        filter: brightness(1.15);
    }
}

/* Flash animation when price changes */
.stat-price.price-updating {
    animation: priceFlash 0.6s ease, priceBreathe 3s ease-in-out infinite !important;
}

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

/* Last Update Time Styling with Continuous Breathing Animation */
.stat-time {
    font-size: 30px !important;
    font-weight: 740;
    letter-spacing: 0.5px;
    color: #ffc107 !important;
    animation: timeBreathe 2s ease-in-out infinite;
}

/* Continuous breathing effect for time */
@keyframes timeBreathe {
    0%, 100% { 
        opacity: 0.85; 
        text-shadow: 0 0 4px rgba(255, 193, 7, 0.3);
        transform: scale(1);
    }
    50% { 
        opacity: 1; 
        text-shadow: 0 0 12px rgba(255, 193, 7, 0.7);
        transform: scale(1.02);
    }
}

/* Update animation when time changes */
.stat-time.updating {
    animation: timeUpdate 0.6s ease, timeBreathe 2.5s ease-in-out infinite !important;
}

@keyframes timeUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.update-date {
    font-size: 12px;
    color: #888;
    font-weight: 400;
}

/* CALOOGY Footer - High Contrast White/Black */
.caloogy-footer {
    border-radius: 5%; /* Reduced to 5% */
    background: #000000;
    color: #000000;
    padding: 100px 40px 0; /* Reduced padding, bottom padding 0 */
    margin: 120px 0 0 0;
    text-align: center;
    border-top: 3px solid #000000;
    width: 100%;
    box-sizing: border-box;
    min-height: 500px; /* Reduced height */
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Push content to bottom */
}

.footer-content {
    max-width: 1000px;
    color: #ffffff;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 100%;
}

.footer-brand {
    font-size: 200px;
    font-weight: 110;
    letter-spacing: 1px;
    margin: 0;
    line-height: 0.98;
    font-family: 'Playfair Display', 'Cormorant Garamond', 'Bodoni', 'Didot', 'Times New Roman', serif;
    text-transform: uppercase;
    order: 3; /* Place at bottom */
    margin-top: auto; /* Push to bottom */
    padding-bottom: 0;
    text-align: center;
}

.footer-tagline {
    font-size: 18px;
    letter-spacing: 8px;
    margin-bottom: 5px;
    font-weight: 400;
    text-transform: uppercase;
    color: #000000;
    order: 1; /* Place at top */
}

.footer-copyright {
    font-size: 20px;
    letter-spacing: 1.6px;
    margin-top: 10px;
    font-weight: 500;
    color: #ffffff;
    line-height: 1.6;
    order: 2; /* Place in middle */
}

/* Dark mode footer color inversion */
@media (prefers-color-scheme: dark) {
    .caloogy-footer {
        background: #000000; /* Black background in dark mode */
        color: #ffffff; /* White text in dark mode */
        border-top: 3px solid #000000; /* White border in dark mode */
    }
    
    .footer-brand {
        color: #ffffff; /* White CALOOGY text in dark mode */
    }
    
    .footer-tagline {
        color: #ffffff; /* White tagline text in dark mode */
    }
    
    .footer-copyright {
        color: #ffffff;
    }
}

/* Tablet responsive for Client Modal */
@media (max-width: 1024px) and (min-width: 769px) {
    .client-button {
        top: 18px;
        right: 18px;
        padding: 11px 24px;
        font-size: 13px;
    }
    
    .client-modal-content {
        padding: 35px 30px;
        max-width: 400px;
    }
    
    .footer-links-container {
        margin: 80px 0 35px 0;
        gap: 18px;
    }
    
    .footer-link-btn {
        padding: 16px 36px;
        font-size: 16px;
    }
}

/* Mobile Responsive Enhancements */
@media (max-width: 768px) {
    body {
        margin: 0;
        padding: 10px;
        background: var(--bg-primary);
    }
    
    h1 {
        font-size: 20px;
        margin: 15px 0;
    }
    
    .chart-container {
        border-radius: 0;
        box-shadow: none;
        padding: 10px;
        margin: 0 -10px;
        background: var(--chart-bg);
    }
    
    .chart-controls {
        padding: 10px;
    }
    
    .chart-wrapper {
        flex-direction: column;
    }
    
    #chartDiv {
        height: 60vh !important;
        width: 100% !important;
        margin: 0 !important;
    }
    
    .asset-list-panel {
        width: 100%;
        max-height: 300px;
        margin-top: 15px;
    }
    
    .asset-list-header {
        font-size: 14px;
    }
    
    .asset-item {
        padding: 8px 10px;
    }
    
    .asset-symbol {
        font-size: 13px;
    }
    
    .asset-price {
        font-size: 14px;
    }
    
    .tools-panel {
        display: none; /* Hide on mobile for cleaner look */
    }
    
    .stat-price {
        font-size: 32px !important;
    }
    
    .stat-time {
        font-size: 24px !important;
    }
    
    .caloogy-footer {
        padding: 60px 20px 0; /* Reduced padding, bottom padding 0 */
        margin: 60px 0 0 0;
        width: 100%;
        background: #000000;
        box-sizing: border-box;
        min-height: 350px; /* Reduced height for mobile */
        display: flex;
        flex-direction: column;
        justify-content: flex-end; /* Push content to bottom */
    }
    
    .footer-content {
        min-height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
    }
    
    .footer-brand {
        font-size: 80px; 
        letter-spacing: 0.01em;
        margin-top: auto; /* Push to bottom */
        padding-bottom: 0;
    }
    
    .footer-tagline {
        font-size: 11px;
        letter-spacing: 3px;
        margin-bottom: 15px;
        margin-top: 0;
    }
    
    .footer-copyright {
        font-size: 14px;
        letter-spacing: 1px;
        margin-top: 30px;
        color: #ffffff;
    }
    
    /* Dark mode footer color inversion for mobile */
    @media (prefers-color-scheme: dark) {
        .caloogy-footer {
            background: #000000; /* Black background in dark mode */
            color: #ffffff; /* White text in dark mode */
            border-top: 3px solid #000000; /* Black border in dark mode */
        }
        
        .footer-brand {
            color: #ffffff; /* White CALOOGY text in dark mode */
        }
        
        .footer-tagline {
            color: #ffffff; /* White tagline text in dark mode */
        }
        
        .footer-copyright {
            color: #ffffff;
        }
    }
    
    body {
        margin: 0;
        padding: 10px;
        padding-bottom: 0;
    }
}

/* Gemini Chat Widget */
.gemini-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.gemini-chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #f5b616; /* Gold color */
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(245, 182, 22, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    animation: geminiButtonBreathe 2.5s ease-in-out infinite;
}

@keyframes geminiButtonBreathe {
    0%, 100% {
        opacity: 0.85;
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(245, 182, 22, 0.4);
    }
    50% {
        opacity: 1;
        transform: scale(1.08);
        box-shadow: 0 8px 24px rgba(245, 182, 22, 0.7);
    }
}

.gemini-chat-button:hover {
    transform: scale(1.15);
    box-shadow: 0 10px 28px rgba(245, 182, 22, 0.8);
    animation: none; /* Disable breathing on hover */
}

.gemini-chat-button:active {
    transform: scale(0.95);
}

.gemini-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 400px;
    height: 600px;
    background: #ffffff; /* Default white background */
    border-radius: 5%; /* 5% border radius */
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
}

.gemini-chat-window.dark-mode {
    background: #000000; /* Black background */
    border: 1px solid #333333;
}

.gemini-chat-window.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.gemini-chat-header {
    background: #f5b616; /* Gold color */
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gemini-chat-theme-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
    margin-right: 8px;
}

.gemini-chat-theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.gemini-chat-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.gemini-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.gemini-chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.gemini-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.gemini-chat-message {
    display: flex;
    flex-direction: column;
    gap: 6px;
    animation: fadeIn 0.3s ease;
}

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

.gemini-chat-message.user {
    align-items: flex-end;
}

.gemini-chat-message.assistant {
    align-items: flex-start;
}

.gemini-chat-message-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    word-wrap: break-word;
    line-height: 1.5;
}

.gemini-chat-message.user .gemini-chat-message-bubble {
    background: #f5b616; /* Gold color */
    color: white;
    border-bottom-right-radius: 4px;
}

.gemini-chat-message.assistant .gemini-chat-message-bubble {
    background: #f5f5f5; /* Light gray for white background */
    color: #333333; /* Dark text for readability */
    border-bottom-left-radius: 4px;
    border: 1px solid #e0e0e0;
}

.gemini-chat-message-time {
    font-size: 11px;
    color: #666666; /* Gray text for white background */
    padding: 0 4px;
}

/* Dark mode styles */
.gemini-chat-window.dark-mode .gemini-chat-message.assistant .gemini-chat-message-bubble {
    background: #1a1a1a; /* Dark gray for black background */
    color: #e0e0e0; /* Light text for readability */
    border: 1px solid #333333;
}

.gemini-chat-window.dark-mode .gemini-chat-message-time {
    color: #999999; /* Lighter gray for black background */
}

.gemini-chat-window.dark-mode .gemini-chat-input-container {
    border-top: 1px solid #333333;
    background: #000000;
}

.gemini-chat-window.dark-mode .gemini-chat-input {
    border: 1px solid #333333;
    background: #1a1a1a;
    color: #e0e0e0;
}

.gemini-chat-window.dark-mode .gemini-chat-input:focus {
    border-color: #f5b616; /* Gold border on focus */
    background: #2a2a2a;
}

.gemini-chat-input-container {
    display: flex;
    gap: 8px;
    padding: 16px;
    border-top: 1px solid #e0e0e0;
    background: #ffffff; /* White background */
}

.gemini-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    background: #f5f5f5; /* Light gray input */
    color: #333333; /* Dark text */
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.gemini-chat-input:focus {
    border-color: #f5b616; /* Gold color */
    background: #ffffff;
}

.gemini-chat-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #f5b616; /* Gold color */
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.gemini-chat-send:hover {
    transform: scale(1.1);
}

.gemini-chat-send:active {
    transform: scale(0.95);
}

.gemini-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Loading indicator */
.gemini-chat-loading {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.gemini-chat-loading span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f5b616; /* Gold color */
    animation: loadingBounce 1.4s infinite ease-in-out;
}

.gemini-chat-loading span:nth-child(1) {
    animation-delay: -0.32s;
}

.gemini-chat-loading span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes loadingBounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Tablet responsive (768px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .gemini-chat-window {
        width: 450px;
        height: 650px;
    }
    
    .gemini-chat-button {
        width: 60px;
        height: 60px;
    }
    
    .caloogy-footer {
        padding: 120px 40px 0;
        min-height: 450px;
    }
    
    .footer-brand {
        font-size: clamp(120px, 15vw, 180px);
    }
    
    /* Dark mode footer color inversion for tablet */
    @media (prefers-color-scheme: dark) {
        .caloogy-footer {
            background: #000000;
            color: #ffffff;
            border-top: 3px solid #000000;
        }
        
        .footer-brand {
            color: #ffffff;
        }
        
        .footer-tagline {
            color: #ffffff;
        }
        
        .footer-copyright {
            color: #ffffff;
        }
    }
}

/* Client Button Styles */
.client-button {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: #ffffff !important;
    border: none;
    border-radius: 25px;
    padding: 12px 28px;
    color: #000000;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
}

.client-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: #f5f5f5 !important;
}

.client-button:active {
    transform: translateY(0);
}

.client-button-text {
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* Client Modal Styles */
.client-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.client-modal.active {
    opacity: 1;
    visibility: visible;
}

.client-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.client-modal-content {
    position: relative;
    background: #1a1a1a;
    border-radius: 20px;
    padding: 40px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.client-modal.active .client-modal-content {
    transform: scale(1);
}

.client-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 32px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    line-height: 1;
}

.client-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.client-modal-title {
    color: #ffffff;
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 30px 0;
    text-align: center;
    letter-spacing: 0.5px;
}

.client-modal-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.client-input {
    width: 100%;
    padding: 14px 18px;
    background: #2a2a2a;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #ffffff;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.client-input:focus {
    outline: none;
    border-color: #667eea;
    background: #2f2f2f;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.client-input::placeholder {
    color: #888;
}

.client-submit-btn {
    padding: 14px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.client-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.client-submit-btn:active {
    transform: translateY(0);
}

.client-message {
    min-height: 20px;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    transition: all 0.3s ease;
}

.client-message.error {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.client-message.loading {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

/* Footer Links Container */
.footer-links-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin: 100px 0 40px 0;
    padding: 0 20px;
    flex-wrap: wrap;
}

.footer-link-btn {
    padding: 20px 50px;
    background: transparent;
    border: 2px solid #ffffff;
    border-radius: 30px;
    color: #ffffff;
    font-size: 20px;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.footer-link-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: #ffffff;
    transition: left 0.3s ease;
    z-index: -1;
}

.footer-link-btn:hover {
    color: #000000;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.2);
}

.footer-link-btn:hover::before {
    left: 0;
}

.footer-link-btn:active {
    transform: translateY(0);
}

.about-btn {
    border-color: #667eea;
}

.about-btn:hover {
    border-color: #667eea;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.junior-btn {
    border-color: #f093fb;
}

.junior-btn:hover {
    border-color: #f093fb;
    box-shadow: 0 6px 20px rgba(240, 147, 251, 0.3);
}

/* Dark mode adjustments for Client Modal */
@media (prefers-color-scheme: dark) {
    .client-modal-content {
        background: #1a1a1a;
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .client-input {
        background: #2a2a2a;
        border-color: rgba(255, 255, 255, 0.1);
        color: #ffffff;
    }
    
    .client-input:focus {
        background: #2f2f2f;
        border-color: #667eea;
    }
}

/* Light mode adjustments (if needed) */
@media (prefers-color-scheme: light) {
    .client-modal-content {
        background: #ffffff;
        border-color: rgba(0, 0, 0, 0.1);
    }
    
    .client-modal-title {
        color: #000000;
    }
    
    .client-input {
        background: #f5f5f5;
        border-color: rgba(0, 0, 0, 0.1);
        color: #000000;
    }
    
    .client-input:focus {
        background: #ffffff;
        border-color: #667eea;
    }
    
    .client-modal-close {
        color: #000000;
    }
    
    .client-modal-close:hover {
        background: rgba(0, 0, 0, 0.1);
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .client-button {
        top: 12px;
        right: 28px;
        padding: 8px 14px;
        font-size: 11px;
        min-width: 68px;
        border-radius: 20px;
    }
    
    .client-modal-content {
        padding: 30px 20px;
        max-width: 90%;
        margin: 20px;
    }
    
    .client-modal-title {
        font-size: 20px;
        margin-bottom: 25px;
    }
    
    .client-input {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .client-submit-btn {
        padding: 12px 24px;
        font-size: 14px;
    }
    
    .footer-links-container {
        margin: 80px 0 30px 0;
        gap: 20px;
    }
    
    .footer-link-btn {
        padding: 18px 40px;
        font-size: 18px;
        letter-spacing: 1.5px;
    }
    
    .gemini-chat-widget {
        bottom: 15px;
        right: 15px;
        left: auto; /* Ensure it's positioned from right */
    }
    
    .gemini-chat-window {
        width: 90vw; /* Smaller width - 90% of viewport */
        max-width: 400px; /* Max width limit */
        height: 70vh; /* Smaller height - 70% of viewport */
        max-height: 500px; /* Max height limit */
        bottom: 75px;
        right: 15px;
        left: auto; /* Fix: remove left, use right positioning */
    }
    
    .gemini-chat-button {
        width: 64px; /* Larger button for mobile */
        height: 64px; /* Larger button for mobile */
    }
}

