/* ============================================ */
/* BUILDINGS.CSS - Quantum Charger, CC Status  */
/* Bars, Coin Display, Battery, Solar Panel,   */
/* Research Lab, Miner, Building Preview       */
/* ============================================ */

/* ============================================ */
/* BUILDING LEVEL INDICATOR                    */
/* ============================================ */
.building-level {
    position: absolute;
    right: 0;
    bottom: -2px;
    width: 14px;
    height: 14px;
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    font-weight: bold;
    font-family: 'Times New Roman', serif;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 0 2px #000, 0 0 4px #000;
    z-index: 10;
    pointer-events: none;
}
.coding-tower .building-level {
    right: -1px;
}
.shield-emitter-container .building-level {
    right: 1px;
}

/* ============================================ */
/* BUILDING DEACTIVATED PAUSE INDICATOR        */
/* ============================================ */
.building-paused {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 15px;
    height: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    z-index: 11;
    pointer-events: none;
}

.building-paused::before,
.building-paused::after {
    content: '';
    width: 4px;
    height: 12px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 1px;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
}

/* ============================================ */
/* QUANTUM CHARGER - Shield Recharger Building */
/* ============================================ */
.quantum-charger-container {
    pointer-events: none;
    width: 80px;
    height: 80px;
    position: relative;
}

.quantum-field {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(68, 170, 255, 0.25) 0%, transparent 60%);
    animation: quantumFieldPulse 3s ease-in-out infinite;
}

@keyframes quantumFieldPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
}

.quantum-base {
    position: absolute;
    left: 50%;
    bottom: 8px;
    transform: translateX(-50%);
    width: 40px;
    height: 12px;
    background: linear-gradient(180deg, #5a6a8a 0%, #3a4a6a 100%);
    border-radius: 50%;
}

.quantum-pillar {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    width: 14px;
    height: 25px;
    background: linear-gradient(90deg, #4a5a7a 0%, #6a7a9a 50%, #4a5a7a 100%);
    border-radius: 3px;
}

.quantum-ring-container {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
}

.quantum-ring {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid;
    border-radius: 50%;
    animation: quantumRotate 4s linear infinite;
}

.quantum-ring-1 {
    width: 45px;
    height: 45px;
    border-color: rgba(68, 170, 255, 0.6);
    animation-direction: normal;
}

.quantum-ring-2 {
    width: 35px;
    height: 35px;
    border-color: rgba(136, 200, 255, 0.7);
    animation-direction: reverse;
    animation-duration: 3s;
}

.quantum-ring-3 {
    width: 25px;
    height: 25px;
    border-color: rgba(170, 220, 255, 0.8);
    animation-duration: 2s;
}

@keyframes quantumRotate {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.quantum-core {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: radial-gradient(circle, #ffffff 0%, #88ddff 30%, #44aaff 70%, #2266aa 100%);
    border-radius: 50%;
    box-shadow: 0 0 15px #44aaff, 0 0 25px rgba(68, 170, 255, 0.5);
    animation: quantumCorePulse 1.5s ease-in-out infinite;
}

@keyframes quantumCorePulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 15px #44aaff; }
    50% { transform: translate(-50%, -50%) scale(1.15); box-shadow: 0 0 25px #66ccff, 0 0 35px #44aaff; }
}

.quantum-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #88ddff;
    border-radius: 50%;
    animation: quantumParticle 2s ease-in-out infinite;
}

.quantum-particle-1 { left: 10px; top: 20px; animation-delay: 0s; }
.quantum-particle-2 { right: 10px; top: 25px; animation-delay: 0.4s; }
.quantum-particle-3 { left: 15px; bottom: 25px; animation-delay: 0.8s; }
.quantum-particle-4 { right: 15px; bottom: 20px; animation-delay: 1.2s; }

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

/* Ensure quantum charger doesn't block clicks */
.quantum-charger-container,
.quantum-charger-container * {
    pointer-events: none !important;
}

/* ============================================ */
/* COMMAND CENTER STATUS BARS - Design 6      */
/* Futuristisch mit Puls-Animation            */
/* ============================================ */
.cc-status-container {
    position: absolute;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: none;
    transform: translateX(-50%);
}

.cc-status-bar {
    position: relative;
    width: 140px;
    height: 22px;
}

.cc-bar-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        rgba(0,0,0,0.85) 0%,
        rgba(20,20,40,0.85) 50%,
        rgba(0,0,0,0.85) 100%);
    clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}

.cc-bar-border {
    position: absolute;
    inset: 0;
    border: 2px solid;
    clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}

.cc-status-bar.health .cc-bar-border { border-color: #ff4444; }
.cc-status-bar.shield .cc-bar-border { border-color: #4488ff; }

.cc-bar-fill {
    position: absolute;
    top: 3px;
    left: 6px;
    bottom: 3px;
    clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
    transition: width 0.2s ease-out;
}

.cc-status-bar.health .cc-bar-fill {
    background: linear-gradient(90deg, #aa2222, #ff4444, #ff6666);
    box-shadow: 0 0 12px rgba(255, 68, 68, 0.6);
    animation: ccBarPulse 2s ease-in-out infinite;
}

.cc-status-bar.shield .cc-bar-fill {
    background: linear-gradient(90deg, #2244aa, #4488ff, #66aaff);
    box-shadow: 0 0 12px rgba(68, 136, 255, 0.6);
    animation: ccBarPulse 2s ease-in-out infinite;
}

@keyframes ccBarPulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

.cc-bar-glow {
    position: absolute;
    top: -2px;
    bottom: -2px;
    left: 0;
    clip-path: polygon(7px 0, 100% 0, calc(100% - 7px) 100%, 0 100%);
    opacity: 0.25;
    animation: ccGlowPulse 2s ease-in-out infinite;
    pointer-events: none;
}

.cc-status-bar.health .cc-bar-glow {
    background: radial-gradient(ellipse at right, #ff4444, transparent 70%);
}

.cc-status-bar.shield .cc-bar-glow {
    background: radial-gradient(ellipse at right, #4488ff, transparent 70%);
}

@keyframes ccGlowPulse {
    0%, 100% { opacity: 0.25; }
    50% { opacity: 0.5; }
}

.cc-bar-value {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    z-index: 10;
    text-shadow: 0 0 4px #000, 0 0 2px #000;
}

.cc-status-bar.health .cc-bar-value { color: #ffdddd; }
.cc-status-bar.shield .cc-bar-value { color: #ddeeff; }

.cc-bar-rate {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    z-index: 10;
    text-shadow: 0 0 4px #000, 0 0 2px #000;
}

.cc-status-bar.health .cc-bar-rate { color: #aaffaa; }
.cc-status-bar.shield .cc-bar-rate { color: #aaffaa; }

/* ============================================ */
/* 3D FLIP COIN - Design 1                    */
/* ============================================ */
.coin-3d {
    display: inline-block;
    position: relative;
    transform-style: preserve-3d;
    animation: coinSpin 2s linear infinite;
    vertical-align: middle;
    margin-right: 4px;
}
.coin-3d-face {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    backface-visibility: hidden;
}
.coin-3d-front {
    background: radial-gradient(circle at 30% 30%, #ffec80 0%, #ffd700 40%, #b8860b 100%);
    box-shadow: inset 0 0 0 2px #daa520, inset 0 0 8px rgba(0,0,0,0.3);
}
.coin-3d-back {
    background: radial-gradient(circle at 70% 70%, #ffec80 0%, #ffd700 40%, #b8860b 100%);
    box-shadow: inset 0 0 0 2px #daa520, inset 0 0 8px rgba(0,0,0,0.3);
    transform: rotateY(180deg);
}
@keyframes coinSpin {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

/* Main coin display (top left) - 28px */
.coin-display-container {
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}
.coin-display-coin {
    width: 28px;
    height: 28px;
}
.coin-display-value {
    font-size: 24px;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5), 2px 2px 2px rgba(0,0,0,0.5);
    font-family: Arial, sans-serif;
}

/* Small coin for buttons/prices - 16px */
.coin-3d.coin-small {
    width: 16px;
    height: 16px;
}

/* Medium coin - 20px */
.coin-3d.coin-medium {
    width: 20px;
    height: 20px;
}

/* Tiny coin - 12px */
.coin-3d.coin-tiny {
    width: 12px;
    height: 12px;
}

/* ============================================ */
/* BUILDING: Battery (Design 2 - Zylinder)    */
/* ============================================ */
.building-battery {
    width: 24px;
    height: 38px;
    position: relative;
}
.battery-body {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 34px;
    background: linear-gradient(90deg, #2a2a3a 0%, #4a4a5a 30%, #4a4a5a 70%, #2a2a3a 100%);
    border-radius: 5px;
}
.battery-cap {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 6px;
    background: linear-gradient(180deg, #6a6a7a, #4a4a5a);
    border-radius: 3px 3px 0 0;
}
.battery-level {
    position: absolute;
    bottom: 3px;
    left: 3px;
    right: 3px;
    height: 65%;
    background: linear-gradient(180deg, #66ff66 0%, #44aa44 50%, #228822 100%);
    border-radius: 3px;
    box-shadow: 0 0 8px rgba(68, 255, 68, 0.5);
    transition: height 0.3s;
}
.battery-shine {
    position: absolute;
    top: 8px;
    left: 3px;
    width: 3px;
    height: 18px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
}
.battery-level-low { height: 25%; background: linear-gradient(180deg, #ff6666 0%, #aa4444 50%, #882222 100%); box-shadow: 0 0 8px rgba(255, 68, 68, 0.5); }
.battery-level-medium { height: 50%; background: linear-gradient(180deg, #ffaa66 0%, #aa7744 50%, #886622 100%); box-shadow: 0 0 8px rgba(255, 170, 68, 0.5); }

/* ============================================ */
/* BUILDING: Solar Panel (Design 1 + Stand)   */
/* ============================================ */
.building-solar {
    width: 36px;
    height: 38px;
    position: relative;
}
.solar-stand {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 14px;
    background: linear-gradient(90deg, #5a5a5a, #7a7a7a, #5a5a5a);
}
.solar-panel {
    position: absolute;
    top: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 34px;
    height: 24px;
    background: linear-gradient(180deg, #1a1a3a 0%, #2a2a4a 100%);
    border: 2px solid #4a4a6a;
    border-radius: 2px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 1px;
    padding: 2px;
    transform-origin: center bottom;
}
.solar-cell {
    background: linear-gradient(135deg, #3344aa 0%, #2233aa 50%, #1122aa 100%);
    border-radius: 1px;
    animation: solarShine 3s ease-in-out infinite;
}
.solar-cell:nth-child(odd) { animation-delay: 0.5s; }
@keyframes solarShine {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; box-shadow: inset 0 0 5px rgba(100,150,255,0.5); }
}

/* ============================================ */
/* BUILDING: Research Lab (Design 1)          */
/* ============================================ */
.building-research {
    width: 36px;
    height: 38px;
    position: relative;
}
.research-building {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 28px;
    background: linear-gradient(180deg, #5a4a6a 0%, #3a2a4a 100%);
    border-radius: 4px 4px 0 0;
}
.research-dome {
    position: absolute;
    top: -7px;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 13px;
    background: linear-gradient(180deg, #8a6aaa 0%, #5a4a6a 100%);
    border-radius: 50% 50% 0 0;
}
.research-window {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 8px;
    background: #aa44ff;
    border-radius: 2px;
    animation: researchGlow 2s ease-in-out infinite;
}
@keyframes researchGlow {
    0%, 100% { box-shadow: 0 0 5px #aa44ff; }
    50% { box-shadow: 0 0 15px #aa44ff, inset 0 0 10px rgba(255,255,255,0.3); }
}
.research-door {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 10px;
    background: #2a1a3a;
    border-radius: 2px 2px 0 0;
}

/* ============================================ */
/* BUILDING: Miner (Design 2 - Laser)         */
/* ============================================ */
.building-miner {
    width: 36px;
    height: 38px;
    position: relative;
}
.miner-platform {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 12px;
    background: linear-gradient(180deg, #6a5a4a, #4a3a2a);
    border-radius: 4px;
}
.miner-emitter {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 20px;
    background: linear-gradient(180deg, #7a6a5a, #5a4a3a);
    border-radius: 4px 4px 0 0;
}
.miner-lens {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 9px;
    height: 9px;
    background: radial-gradient(circle, #ffcc00, #ff8800);
    border-radius: 50%;
    box-shadow: 0 0 6px #ffaa00;
}
.miner-laser {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 0;
    background: linear-gradient(180deg, #ffaa00, #ff4400);
    box-shadow: 0 0 8px #ff6600;
    animation: minerLaser 1s ease-in-out infinite;
}
@keyframes minerLaser {
    0%, 100% { height: 0; opacity: 0.5; }
    50% { height: 12px; opacity: 1; }
}
.miner-details {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 8px;
    background: #3a3a4a;
    border-radius: 2px;
}
.miner-light {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 4px;
    height: 4px;
    background: #ff4444;
    border-radius: 50%;
    animation: minerBlink 1s ease-in-out infinite;
}
@keyframes minerBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Building preview overlay */
.building-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(68, 255, 68, 0.25);
    pointer-events: none;
    z-index: 10;
}
.building-preview-invalid .building-preview-overlay {
    background: rgba(255, 68, 68, 0.25);
}

/* End Wave Button disabled state */
.game-btn.end-wave-game-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.game-btn.end-wave-game-btn.disabled::before {
    opacity: 0.2;
    animation: none;
}

/* ============================================ */
/* STEALTH BUNKER - Command Center             */
/* ============================================ */
.base-stealth-bunker {
    width: 90px;
    height: 100px;
    position: relative;
}
.base-stealth-bunker .sb-ground {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 85px;
    height: 8px;
    background: linear-gradient(180deg, #3a3a3a, #2a2a2a);
    border-radius: 2px;
}
.base-stealth-bunker .sb-bunker {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 75px;
    height: 35px;
    background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
    border-radius: 5px 5px 0 0;
    border: 2px solid #3a3a3a;
}
.base-stealth-bunker .sb-camo-stripe {
    position: absolute;
    height: 4px;
    background: #333;
    opacity: 0.5;
}
.base-stealth-bunker .sb-camo-stripe:nth-child(1) { top: 8px; left: 5px; width: 20px; }
.base-stealth-bunker .sb-camo-stripe:nth-child(2) { top: 15px; right: 8px; width: 25px; }
.base-stealth-bunker .sb-camo-stripe:nth-child(3) { top: 22px; left: 12px; width: 18px; }
.base-stealth-bunker .sb-slit {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 6px;
    background: #0a0a0a;
    border: 1px solid #2a2a2a;
}
.base-stealth-bunker .sb-slit::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: #ff0000;
    opacity: 0.8;
    box-shadow: 0 0 10px #ff0000;
    animation: sbScan 3s ease-in-out infinite;
}
.base-stealth-bunker .sb-dish {
    position: absolute;
    bottom: 39px;
    left: 20px;
    width: 15px;
    height: 8px;
    background: #3a3a3a;
    border-radius: 50% 50% 0 0;
}
.base-stealth-bunker .sb-antenna {
    position: absolute;
    bottom: 39px;
    right: 18px;
    width: 3px;
    height: 20px;
    background: #4a4a4a;
}
.base-stealth-bunker .sb-antenna::after {
    content: '';
    position: absolute;
    top: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    background: #00ff00;
    border-radius: 50%;
    opacity: 0;
    animation: sbBlink 2s ease-in-out infinite;
}
.base-stealth-bunker .sb-vent {
    position: absolute;
    bottom: 39px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 6px;
    background: #1a1a1a;
    display: flex;
    justify-content: space-between;
}
.base-stealth-bunker .sb-vent span {
    width: 2px;
    height: 100%;
    background: #3a3a3a;
}
@keyframes sbScan {
    0%, 100% { width: 20px; opacity: 0.8; }
    50% { width: 5px; opacity: 0.3; }
}
@keyframes sbBlink {
    0%, 45%, 55%, 100% { opacity: 0; }
    50% { opacity: 1; }
}
