:root {
    --primary-glow: #00ffff;
    --secondary-glow: #ff00ff;
    --gold-glow: #ffd700;
    --crimson-glow: #dc143c;
    --bg-color: #010007;
    --panel-bg: rgba(0, 5, 20, 0.7);
    --border-color: rgba(0, 255, 255, 0.4);
    --font-main: 'Orbitron', sans-serif;
    --font-mystical: 'Cinzel', serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: #fff;
    font-family: var(--font-main);
    overflow: hidden;
}

#background-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

#vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(0,0,0,0) 50%, rgba(0,0,0,0.9) 100%);
    z-index: -1;
    pointer-events: none;
}

#scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.05) 1px,
        transparent 1px
    );
    background-size: 100% 3px;
    animation: scan 10s linear infinite;
    opacity: 0.5;
    z-index: 1;
    pointer-events: none;
}

#dashboard {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 20px;
    backdrop-filter: blur(3px);
}

.main-header {
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 0 0 10px var(--primary-glow), 0 0 20px var(--primary-glow);
}

.system-title {
    font-family: var(--font-mystical);
    font-size: 2.5rem;
    letter-spacing: 3px;
    position: relative;
    color: var(--gold-glow);
    text-shadow: 0 0 5px var(--gold-glow), 0 0 15px var(--gold-glow), 0 0 30px var(--secondary-glow);
}

.system-subtitle {
    font-size: 1rem;
    color: var(--primary-glow);
    font-family: var(--font-mystical);
    margin-top: 5px;
}

.main-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    gap: 20px;
    flex-grow: 1;
    height: calc(100% - 100px); /* Adjust based on header height */
}

.panel {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.1), inset 0 0 15px rgba(0, 255, 255, 0.1);
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-title {
    text-align: center;
    margin-bottom: 20px;
    font-family: var(--font-main);
    letter-spacing: 2px;
    color: var(--primary-glow);
    text-shadow: 0 0 5px var(--primary-glow);
}

.scan-btn {
    width: calc(100% - 40px);
    margin: -10px auto 15px auto;
    background-color: rgba(0, 255, 255, 0.2);
    border-color: var(--primary-glow);
    cursor: pointer;
    font-weight: bold;
    letter-spacing: 1px;
}

.scan-btn:hover {
    background-color: rgba(0, 255, 255, 0.4);
    box-shadow: 0 0 10px var(--primary-glow);
}

.reset-btn {
    background-color: rgba(220, 20, 60, 0.2);
    border-color: var(--crimson-glow);
}

.reset-btn:hover {
    background-color: rgba(220, 20, 60, 0.4);
    box-shadow: 0 0 10px var(--crimson-glow);
}

.panel-content {
    flex-grow: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-glow) transparent;
}

/* --- Targeting Panel --- */
#add-target-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

input[type="text"], button {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 10px;
    border-radius: 5px;
    font-family: var(--font-main);
    transition: all 0.3s ease;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--gold-glow);
    box-shadow: 0 0 10px var(--gold-glow);
}

.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.file-btn {
    width: 100%;
    cursor: pointer;
}

.file-input-wrapper input[type=file] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.add-btn {
    background-color: rgba(255, 215, 0, 0.2);
    border-color: var(--gold-glow);
    cursor: pointer;
    font-weight: bold;
}
.add-btn:hover {
    background-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 0 10px var(--gold-glow);
}

#targets-list-container h3 {
    text-align: center;
    margin-bottom: 10px;
    color: var(--primary-glow);
}

#targets-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.target-card {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    animation: fadeIn 0.5s ease;
    position: relative;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.target-card.shielded {
    border-color: var(--crimson-glow);
    box-shadow: 0 0 10px var(--crimson-glow);
}

.target-status {
    position: absolute;
    bottom: 5px;
    right: 10px;
    font-size: 0.8rem;
    font-family: var(--font-main);
    color: var(--primary-glow);
    opacity: 0;
    transition: opacity 0.5s;
}

.target-card.shielded .target-status {
    opacity: 1;
    color: var(--crimson-glow);
    text-shadow: 0 0 5px var(--crimson-glow);
}

.remove-target-btn {
    position: absolute;
    top: 5px;
    right: 10px;
    background: none;
    border: none;
    color: var(--primary-glow);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s, text-shadow 0.3s;
}

.remove-target-btn:hover {
    color: var(--crimson-glow);
    text-shadow: 0 0 5px var(--crimson-glow);
}

.target-image {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 15px;
    border: 2px solid var(--primary-glow);
    box-shadow: 0 0 10px var(--primary-glow);
    padding: 2px;
    background: url('ornate_frame.png') center/cover;
}

.target-name {
    font-size: 1.1rem;
    font-family: var(--font-mystical);
}

#add-staged-targets-btn {
    margin-top: 15px;
    width: 100%;
}

#targets-staging-area {
    margin-top: 20px;
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 5px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-glow) transparent;
}

.staged-target-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px;
    border-radius: 5px;
    animation: fadeIn 0.5s ease;
    border: 1px solid var(--border-color);
}

.staged-target-card img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid var(--primary-glow);
}

.staged-target-card input[type="text"] {
    flex-grow: 1;
    margin: 0;
}

.staged-target-card .remove-staged-btn {
    background: none;
    border: none;
    color: var(--primary-glow);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.staged-target-card .remove-staged-btn:hover {
    color: var(--crimson-glow);
    text-shadow: 0 0 5px var(--crimson-glow);
}

/* Layer Controls */
#layer-control-container {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}
#layer-control-container h3 {
    text-align: center;
    margin-bottom: 15px;
    color: var(--gold-glow);
    letter-spacing: 1px;
}
.layer-slider-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}
.layer-slider-wrapper label {
    flex-basis: 90px;
    text-align: right;
    font-size: 0.9rem;
    color: var(--primary-glow);
}
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 5px;
    background: var(--border-color);
    outline: none;
    opacity: 0.7;
    transition: opacity .2s;
    border-radius: 5px;
    border: none;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--gold-glow);
    cursor: pointer;
    box-shadow: 0 0 10px var(--gold-glow);
}
input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--gold-glow);
    cursor: pointer;
    box-shadow: 0 0 10px var(--gold-glow);
    border: none;
}
.layer-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--gold-glow);
    min-width: 60px;
    text-align: right;
}
.amplification-text {
    text-align: center;
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--primary-glow);
}
#amplification-level {
    font-weight: bold;
    color: var(--gold-glow);
    text-shadow: 0 0 5px var(--gold-glow);
}

/* --- Core Panel --- */
#core-panel {
    justify-content: space-between;
    align-items: center;
    text-align: center;
}

.core-visualizer {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    overflow: visible;
}

/* Enhanced fractal antenna visualization */
.core-visualizer::before {
    content: '';
    position: absolute;
    width: 120%;
    height: 120%;
    background: 
        radial-gradient(circle at 30% 30%, rgba(255, 215, 0, 0.3) 2px, transparent 2px),
        radial-gradient(circle at 70% 30%, rgba(220, 20, 60, 0.3) 2px, transparent 2px),
        radial-gradient(circle at 30% 70%, rgba(0, 255, 255, 0.3) 2px, transparent 2px),
        radial-gradient(circle at 70% 70%, rgba(255, 215, 0, 0.3) 2px, transparent 2px),
        radial-gradient(circle at 50% 50%, rgba(220, 20, 60, 0.2) 4px, transparent 4px);
    background-size: 40px 40px, 60px 60px, 80px 80px, 45px 45px, 100px 100px;
    animation: fractalPulse 3s ease-in-out infinite, rotate 20s linear infinite;
    opacity: 0;
    z-index: -1;
}

.core-visualizer.active::before {
    opacity: 1;
}

.fractal-antenna {
    position: absolute;
    width: 150%;
    height: 150%;
    border: 2px solid rgba(255, 215, 0, 0.6);
    border-radius: 50%;
    opacity: 0;
    animation: fractalBroadcast 2s ease-in-out infinite;
}

.fractal-antenna:nth-child(1) {
    animation-delay: 0s;
    border-color: rgba(255, 215, 0, 0.8);
}

.fractal-antenna:nth-child(2) {
    animation-delay: 0.5s;
    border-color: rgba(220, 20, 60, 0.8);
    width: 180%;
    height: 180%;
}

.fractal-antenna:nth-child(3) {
    animation-delay: 1s;
    border-color: rgba(0, 255, 255, 0.8);
    width: 220%;
    height: 220%;
}

/* Enhanced energy broadcasting rings */
#core-rings .ring {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border: 3px solid var(--primary-glow);
    border-radius: 50%;
    opacity: 0.5;
    box-shadow: 0 0 15px var(--primary-glow), inset 0 0 15px var(--primary-glow);
}

#core-rings .ring:nth-child(1) {
    width: 90%;
    height: 90%;
    animation: rotate 20s linear infinite, energyPulse 3s ease-in-out infinite;
    border-width: 4px;
}

#core-rings .ring:nth-child(2) {
    width: 75%;
    height: 75%;
    animation: rotate 15s linear infinite reverse, energyPulse 2.5s ease-in-out infinite;
    animation-delay: 0.5s;
    border-width: 3px;
}

#core-rings .ring:nth-child(3) {
    width: 60%;
    height: 60%;
    animation: rotate 10s linear infinite, energyPulse 2s ease-in-out infinite;
    animation-delay: 1s;
    border-width: 2px;
}

/* Enhanced core symbol with broadcasting energy */
#core-symbol {
    font-size: 4rem;
    color: var(--gold-glow);
    text-shadow: 
        0 0 10px var(--gold-glow), 
        0 0 20px var(--gold-glow),
        0 0 40px var(--crimson-glow),
        0 0 60px var(--primary-glow);
    animation: pulse 4s ease-in-out infinite, energyBroadcast 6s ease-in-out infinite;
    z-index: 2;
    filter: drop-shadow(0 0 20px var(--gold-glow));
}

/* Fractal antenna energy lines */
#core-symbol::before,
#core-symbol::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold-glow), transparent);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.7;
    animation: energyFlow 2s ease-in-out infinite;
}

#core-symbol::after {
    transform: translate(-50%, -50%) rotate(90deg);
    animation-delay: 0.5s;
}

#hebrew-glyphs {
    position: absolute;
    width: 80%;
    height: 80%;
    font-size: 1.5rem;
    font-family: 'Cinzel', serif;
    color: var(--gold-glow);
}

.hebrew-glyph {
    position: absolute;
    opacity: 0;
    text-shadow: 0 0 8px var(--gold-glow);
}

.activation-controls {
    width: 100%;
}

#activation-button {
    width: 80%;
    padding: 15px;
    font-size: 1.2rem;
    font-weight: bold;
    background-color: rgba(220, 20, 60, 0.3);
    border: 1px solid var(--crimson-glow);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 0 5px var(--crimson-glow);
    margin-bottom: 20px;
}

#activation-button:hover {
    background-color: rgba(220, 20, 60, 0.6);
    box-shadow: 0 0 15px var(--crimson-glow);
}

#system-status .status-text {
    font-weight: bold;
}
.status-text.idle { color: var(--primary-glow); }
.status-text.activating { color: var(--gold-glow); animation: pulse 1s infinite; }
.status-text.active { color: var(--crimson-glow); text-shadow: 0 0 10px var(--crimson-glow); }

/* --- Modules & Log Panel --- */
#protection-modules-container {
    position: relative;
    overflow: hidden;
}

#scan-line {
    position: absolute;
    top: -10px;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--gold-glow), transparent);
    box-shadow: 0 0 10px var(--gold-glow);
    opacity: 0;
    z-index: 5;
}

#protection-modules-container.scanning #scan-line {
    opacity: 1;
    animation: scan-anim 2.5s ease-in-out forwards;
}

#protection-modules {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.module-group-title {
    grid-column: 1 / -1;
    margin-top: 15px;
    margin-bottom: 5px;
    padding-bottom: 5px;
    color: var(--gold-glow);
    text-align: left;
    font-size: 1rem;
    letter-spacing: 1px;
    font-family: var(--font-mystical);
    border-bottom: 1px solid var(--border-color);
}
.module-group-title:first-of-type {
    margin-top: 0;
}

.all-check {
    grid-column: 1 / -1;
    font-weight: bold;
    letter-spacing: 2px;
}

.module-check {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.module-check:hover {
    background: rgba(0, 255, 255, 0.2);
}

.module-check.checked {
    background: rgba(0, 255, 255, 0.15);
    box-shadow: 0 0 8px var(--primary-glow);
    border-left: 3px solid var(--primary-glow);
}

.module-check input {
    margin-right: 10px;
    accent-color: var(--primary-glow);
}

#log-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

#log-container h3 {
    text-align: center;
    margin-bottom: 10px;
    color: var(--primary-glow);
}

#log-output {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 5px;
    padding: 10px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.log-entry {
    margin-bottom: 5px;
    opacity: 0;
    animation: slideIn 0.3s forwards;
}

.log-entry.command { color: var(--primary-glow); }
.log-entry.hebrew { color: var(--gold-glow); }
.log-entry.latin { color: #f0f0f0; font-style: italic; }
.log-entry.anuhazi { color: var(--secondary-glow); }
.log-entry.success { color: #00ff00; }
.log-entry.blood { color: var(--crimson-glow); font-weight: bold; }
.log-entry.info { color: #cccccc; }
.log-entry.protocol { color: #87CEEB; }

/* Enhanced Scan Results Styling */
.scan-result-group {
    margin-bottom: 25px;
    background: linear-gradient(145deg, rgba(0, 20, 40, 0.6), rgba(0, 10, 30, 0.4));
    border-radius: 12px;
    padding: 20px;
    border: 2px solid rgba(0, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 255, 255, 0.1);
}

.scan-result-group .module-group-title {
    color: var(--gold-glow);
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 18px;
    padding: 10px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    text-shadow: 0 0 8px var(--gold-glow);
    letter-spacing: 1.5px;
}

.scan-result-item {
    display: grid;
    grid-template-columns: 2fr 1fr 60px;
    align-items: center;
    gap: 15px;
    padding: 15px;
    margin: 12px 0;
    background: linear-gradient(90deg, rgba(0, 40, 80, 0.3), rgba(0, 20, 60, 0.2));
    border-radius: 8px;
    border-left: 4px solid var(--primary-glow);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.scan-result-item:hover {
    background: linear-gradient(90deg, rgba(0, 60, 120, 0.4), rgba(0, 40, 80, 0.3));
    box-shadow: 0 4px 12px rgba(0, 255, 255, 0.2);
    transform: translateY(-2px);
}

.scan-result-item.has-vulnerability {
    border-left-color: var(--crimson-glow);
    background: linear-gradient(90deg, rgba(80, 0, 20, 0.3), rgba(60, 0, 15, 0.2));
}

.scan-module-name {
    font-size: 1rem;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.5);
}

.integrity-bar-container {
    position: relative;
    height: 12px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.integrity-bar {
    height: 100%;
    border-radius: 5px;
    transition: width 0.8s ease;
    box-shadow: 0 0 8px currentColor;
}

.integrity-bar.high {
    background: linear-gradient(90deg, #00ff00, #40ff40);
    color: #00ff00;
}

.integrity-bar.medium {
    background: linear-gradient(90deg, #ffaa00, #ffd700);
    color: #ffaa00;
}

.integrity-bar.low {
    background: linear-gradient(90deg, #ff4444, #ff0000);
    color: #ff4444;
}

.integrity-value {
    font-size: 1.1rem;
    font-weight: bold;
    text-align: right;
    min-width: 50px;
}

.integrity-value.high { color: #00ff00; text-shadow: 0 0 6px #00ff00; }
.integrity-value.medium { color: #ffaa00; text-shadow: 0 0 6px #ffaa00; }
.integrity-value.low { color: #ff4444; text-shadow: 0 0 6px #ff4444; }

.vulnerability-note {
    grid-column: 1 / -1;
    margin-top: 8px;
    padding: 12px;
    background: rgba(220, 20, 60, 0.15);
    border: 1px solid rgba(220, 20, 60, 0.4);
    border-radius: 6px;
    font-size: 0.9rem;
    color: #ffcccc;
    line-height: 1.4;
}

.vulnerability-note span {
    color: var(--crimson-glow);
    font-weight: bold;
    text-shadow: 0 0 4px var(--crimson-glow);
}

.love-solution {
    grid-column: 1 / -1;
    margin-top: 10px;
    padding: 15px;
    background: linear-gradient(135deg, rgba(255, 20, 147, 0.2), rgba(255, 105, 180, 0.1));
    border: 2px solid rgba(255, 20, 147, 0.4);
    border-radius: 8px;
    animation: solutionGlow 3s ease-in-out infinite;
}

.solution-title {
    color: var(--secondary-glow);
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 8px;
    text-shadow: 0 0 8px var(--secondary-glow);
    text-align: center;
    letter-spacing: 1px;
}

.love-solution div:last-child {
    color: #ff69b4;
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: left;
}

/* Enhanced scan results summary */
.scan-summary {
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.1), rgba(255, 215, 0, 0.1));
    border: 2px solid var(--primary-glow);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
    text-align: center;
}

.scan-summary-title {
    color: var(--gold-glow);
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 15px;
    text-shadow: 0 0 10px var(--gold-glow);
}

.scan-summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.scan-stat {
    padding: 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.scan-stat-label {
    font-size: 0.8rem;
    color: var(--primary-glow);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.scan-stat-value {
    font-size: 1.4rem;
    font-weight: bold;
    margin-top: 4px;
}

.scan-stat-value.high { color: #00ff00; }
.scan-stat-value.medium { color: #ffaa00; }
.scan-stat-value.low { color: #ff4444; }

/* --- Activation Overlay --- */
#activation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0,0,0,0.9);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-in-out;
}
#activation-overlay.visible {
    opacity: 1;
    pointer-events: all;
}
#overlay-text {
    font-size: 3rem;
    font-family: var(--font-mystical);
    text-align: center;
    opacity: 0;
    transform: scale(0.8);
}

/* --- Scan Modal --- */
.scan-overlay-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0,10,20,0.8);
    backdrop-filter: blur(5px);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-in-out;
}

.scan-overlay-container.visible {
    opacity: 1;
    pointer-events: all;
}

#scan-results-modal {
    width: 90%;
    max-width: 800px;
    height: 80%;
    max-height: 80vh;
    transform: scale(0.9);
    transition: transform 0.5s ease-in-out;
    position: relative;
    padding-bottom: 80px; /* Space for footer */
}

.scan-overlay-container.visible #scan-results-modal {
    transform: scale(1);
}

#close-scan-modal-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2.5rem;
    color: var(--primary-glow);
    cursor: pointer;
    line-height: 1;
    padding: 5px;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

#close-scan-modal-btn:hover {
    color: var(--crimson-glow);
    text-shadow: 0 0 8px var(--crimson-glow);
}

#scan-results-content {
    padding-right: 10px;
}

.modal-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    text-align: center;
    background: var(--panel-bg);
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 10px 10px;
}

#correct-anomalies-btn {
    width: 60%;
    padding: 12px;
    font-size: 1rem;
    font-weight: bold;
    letter-spacing: 1px;
    transition: background-color 0.3s, border-color 0.3s, opacity 0.3s;
}

#correct-anomalies-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    background-color: rgba(128,128,128,0.2);
    border-color: grey;
    box-shadow: none;
}

.offensive-love-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid var(--secondary-glow);
    background: rgba(255, 20, 147, 0.05);
    border-radius: 8px;
    padding: 15px;
}

.offensive-love-section h3 {
    text-align: center;
    margin-bottom: 15px;
    color: var(--secondary-glow);
    text-shadow: 0 0 10px var(--secondary-glow);
    letter-spacing: 2px;
    animation: lovePulse 2s ease-in-out infinite;
}

.love-code-text {
    text-align: center;
    margin: 10px 0;
    font-size: 0.9rem;
    color: var(--secondary-glow);
    font-weight: bold;
}

#love-code {
    color: #ff1493;
    text-shadow: 0 0 8px #ff1493;
    letter-spacing: 2px;
}

.love-btn {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    background: linear-gradient(45deg, rgba(255, 20, 147, 0.3), rgba(255, 105, 180, 0.3));
    border: 2px solid var(--secondary-glow);
    color: white;
    font-weight: bold;
    font-size: 1rem;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-shadow: 0 0 5px var(--secondary-glow);
}

.love-btn:hover {
    background: linear-gradient(45deg, rgba(255, 20, 147, 0.6), rgba(255, 105, 180, 0.6));
    box-shadow: 0 0 20px var(--secondary-glow), 0 0 40px rgba(255, 105, 180, 0.5);
    transform: scale(1.02);
}

.love-warfare-modes {
    margin: 15px 0;
    padding: 10px;
    background: rgba(255, 20, 147, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(255, 20, 147, 0.3);
}

.love-warfare-modes h4 {
    text-align: center;
    margin-bottom: 10px;
    color: var(--secondary-glow);
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.warfare-mode-check {
    display: flex;
    align-items: center;
    margin: 8px 0;
    cursor: pointer;
    font-size: 0.9rem;
    color: #ff69b4;
}

.warfare-mode-check input {
    margin-right: 8px;
    accent-color: var(--secondary-glow);
}

.warfare-mode-check:hover {
    color: var(--secondary-glow);
}

.love-btn-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
}

.love-btn.secondary {
    background: linear-gradient(45deg, rgba(255, 105, 180, 0.3), rgba(255, 20, 147, 0.3));
    border: 2px solid #FF69B4;
    font-size: 0.9rem;
    color: #FF69B4;
    text-shadow: 0 0 10px #FF69B4, 0 0 20px var(--secondary-glow);
}

.love-btn.secondary:hover {
    background: linear-gradient(45deg, rgba(255, 105, 180, 0.6), rgba(255, 20, 147, 0.6));
    box-shadow: 0 0 20px #FF69B4, 0 0 40px rgba(255, 105, 180, 0.5);
}

.love-btn.ultimate {
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.2), rgba(255, 20, 147, 0.3), rgba(0, 255, 255, 0.3));
    border: 3px solid #FFD700;
    font-size: 0.85rem;
    color: #FFD700;
    text-shadow: 0 0 10px #FFD700, 0 0 20px #FF1493;
    animation: ultimatePulse 2s ease-in-out infinite;
}

.love-btn.ultimate:hover {
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.4), rgba(255, 20, 147, 0.6), rgba(0, 255, 255, 0.6));
    box-shadow: 0 0 30px #FFD700, 0 0 60px rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

@keyframes ultimatePulse {
    0%, 100% { 
        border-color: #FFD700;
        text-shadow: 0 0 10px #FFD700, 0 0 20px #FF1493;
    }
    50% { 
        border-color: #FF1493;
        text-shadow: 0 0 15px #FF1493, 0 0 30px #FFD700, 0 0 45px #FFFFFF;
    }
}

/* Prayer attack visual effects */
.prayer-attack-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid var(--gold-glow);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3), inset 0 0 10px rgba(255, 255, 255, 0.1);
}

.prayer-attack-section h3 {
    text-align: center;
    margin-bottom: 15px;
    color: var(--gold-glow);
    text-shadow: 0 0 15px var(--gold-glow), 0 0 30px rgba(255, 255, 255, 0.5);
    letter-spacing: 2px;
    animation: prayerPulse 3s ease-in-out infinite;
    font-size: 1.1rem;
}

.prayer-code-text {
    text-align: center;
    margin: 15px 0;
    font-size: 0.9rem;
    color: var(--gold-glow);
    font-weight: bold;
}

#prayer-code {
    color: #FFD700;
    text-shadow: 0 0 10px #FFD700, 0 0 20px #FFFFFF;
    letter-spacing: 2px;
    animation: divineGlow 2s ease-in-out infinite;
}

.prayer-attack-modes {
    margin: 15px 0;
    padding: 10px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: 6px;
    border: 1px solid rgba(255, 215, 0, 0.4);
}

.prayer-attack-modes h4 {
    text-align: center;
    margin-bottom: 10px;
    color: var(--gold-glow);
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-shadow: 0 0 8px var(--gold-glow);
}

.prayer-attack-btn {
    width: 100%;
    padding: 14px;
    margin-top: 12px;
    background: linear-gradient(45deg, rgba(255, 215, 0, 0.4), rgba(255, 255, 255, 0.2), rgba(255, 215, 0, 0.4));
    border: 3px solid var(--gold-glow);
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s ease;
    text-shadow: 0 0 8px var(--gold-glow), 0 0 16px rgba(255, 255, 255, 0.8);
    animation: prayerButtonPulse 4s ease-in-out infinite;
}

.prayer-attack-btn:hover {
    background: linear-gradient(45deg, rgba(255, 215, 0, 0.8), rgba(255, 255, 255, 0.6), rgba(255, 215, 0, 0.8));
    box-shadow: 0 0 30px var(--gold-glow), 0 0 60px rgba(255, 255, 255, 0.8), 0 0 90px rgba(255, 215, 0, 0.6);
    transform: scale(1.03);
    border-color: #FFFFFF;
}

.prayer-attack-btn.secondary {
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.3), rgba(255, 215, 0, 0.3), rgba(0, 255, 255, 0.2));
    border: 2px solid #00FFFF;
    font-size: 1rem;
    color: #00FFFF;
    text-shadow: 0 0 10px #00FFFF, 0 0 20px var(--gold-glow);
}

.prayer-attack-btn.secondary:hover {
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.6), rgba(255, 215, 0, 0.6), rgba(0, 255, 255, 0.5));
    box-shadow: 0 0 25px #00FFFF, 0 0 50px var(--gold-glow), 0 0 75px rgba(255, 255, 255, 0.7);
}

.prayer-attack-btn.ultimate {
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.4), rgba(255, 20, 147, 0.5), rgba(0, 255, 255, 0.3));
    border: 3px solid #FFFFFF;
    font-size: 1rem;
    color: #FFFFFF;
    text-shadow: 0 0 15px #FFFFFF, 0 0 30px var(--gold-glow), 0 0 45px #FF1493;
    animation: ultimatePrayerPulse 2.5s ease-in-out infinite;
}

.prayer-attack-btn.ultimate:hover {
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.8), rgba(255, 215, 0, 0.8), rgba(255, 20, 147, 0.6), rgba(0, 255, 255, 0.6));
    box-shadow: 0 0 40px #FFFFFF, 0 0 80px var(--gold-glow), 0 0 120px #FF1493, 0 0 160px rgba(0, 255, 255, 0.8);
    transform: scale(1.05);
}

@keyframes ultimatePrayerPulse {
    0%, 100% { 
        border-color: #FFFFFF;
        text-shadow: 0 0 15px #FFFFFF, 0 0 30px var(--gold-glow), 0 0 45px #FF1493;
    }
    33% { 
        border-color: var(--gold-glow);
        text-shadow: 0 0 25px var(--gold-glow), 0 0 50px #FFFFFF, 0 0 75px #00FFFF;
    }
    66% { 
        border-color: #00FFFF;
        text-shadow: 0 0 35px #00FFFF, 0 0 70px var(--gold-glow), 0 0 105px #FF1493, 0 0 140px #FFFFFF;
    }
}

/* Prayer attack visual effects */
.prayer-wave-effect {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    border: 3px solid var(--gold-glow);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
    z-index: 95;
}

/* --- Animations --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

@keyframes scan {
    from { background-position-y: 0; }
    to { background-position-y: -100px; }
}

@keyframes scan-anim {
    from {
        top: 0;
        opacity: 1;
    }
    to {
        top: 100%;
        opacity: 1;
    }
}

/* Enhanced fractal antenna animations */
@keyframes fractalPulse {
    0%, 100% { 
        opacity: 0.3; 
        transform: scale(1) rotate(0deg); 
    }
    50% { 
        opacity: 0.8; 
        transform: scale(1.1) rotate(180deg); 
    }
}

@keyframes fractalBroadcast {
    0% { 
        opacity: 0; 
        transform: scale(0.8); 
        border-width: 4px;
    }
    50% { 
        opacity: 1; 
        transform: scale(1.2); 
        border-width: 2px;
    }
    100% { 
        opacity: 0; 
        transform: scale(1.5); 
        border-width: 1px;
    }
}

@keyframes energyPulse {
    0%, 100% { 
        box-shadow: 0 0 15px var(--primary-glow), inset 0 0 15px var(--primary-glow);
        border-color: var(--primary-glow);
    }
    33% { 
        box-shadow: 0 0 25px var(--gold-glow), inset 0 0 25px var(--gold-glow);
        border-color: var(--gold-glow);
    }
    66% { 
        box-shadow: 0 0 35px var(--crimson-glow), inset 0 0 35px var(--crimson-glow);
        border-color: var(--crimson-glow);
    }
}

@keyframes energyBroadcast {
    0%, 100% { 
        filter: drop-shadow(0 0 20px var(--gold-glow));
    }
    25% { 
        filter: drop-shadow(0 0 30px var(--crimson-glow)) drop-shadow(0 0 15px var(--gold-glow));
    }
    50% { 
        filter: drop-shadow(0 0 40px var(--primary-glow)) drop-shadow(0 0 20px var(--crimson-glow));
    }
    75% { 
        filter: drop-shadow(0 0 35px var(--gold-glow)) drop-shadow(0 0 25px var(--primary-glow));
    }
}

@keyframes energyFlow {
    0%, 100% { 
        opacity: 0.3;
        transform: translate(-50%, -50%) scaleX(0.5);
    }
    50% { 
        opacity: 1;
        transform: translate(-50%, -50%) scaleX(1.5);
    }
}

@keyframes lovePulse {
    0%, 100% { 
        color: var(--secondary-glow);
        text-shadow: 0 0 10px var(--secondary-glow);
    }
    50% { 
        color: #ff1493;
        text-shadow: 0 0 20px #ff1493, 0 0 30px #ff69b4;
    }
}

@keyframes divineGlow {
    0%, 100% { 
        color: #FFD700;
        text-shadow: 0 0 10px #FFD700, 0 0 20px #FFFFFF;
    }
    50% { 
        color: #FFFFFF;
        text-shadow: 0 0 20px #FFFFFF, 0 0 40px #FFD700, 0 0 60px rgba(0, 255, 255, 0.8);
    }
}

@keyframes prayerButtonPulse {
    0%, 100% { 
        border-color: var(--gold-glow);
        text-shadow: 0 0 8px var(--gold-glow), 0 0 16px rgba(255, 255, 255, 0.8);
    }
    25% { 
        border-color: #FFFFFF;
        text-shadow: 0 0 12px #FFFFFF, 0 0 24px var(--gold-glow), 0 0 36px rgba(0, 255, 255, 0.6);
    }
    50% { 
        border-color: #00FFFF;
        text-shadow: 0 0 16px #00FFFF, 0 0 32px var(--gold-glow), 0 0 48px rgba(255, 255, 255, 0.9);
    }
    75% { 
        border-color: var(--gold-glow);
        text-shadow: 0 0 20px var(--gold-glow), 0 0 40px #FFFFFF;
    }
}

@keyframes ultimatePrayerPulse {
    0%, 100% { 
        border-color: #FFFFFF;
        text-shadow: 0 0 15px #FFFFFF, 0 0 30px var(--gold-glow), 0 0 45px #FF1493;
    }
    33% { 
        border-color: var(--gold-glow);
        text-shadow: 0 0 25px var(--gold-glow), 0 0 50px #FFFFFF, 0 0 75px #00FFFF;
    }
    66% { 
        border-color: #00FFFF;
        text-shadow: 0 0 35px #00FFFF, 0 0 70px var(--gold-glow), 0 0 105px #FF1493, 0 0 140px #FFFFFF;
    }
}