:root {
    --bg: #3b3b4a;
    --panel: rgba(165, 165, 165, 0.358);
    --accent: #ff4dd2;
    --accent-2: #4dd2ff;
    --muted: rgba(255, 255, 255, 0.75);
    --text: #f4f6ff;
    --text-strong: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.78);
    --sunshine-primary: #ffb81c;
    --sunshine-secondary: #ff9e1b;
    --sunshine-tertiary: #ffa500;
    --whitr-text: #ffffff;
}

/* Entertainment theme styles activate when body has .entertainment-mode */
body.entertainment-mode {
    background:
        radial-gradient(circle at 10% 10%, rgba(92, 92, 92, 0.06), transparent 10%),
        radial-gradient(circle at 90% 90%, rgba(113, 113, 113, 0.04), transparent 12%), var(--bg);
    color: var(--text);
}

body.entertainment-mode .form-text {
    color: var(--whitr-text);
}

body.entertainment-mode .footer {
  background: rgb(0, 0, 0);
  border: 2px solid rgba(0, 0, 0, 0.3);
}

body.entertainment-mode .cta-banner { 
  background-image: url("/static/img/IMG_4152.jpg");
}

body.entertainment-mode .card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow:
        0 6px 18px rgba(2, 6, 23, 0.6),
        0 0 24px rgba(77, 210, 255, 0.03) inset;
    border-radius: 12px;
    color: var(--text);
}

body.entertainment-mode .card p,
body.entertainment-mode .card-title p {
    color: var(--whitr-text);
}

/* Glowing primary buttons */
body.entertainment-mode .btn-primary {
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    border: none;
    color: #0a0a0e;
    box-shadow:
        0 6px 18px rgba(77, 210, 255, 0.08),
        0 0 24px rgba(255, 77, 210, 0.06);
    transition:
        transform 0.14s ease,
        box-shadow 0.14s ease;
}
body.entertainment-mode .btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
}

body.entertainment-mode .cta-banner h1 {
    background: linear-gradient(135deg, #ff4dd2, #4dd2ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow:
        0 2px 12px rgba(118, 117, 117, 0.45),
        0 0 14px rgba(153, 224, 248, 0.12);
}

/* Neon headings */
body.entertainment-mode h1,
body.entertainment-mode h2,
body.entertainment-mode h3,
body.entertainment-mode h4,
body.entertainment-mode h5,
body.entertainment-mode h6{
    color: var(--whitr-text);
}

/* Playful badges */
body.entertainment-mode .badge {
    background: linear-gradient(90deg, rgba(77, 210, 255, 0.18), rgba(255, 77, 210, 0.12));
    color: var(--text-strong);
    border-radius: 999px;
    padding: 0.28rem 0.6rem;
}

body.entertainment-mode .notice-container .notice-content {
    background: rgba(0, 0, 0, 0.5);
}

body.entertainment-mode .notice-content h1 {
    color: var(--whitr-text);
}

/* Card hover tilt + glow */
@media (prefers-reduced-motion: no-preference) {
    body.entertainment-mode .card:hover {
        transform: translateY(-8px) scale(1.01);
        transition:
            transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
            box-shadow 0.22s ease;
        box-shadow:
            0 18px 40px rgba(15, 43, 168, 0.7),
            0 0 36px rgba(124, 218, 250, 0.06);
    }
}

/* Floating theme toggle button */
.entertainment-toggle {
    position: fixed;
    right: 18px;
    top: 70px;
    z-index: 1200;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    border: none;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.45),
        0 0 18px rgba(255, 77, 210, 0.06);
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.entertainment-toggle:hover {
    transform: scale(1.12) rotate(15deg);
    box-shadow:
        0 15px 40px rgba(255, 77, 210, 0.3),
        0 0 30px rgba(77, 210, 255, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.entertainment-toggle:active {
    transform: scale(0.95);
}
.entertainment-toggle:focus {
    outline: 2px solid rgba(255, 255, 255, 0.3);
    outline-offset: 2px;
}

@media (max-width: 480px) {
    .entertainment-toggle {
        top: 110px;
    }
}

/* Entertainment button hover when active */
body.entertainment-mode .entertainment-toggle:hover {
    background: linear-gradient(135deg, #fffbf0 0%, #fff9e6 50%, #fffbf0 100%);
    box-shadow:
        0 16px 50px rgba(255, 184, 28, 0.4),
        0 0 40px rgba(255, 184, 28, 0.3) inset;
    transform: scale(1.15) rotate(-15deg);
}

/* Sun icon animation when active */
body.entertainment-mode #entertainmentIcon.sun-active {
    animation: none;
}

@keyframes sunRise {
    0% {
        transform: translateY(0) scale(1) rotate(0deg);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-8px) scale(1.2) rotate(180deg);
        text-shadow: 0 0 20px rgba(255, 223, 0, 0.8);
    }
    100% {
        transform: translateY(0) scale(1) rotate(360deg);
        opacity: 1;
        text-shadow: 0 0 10px rgba(255, 223, 0, 0.4);
    }
}

/* Glow pulse effect for sun in entertainment mode */
@keyframes sunGlowEnt {
    0%,
    100% {
        filter: drop-shadow(0 0 8px rgba(255, 223, 0, 0.4));
    }
    50% {
        filter: drop-shadow(0 0 16px rgba(255, 223, 0, 0.8));
    }
}

body.entertainment-mode #entertainmentIcon {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* When sun is visible in entertainment mode */
body.entertainment-mode #entertainmentIcon[title*='娛樂風格'] {
    animation: sunColorGlow 2s ease-in-out infinite;
    background: linear-gradient(135deg, #ff4dd2, #4dd2ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 12px rgba(255, 77, 210, 0.4));
}

/* Sun colorful glow animation for entertainment */
@keyframes sunColorGlow {
    0%,
    100% {
        filter: drop-shadow(0 0 8px rgba(255, 77, 210, 0.4))
            drop-shadow(0 0 8px rgba(77, 210, 255, 0.2));
    }
    50% {
        filter: drop-shadow(0 0 16px rgba(77, 210, 255, 0.8))
            drop-shadow(0 0 12px rgba(255, 77, 210, 0.6));
    }
}

/* Entertainment button with colored gradient background when active */
body.entertainment-mode .entertainment-toggle {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border: none;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.45),
        0 0 18px rgba(255, 77, 210, 0.06);
    color: #fff;
}

/* Moon icon in default mode */
#entertainmentIcon {
    display: inline-block;
    transition:
        transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        filter 0.5s ease,
        color 0.5s ease;
}

/* Sunshine theme button styling when active */
body.sunshine-theme .entertainment-toggle {
    background: linear-gradient(135deg, var(--sunshine-primary), var(--sunshine-secondary));
    box-shadow:
        0 12px 40px rgba(255, 184, 28, 0.4),
        0 0 30px rgba(255, 107, 53, 0.2) inset;
}

body.sunshine-theme .entertainment-toggle:hover {
    transform: scale(1.15) rotate(-15deg);
    box-shadow:
        0 16px 50px rgba(255, 184, 28, 0.5),
        0 0 40px rgba(255, 107, 53, 0.3) inset;
}

/* Expanding rays for sunshine theme */
body.sunshine-theme .entertainment-toggle::after {
    content: '';
    position: absolute;
    width: 70px;
    height: 70px;
    border: 2px solid var(--sunshine-primary);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    animation: raysExpand 1.5s ease-out infinite;
    pointer-events: none;
}

@keyframes raysExpand {
    0% {
        width: 54px;
        height: 54px;
        opacity: 1;
        border-color: rgba(255, 184, 28, 0.8);
    }
    100% {
        width: 80px;
        height: 80px;
        opacity: 0;
        border-color: rgba(255, 184, 28, 0.1);
    }
}

/* Decorative shimmer underline for links */
body.entertainment-mode a {
    color: var(--text-strong);
    position: relative;
    text-decoration: none;
}
body.entertainment-mode a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-2), var(--accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.18s ease;
}
body.entertainment-mode a:hover::after {
    transform: scaleX(1);
}

body.entertainment-mode .form-control,
body.entertainment-mode textarea {
    background: rgba(10, 10, 14, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--text);
}

body.entertainment-mode .form-control::placeholder,
body.entertainment-mode textarea::placeholder {
    color: var(--text-muted);
}

body.entertainment-mode .form-control:focus,
body.entertainment-mode textarea:focus {
    background: rgba(10, 10, 14, 0.85);
    border-color: rgba(77, 210, 255, 0.45);
    box-shadow:
        0 0 0 2px rgba(77, 210, 255, 0.12),
        0 0 14px rgba(77, 210, 255, 0.18);
}

body.entertainment-mode .table {
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.12);
}

body.entertainment-mode .table thead th {
    color: var(--text-strong);
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
}

/* Small utility: rainbow title */
.rainbow {
    background: linear-gradient(90deg, #ff6bd1, #9d7bff, #4dd2ff, #ffd36b);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* 讓 Entertainment 主題的漢堡選單圖示變白色 */
body.entertainment .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='#ffffff' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

/* Footer styles for entertainment theme */
body.entertainment-mode .declaration_link:link {
    color: var(--accent) !important;
    background-color: transparent;
    text-decoration: none;
    transition: all 0.3s ease;
}

body.entertainment-mode .declaration_link:hover {
    color: var(--accent-2) !important;
    background-color: transparent;
    text-decoration: underline;
    text-shadow: 0 0 10px rgba(77, 210, 255, 0.5);
}

body.entertainment-mode .declaration_link:visited {
    color: var(--accent) !important;
    background-color: transparent;
    text-decoration: none;
}

body.entertainment-mode .copyright {
    color: var(--accent) !important;
    text-shadow: 0 0 8px rgba(255, 77, 210, 0.3);
}

body.entertainment-mode .copyright p {
    color: var(--accent) !important;
}
