/* ===== Atmosphere Control Panel & Effects ===== */

/* --- Toggle Button --- */
.atm-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9998;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1.5px solid rgba(212,168,83,0.5);
    background: rgba(18,6,6,0.9);
    color: var(--gold);
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0,0,0,0.5), 0 0 8px rgba(212,168,83,0.15);
    transition: transform 0.2s, box-shadow 0.2s;
    backdrop-filter: blur(4px);
}

.atm-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 16px rgba(0,0,0,0.6), 0 0 14px rgba(212,168,83,0.3);
    border-color: var(--gold);
}

/* --- Panel --- */
.atm-panel {
    position: fixed;
    bottom: 80px;
    right: 24px;
    z-index: 9999;
    width: 280px;
    border-radius: 10px;
    border: 1.5px solid rgba(212,168,83,0.35);
    background: rgba(18,6,6,0.95);
    backdrop-filter: blur(10px);
    box-shadow:
        0 8px 32px rgba(0,0,0,0.6),
        inset 0 0 20px rgba(0,0,0,0.3),
        0 0 1px rgba(212,168,83,0.3);
    padding: 0;
    overflow: hidden;
    animation: atm-panel-in 0.25s ease-out;
}

.atm-panel[hidden] {
    display: none;
}

@keyframes atm-panel-in {
    from { opacity: 0; transform: translateY(10px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.atm-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(212,168,83,0.15);
}

.atm-panel-title {
    font-family: var(--sultan-display);
    font-size: 0.95rem;
    color: var(--gold);
    letter-spacing: 3px;
}

.atm-panel-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.2s;
}

.atm-panel-close:hover {
    color: var(--gold);
}

.atm-panel-body {
    padding: 14px 16px 16px;
}

/* --- Slider Controls --- */
.atm-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    cursor: default;
}

.atm-label {
    font-size: 0.78rem;
    color: var(--text-light);
    min-width: 40px;
    letter-spacing: 1px;
}

.atm-control input[type="range"] {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(212,168,83,0.15);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.atm-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--gold);
    border: 2px solid rgba(18,6,6,0.8);
    box-shadow: 0 0 6px rgba(212,168,83,0.4);
    cursor: pointer;
    transition: transform 0.15s;
}

.atm-control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.atm-control input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--gold);
    border: 2px solid rgba(18,6,6,0.8);
    box-shadow: 0 0 6px rgba(212,168,83,0.4);
    cursor: pointer;
}

.atm-value {
    font-size: 0.68rem;
    color: var(--text-dim);
    min-width: 22px;
    text-align: right;
    font-family: ui-monospace, monospace;
}

/* --- Switch Controls --- */
.atm-switches {
    margin: 16px 0 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.atm-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.atm-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.atm-switch-track {
    width: 34px;
    height: 18px;
    border-radius: 9px;
    background: rgba(212,168,83,0.12);
    border: 1px solid rgba(212,168,83,0.25);
    position: relative;
    transition: background 0.3s, border-color 0.3s;
    flex-shrink: 0;
}

.atm-switch-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-dim);
    transition: transform 0.25s, background 0.25s;
}

.atm-switch input:checked ~ .atm-switch-track {
    background: rgba(212,168,83,0.3);
    border-color: var(--gold);
}

.atm-switch input:checked ~ .atm-switch-track::after {
    transform: translateX(16px);
    background: var(--gold);
}

/* --- Reset Button --- */
.atm-reset {
    width: 100%;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid rgba(212,168,83,0.2);
    background: rgba(212,168,83,0.06);
    color: var(--text-dim);
    font-size: 0.75rem;
    letter-spacing: 2px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.atm-reset:hover {
    background: rgba(212,168,83,0.12);
    color: var(--gold);
    border-color: rgba(212,168,83,0.4);
}

/* ===== Ambient Glow Layer ===== */
.atm-glow-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.6s;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(255,160,60,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(255,140,50,0.06) 0%, transparent 45%),
        radial-gradient(ellipse at 50% 50%, rgba(255,180,80,0.04) 0%, transparent 60%);
}

/* ===== Floating Particles ===== */
.atm-particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.8s;
}

.particles-on .atm-particles {
    opacity: 1;
}

.atm-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,200,100,0.9), rgba(255,160,60,0.3));
    box-shadow: 0 0 4px rgba(255,180,80,0.5);
    animation: atm-float linear infinite;
    opacity: 0;
}

@keyframes atm-float {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100vh) translateX(30px);
        opacity: 0;
    }
}

/* ===== Warm Accent Mode ===== */
.warm-accent-on .tl-card {
    border-color: rgba(230,160,60,0.3) !important;
}

.warm-accent-on .tl-card::before {
    border-color: rgba(230,160,60,0.1);
}

.warm-accent-on .tl-dot::before {
    background: radial-gradient(circle, rgba(230,140,50,0.35) 0%, transparent 70%);
}

.warm-accent-on .section-title h2 {
    background: linear-gradient(180deg, #f5e0a0 10%, #e8b84a 50%, #c08030 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.warm-accent-on .timeline-vertical::before {
    box-shadow: 0 0 10px rgba(230,160,60,0.2);
}

.warm-accent-on .map-frame {
    border-color: rgba(200,140,50,0.8) !important;
}

.warm-accent-on .loc-card::before {
    border-color: rgba(230,160,60,0.45);
}

.warm-accent-on .loc-card:hover::before {
    border-color: #e8a030;
    box-shadow: 0 0 14px rgba(230,160,60,0.35);
}

/* ===== Mobile Adjustments ===== */
@media (max-width: 480px) {
    .atm-panel {
        right: 12px;
        bottom: 74px;
        width: calc(100vw - 24px);
        max-width: 300px;
    }

    .atm-toggle {
        bottom: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
    }
}

/* ===== Cat Paw Trail ===== */
.paw-trail {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.paw-print {
    position: absolute;
    width: 18px;
    height: 18px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23d4a853'%3E%3Ccircle cx='12' cy='14' r='5'/%3E%3Ccircle cx='6' cy='7' r='2.5'/%3E%3Ccircle cx='18' cy='7' r='2.5'/%3E%3Ccircle cx='9' cy='4' r='2'/%3E%3Ccircle cx='15' cy='4' r='2'/%3E%3C/svg%3E") center/contain no-repeat;
    opacity: 0;
    animation: paw-appear 3s ease-out forwards;
}

@keyframes paw-appear {
    0% { opacity: 0; }
    15% { opacity: 0.45; }
    70% { opacity: 0.35; }
    100% { opacity: 0; }
}
