/**
 * Settlement Themes
 * Unique visual styling for different settlement/journey types
 */

:root {
    /* Base theme (fallback) */
    --settlement-primary: #CDB87D;
    --settlement-secondary: #8B4513;
    --settlement-bg: #0a0806;
    --settlement-glow: rgba(205, 184, 125, 0.3);
}

/* ===================================
   SETTLEMENT 7 - Northern - Cold/Hope
   =================================== */
[data-settlement="settlement-7"],
[data-theme="northern"],
.theme-northern {
    --settlement-primary: #a8d4e6;
    --settlement-secondary: #4a90a4;
    --settlement-bg: #0a1215;
    --settlement-glow: rgba(168, 212, 230, 0.2);
}

.theme-northern body,
[data-theme="northern"] {
    background: linear-gradient(180deg, #0a1215 0%, #0d1820 50%, #0a1215 100%);
}

.theme-northern::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at top, rgba(168, 212, 230, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Snow particle effect */
.theme-northern .particle-overlay {
    background-image:
        radial-gradient(circle, rgba(255, 255, 255, 0.3) 1px, transparent 1px),
        radial-gradient(circle, rgba(200, 220, 240, 0.2) 1px, transparent 1px);
    background-size: 40px 40px, 80px 80px;
    animation: snowfall 20s linear infinite;
}

@keyframes snowfall {
    0% {
        background-position: 0 0, 0 0;
    }

    100% {
        background-position: 40px 200px, 80px 300px;
    }
}


/* ===================================
   RUST CANYON - Industrial/Percussion
   =================================== */
[data-settlement="rust-canyon"],
[data-theme="industrial"],
.theme-industrial {
    --settlement-primary: #e8a45c;
    --settlement-secondary: #8b4513;
    --settlement-bg: #120808;
    --settlement-glow: rgba(232, 164, 92, 0.25);
}

.theme-industrial body,
[data-theme="industrial"] {
    background: linear-gradient(180deg, #120808 0%, #1a0c08 50%, #120808 100%);
}

.theme-industrial::before {
    content: '';
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30%;
    background: linear-gradient(0deg, rgba(232, 164, 92, 0.08) 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

/* Ember/spark effect */
.theme-industrial .spark {
    animation: ember-rise 3s ease-out infinite;
}

@keyframes ember-rise {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(-100px) scale(0.5);
    }
}


/* ===================================
   SALT FLATS - Harsh/Heat/Death
   =================================== */
[data-settlement="salt-flats"],
[data-theme="harsh"],
.theme-harsh {
    --settlement-primary: #f0e6d3;
    --settlement-secondary: #c4a882;
    --settlement-bg: #1a1815;
    --settlement-glow: rgba(240, 230, 211, 0.15);
}

.theme-harsh body,
[data-theme="harsh"] {
    background: linear-gradient(180deg, #1a1815 0%, #221f1a 30%, #1a1815 100%);
}

.theme-harsh::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(255, 240, 200, 0.08) 0%, transparent 50%),
        linear-gradient(180deg, rgba(255, 200, 100, 0.03) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

/* Heat shimmer effect */
.theme-harsh .content {
    animation: heat-shimmer 4s ease-in-out infinite;
}

@keyframes heat-shimmer {

    0%,
    100% {
        filter: blur(0);
    }

    50% {
        filter: blur(0.3px);
    }
}


/* ===================================
   DECODER CAMP - Static/Ghosts
   =================================== */
[data-settlement="decoder-camp"],
[data-theme="static"],
.theme-static {
    --settlement-primary: #88cc88;
    --settlement-secondary: #446644;
    --settlement-bg: #080a08;
    --settlement-glow: rgba(136, 204, 136, 0.2);
}

.theme-static body,
[data-theme="static"] {
    background: #080a08;
}

/* CRT scanlines for Decoder Camp */
.theme-static::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(0deg,
            rgba(0, 0, 0, 0.1) 0px,
            rgba(0, 0, 0, 0.1) 1px,
            transparent 1px,
            transparent 2px);
    pointer-events: none;
    z-index: 1000;
    animation: scanline-flicker 0.1s infinite;
}

@keyframes scanline-flicker {

    0%,
    100% {
        opacity: 0.1;
    }

    50% {
        opacity: 0.15;
    }
}

/* Static noise overlay */
.theme-static .static-noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    pointer-events: none;
    z-index: 999;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}


/* ===================================
   BUNKER 7 - Dr. Chen/Tech/Cold
   =================================== */
[data-settlement="bunker-7"],
[data-theme="bunker"],
.theme-bunker {
    --settlement-primary: #6699cc;
    --settlement-secondary: #335577;
    --settlement-bg: #080810;
    --settlement-glow: rgba(102, 153, 204, 0.2);
}

.theme-bunker body,
[data-theme="bunker"] {
    background: linear-gradient(180deg, #080810 0%, #0a0a15 50%, #080810 100%);
}

/* Emergency light pulse */
.theme-bunker::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 100, 100, 0.3) 50%,
            transparent 100%);
    animation: emergency-scan 3s linear infinite;
    pointer-events: none;
    z-index: 1001;
}

@keyframes emergency-scan {
    0% {
        transform: translateY(0);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}


/* ===================================
   Pilgrim Diagnostic Styling
   =================================== */
.pilgrim-diagnostic {
    background: rgba(10, 8, 6, 0.9);
    border: 1px solid var(--settlement-primary, #CDB87D);
    padding: 20px;
    margin: 30px 0;
    font-family: 'Orbitron', 'Courier Prime', monospace;
}

.diagnostic-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(205, 184, 125, 0.3);
}

.diagnostic-label {
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    color: var(--settlement-primary, #CDB87D);
}

.diagnostic-year {
    font-size: 0.8rem;
    color: var(--settlement-secondary, #8B4513);
}

.diagnostic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.diagnostic-item {
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-left: 2px solid var(--settlement-primary, #CDB87D);
}

.diagnostic-item.warning {
    border-left-color: #c9a227;
}

.diagnostic-item.warning .item-value {
    color: #c9a227;
}

.diagnostic-item.critical {
    border-left-color: #cc4444;
    animation: pulse-critical 1s infinite;
}

.diagnostic-item.critical .item-value {
    color: #cc4444;
}

@keyframes pulse-critical {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.item-label {
    font-size: 0.65rem;
    opacity: 0.7;
    display: block;
    margin-bottom: 5px;
}

.item-value {
    font-size: 0.85rem;
    color: var(--settlement-primary, #CDB87D);
}

.diagnostic-footer {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid rgba(205, 184, 125, 0.2);
    font-size: 0.8rem;
    opacity: 0.8;
    font-style: italic;
}