/* ============================================
   DESIGN TOKENS (chỉ dùng cho trang hiệu ứng)
   ============================================ */
:root {
    --se-bg: #f5f7fb;
    --se-card-bg: #ffffff;
    --se-border: #dee2e6;
    --se-border-soft: #edf1f5;
    --se-muted: #6c757d;
    --se-text: #1f2933;
    --se-primary: #0d6efd;
    --se-primary-soft: #e7f1ff;
    --se-success: #198754;
    --se-danger: #dc3545;
    --se-info: #0dcaf0;
    --se-radius-lg: 16px;
    --se-radius-md: 10px;
    --se-radius-pill: 999px;
    --se-shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.08);
    --se-shadow-md: 0 6px 20px rgba(15, 23, 42, 0.14);
}

/* ============================================
   SEASONAL EFFECTS CONTAINER (OVERLAY)
   ============================================ */
#seasonalEffects {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

/* ============================================
   SNOWFALL EFFECT
   ============================================ */
.snowflake {
    position: absolute;
    top: -10px;
    color: #ffffff;
    font-size: 1em;
    pointer-events: none;
    animation: snowfall linear infinite;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
    user-select: none;
}

@keyframes snowfall {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) translateX(50px) rotate(360deg);
        opacity: 0.3;
    }
}

/* ============================================
   FIREWORK EFFECT
   ============================================ */
.firework {
    position: absolute;
    pointer-events: none;
}

.firework-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    pointer-events: none;
    animation: fireworkParticle 1s ease-out forwards;
}

@keyframes fireworkParticle {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

/* ============================================
   NOEL EFFECT (🎄🎁)
   ============================================ */
.noel {
    position: absolute;
    top: -10px;
    font-size: 1.5em;
    pointer-events: none;
    animation: noelFall linear infinite;
    user-select: none;
}

@keyframes noelFall {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) translateX(-40px) rotate(-360deg);
        opacity: 0.4;
    }
}

/* ============================================
   TẾT EFFECT (🪙🧧)
   ============================================ */
.tet {
    position: absolute;
    top: -10px;
    font-size: 1.5em;
    pointer-events: none;
    animation: tetFall linear infinite;
    user-select: none;
}

@keyframes tetFall {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateY(50vh) translateX(30px) rotate(180deg) scale(1.2);
        opacity: 0.9;
    }
    100% {
        transform: translateY(100vh) translateX(-30px) rotate(360deg) scale(0.8);
        opacity: 0.3;
    }
}

/* ============================================
   TRUNG THU EFFECT (🏮)
   ============================================ */
.midautumn {
    position: absolute;
    top: -10px;
    font-size: 2em;
    pointer-events: none;
    animation: midautumnSwing linear infinite;
    user-select: none;
}

@keyframes midautumnSwing {
    0% {
        transform: translateY(0) translateX(0) rotate(-15deg);
        opacity: 1;
    }
    25% {
        transform: translateY(25vh) translateX(20px) rotate(15deg);
        opacity: 0.95;
    }
    50% {
        transform: translateY(50vh) translateX(-10px) rotate(-10deg);
        opacity: 0.8;
    }
    75% {
        transform: translateY(75vh) translateX(15px) rotate(10deg);
        opacity: 0.6;
    }
    100% {
        transform: translateY(100vh) translateX(0) rotate(-5deg);
        opacity: 0.3;
    }
}

/* ============================================
   FLAG EFFECT (30/4) - PNG VERSION
   ============================================ */
.flag {
    position: absolute;
    top: -10px;
    pointer-events: none;
    animation: flagWave linear infinite;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flag img {
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

@keyframes flagWave {
    0% {
        transform: translateY(0) rotate(-10deg);
        opacity: 1;
    }
    50% {
        transform: translateY(50vh) rotate(10deg);
        opacity: 0.8;
    }
    100% {
        transform: translateY(100vh) rotate(-10deg);
        opacity: 0.3;
    }
}

/* ============================================
   HALLOWEEN EFFECT
   ============================================ */
.halloween {
    position: absolute;
    top: -10px;
    font-size: 2em;
    pointer-events: none;
    animation: halloweenFloat linear infinite;
    user-select: none;
}

@keyframes halloweenFloat {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: translateY(50vh) translateX(20px) rotate(180deg);
        opacity: 0.7;
    }
    100% {
        transform: translateY(100vh) translateX(-20px) rotate(360deg);
        opacity: 0.3;
    }
}

/* ============================================
   SANTA CLAUS ANIMATION - ÔNG GIÀ NOEL TẶNG QUÀ
   ============================================ */

.santa-container {
    position: fixed;
    bottom: -200px;
    right: -200px;
    z-index: 10000;
    pointer-events: none;
    animation: santaEnter 8s ease-in-out forwards;
}

.santa-character {
    font-size: 120px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    animation: santaWave 1s ease-in-out infinite;
}

.santa-gift {
    position: absolute;
    font-size: 60px;
    bottom: 20px;
    right: 120px;
    opacity: 0;
    transform: scale(0);
    animation: giftAppear 2s ease-out 3s forwards;
}

.santa-message {
    position: absolute;
    top: -80px;
    right: 0;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: #ffffff;
    padding: 15px 25px;
    border-radius: 20px;
    font-size: 18px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 8px 20px rgba(231, 76, 60, 0.4);
    opacity: 0;
    transform: translateY(20px);
    animation: messageAppear 1s ease-out 2s forwards, messageFade 1s ease-in 6s forwards;
}

.santa-message::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 60px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #c0392b;
}

/* SANTA ANIMATIONS */
@keyframes santaEnter {
    0% {
        bottom: -200px;
        right: -200px;
        transform: scale(0.5);
    }
    20% {
        bottom: 50px;
        right: 50px;
        transform: scale(1);
    }
    80% {
        bottom: 50px;
        right: 50px;
        transform: scale(1);
    }
    100% {
        bottom: -200px;
        right: -200px;
        transform: scale(0.5);
        opacity: 0;
    }
}

@keyframes santaWave {
    0%, 100% {
        transform: rotate(-5deg);
    }
    50% {
        transform: rotate(5deg);
    }
}

@keyframes giftAppear {
    0% {
        opacity: 0;
        transform: scale(0) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1.3) rotate(360deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(720deg);
    }
}

@keyframes messageAppear {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes messageFade {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* SPARKLES EFFECT (SANTA) */
.santa-sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #ffd700;
    border-radius: 50%;
    animation: sparkle 1.5s ease-in-out infinite;
    box-shadow: 0 0 10px #ffd700;
}

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

/* ============================================
   SETTINGS PAGE LAYOUT & UI
   ============================================ */

.seasonal-settings-container {
    max-width: 1200px;
    margin: 0 auto 40px;
    padding: 16px 0 40px;
}

/* CARD CHUNG */
.effect-card {
    background: var(--se-card-bg);
    border-radius: var(--se-radius-lg);
    padding: 22px 22px 20px;
    margin-bottom: 18px;
    border: 1px solid var(--se-border-soft);
    box-shadow: var(--se-shadow-sm);
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.effect-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--se-shadow-md);
}

.effect-card.active {
    border-color: var(--se-primary);
    background: linear-gradient(120deg, rgba(13, 110, 253, 0.05), #ffffff);
}

/* HEADER CARD */
.effect-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    column-gap: 16px;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--se-border);
}

.effect-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--se-text);
}

.effect-title i,
.effect-title span:first-child {
    font-size: 1.7rem;
}

/* TOGGLE SWITCH */
.effect-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 58px;
    height: 30px;
    flex-shrink: 0;
}

.effect-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.effect-toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #ced4da;
    transition: 0.3s;
    border-radius: 999px;
}

.effect-toggle-slider:before {
    content: "";
    position: absolute;
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: #ffffff;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.22);
}

.effect-toggle input:checked + .effect-toggle-slider {
    background-color: var(--se-primary);
}

.effect-toggle input:checked + .effect-toggle-slider:before {
    transform: translateX(26px);
}

/* KHỐI CONTROL */
.effect-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.control-label {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.control-label small {
    display: block;
    font-weight: 400;
    color: var(--se-muted);
}

/* INPUT / SELECT / RANGE */
.control-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--se-border);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    background-color: #ffffff;
}

.control-input:focus {
    outline: none;
    border-color: var(--se-primary);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

/* SLIDER */
.control-slider {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
}

/* Chrome / Edge / Safari */
.control-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--se-primary);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}

.control-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 0 5px rgba(13, 110, 253, 0.25);
}

/* Firefox */
.control-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--se-primary);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.control-slider::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 0 5px rgba(13, 110, 253, 0.25);
}

.slider-value {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 40px;
    font-weight: 600;
    color: var(--se-primary);
    font-size: 0.9rem;
}

/* COLOR PICKERS - FIREWORKS */
.color-picker-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.color-picker {
    width: 42px;
    height: 42px;
    border: 2px solid var(--se-border);
    border-radius: 10px;
    cursor: pointer;
    padding: 0;
    background-color: #ffffff;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.color-picker:hover {
    transform: translateY(-1px) scale(1.05);
    border-color: var(--se-primary);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15);
}

/* BUTTON HÀNH ĐỘNG */
.effect-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.btn-effect {
    padding: 9px 18px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-effect:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

/* PREVIEW */
.btn-preview {
    background: var(--se-info);
    color: #ffffff;
}

.btn-preview:hover:not(:disabled) {
    background: #0ab9d9;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(13, 202, 240, 0.35);
}

/* SAVE */
.btn-save {
    background: var(--se-success);
    color: #ffffff;
}

.btn-save:hover:not(:disabled) {
    background: #157347;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(25, 135, 84, 0.35);
}

/* STOP */
.btn-stop {
    background: var(--se-danger);
    color: #ffffff;
}

.btn-stop:hover:not(:disabled) {
    background: #bb2d3b;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.35);
}

/* GLOBAL ACTIONS */
.global-actions {
    margin-top: 26px;
    padding: 24px 20px 26px;
    border-radius: var(--se-radius-lg);
    background: radial-gradient(circle at top left, #0d6efd 0%, #4b6cb7 40%, #182848 100%);
    box-shadow: var(--se-shadow-md);
    text-align: center;
}

.current-effect-status {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 18px;
}

.current-effect-status i {
    margin-right: 6px;
    opacity: 0.9;
}

.btn-stop-all {
    background: #ffffff;
    color: var(--se-danger);
    padding: 12px 32px;
    font-size: 1rem;
    border-radius: 999px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.btn-stop-all:hover {
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    background: #fff5f5;
}

/* ============================================
   PAGES SELECTOR
   ============================================ */
.pages-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid var(--se-border);
}

.page-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    background: #ffffff;
    border: 1px solid var(--se-border);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
    user-select: none;
}

.page-checkbox:hover {
    border-color: var(--se-primary);
    background: #f0f7ff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}

.page-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--se-primary);
    flex-shrink: 0;
}

.page-checkbox span {
    font-size: 0.9rem;
    color: #495057;
    transition: color 0.15s ease, font-weight 0.15s ease;
}

/* Khi được chọn */
.page-checkbox input[type="checkbox"]:checked + span {
    font-weight: 600;
    color: var(--se-primary);
}

/* Selector hỗ trợ trình duyệt mới */
.page-checkbox:has(input:checked) {
    border-color: var(--se-primary);
    background: var(--se-primary-soft);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 992px) {
    .seasonal-settings-container {
        padding: 10px 0 32px;
    }

    .effect-card {
        padding: 20px 18px;
    }
}

@media (max-width: 768px) {
    .effect-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .effect-card {
        padding: 18px 16px;
    }

    .effect-controls {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .effect-actions {
        flex-direction: column;
    }

    .btn-effect {
        width: 100%;
        justify-content: center;
    }

    .pages-selector {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .page-checkbox {
        padding: 6px 8px;
        font-size: 0.84rem;
    }

    .global-actions {
        padding: 20px 16px 22px;
        margin-top: 22px;
    }

    .btn-stop-all {
        width: 100%;
        justify-content: center;
    }

    /* Santa position nhỏ hơn */
    .santa-container {
        bottom: -150px;
        right: -150px;
    }

    .santa-character {
        font-size: 80px;
    }

    .santa-gift {
        font-size: 40px;
        bottom: 15px;
        right: 80px;
    }

    .santa-message {
        font-size: 14px;
        padding: 10px 18px;
        top: -60px;
    }

    @keyframes santaEnter {
        0% {
            bottom: -150px;
            right: -150px;
            transform: scale(0.5);
        }
        20% {
            bottom: 30px;
            right: 30px;
            transform: scale(1);
        }
        80% {
            bottom: 30px;
            right: 30px;
            transform: scale(1);
        }
        100% {
            bottom: -150px;
            right: -150px;
            transform: scale(0.5);
            opacity: 0;
        }
    }
}

@media (max-width: 480px) {
    .effect-title {
        font-size: 1.05rem;
    }

    .effect-title i,
    .effect-title span:first-child {
        font-size: 1.4rem;
    }

    .current-effect-status {
        font-size: 0.98rem;
    }

    .btn-stop-all {
        padding: 11px 26px;
        font-size: 0.95rem;
    }

    .pages-selector {
        grid-template-columns: repeat(2, 1fr);
    }

    .page-checkbox span {
        font-size: 0.8rem;
    }

    .santa-character {
        font-size: 60px;
    }

    .santa-gift {
        font-size: 30px;
        bottom: 10px;
        right: 60px;
    }

    .santa-message {
        font-size: 12px;
        padding: 8px 15px;
        top: -50px;
    }
}
