/* Game UI Styles */

/* Ability Shop Styles */
.ability-shop-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.ability-shop-content {
    max-width: 1200px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
}

.shop-title {
    font-family: 'Orbitron', monospace;
    font-size: 2.5rem;
    text-align: center;
    color: #00ffff;
    margin-bottom: 10px;
}

.shop-subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: #ffff00;
    margin-bottom: 30px;
}

.ability-slots {
    margin-bottom: 40px;
}

.ability-slots h3 {
    font-family: 'Orbitron', monospace;
    color: #00ff00;
    margin-bottom: 15px;
}

.slots-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
}

.ability-slot-display {
    width: 150px;
    height: 150px;
    border: 3px solid #555;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(0, 0, 0, 0.5);
}

.ability-slot-display:hover {
    border-color: #00ffff;
    transform: scale(1.05);
}

.ability-slot-display.selected {
    border-color: #ffff00;
    box-shadow: 0 0 20px #ffff00;
}

.ability-slot-display.filled {
    background: rgba(0, 100, 100, 0.3);
}

.slot-number {
    position: absolute;
    top: 5px;
    left: 10px;
    font-size: 1.5rem;
    color: #888;
    font-weight: bold;
}

.slot-content {
    text-align: center;
}

.slot-content i {
    font-size: 2rem;
    color: #00ffff;
    margin-bottom: 5px;
}

.slot-empty {
    color: #666;
    font-style: italic;
}

.available-abilities h3 {
    font-family: 'Orbitron', monospace;
    color: #00ff00;
    margin-bottom: 15px;
}

.abilities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.ability-card {
    padding: 20px;
    background: rgba(0, 50, 100, 0.3);
    transition: all 0.3s;
}

.ability-card:hover:not(.is-disabled) {
    transform: scale(1.02);
    background: rgba(0, 100, 200, 0.4);
}

.ability-card.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ability-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.ability-icon {
    font-size: 2rem;
    color: #00ffff;
}

.ability-header h4 {
    font-family: 'Orbitron', monospace;
    color: #fff;
    margin: 0;
}

.ability-description {
    color: #ccc;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.ability-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.ability-cost, .ability-energy, .ability-cooldown {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #aaa;
}

.ability-energy {
    color: #ffff00;
}

.ability-buy-btn {
    width: 100%;
}

.shop-actions {
    text-align: center;
    margin-top: 30px;
}

/* Particles background */
#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* Game container */
#game-container {
    position: relative;
    z-index: 1;
}

/* UI Overlay */
#ui-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

#ui-overlay > * {
    pointer-events: auto;
}

/* Glass effect for panels */
.glass-effect {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
}

/* HUD Panel */
.hud-panel {
    position: absolute;
    top: 20px;
    left: 20px;
    min-width: 300px;
}

/* Mission Panel */
.mission-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    min-width: 250px;
    max-width: 350px;
}

/* Wave Indicator */
.wave-indicator {
    display: none; /* Hidden as we have the blue version */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.wave-title {
    font-family: 'Orbitron', monospace;
    font-size: 48px;
    font-weight: 900;
    color: #ffaa00;
    text-shadow: 0 0 20px rgba(255, 170, 0, 0.8);
    margin: 0;
}

/* Disaster Warning */
.disaster-warning {
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1001;
}

.warning-content {
    font-family: 'Orbitron', monospace;
    font-size: 36px;
    font-weight: 700;
    color: #ff0000;
    text-shadow: 0 0 20px rgba(255, 0, 0, 0.8);
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Disaster Indicator - Positioned under mission panel */
.disaster-indicator {
    position: absolute;
    top: 180px; /* Under mission panel which ends around 150px */
    right: 20px;
    min-width: 250px;
    max-width: 350px;
    z-index: 999;
}

.disaster-content {
    text-align: center;
}

.disaster-name {
    font-family: 'Orbitron', monospace;
    font-size: 20px;
    font-weight: 700;
    color: #ff6600;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.disaster-timer {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 10px;
}

.disaster-timer-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff0000, #ff6600);
    transition: width 0.1s linear;
}

/* Status bars */
.status-bars {
    margin-bottom: 15px;
}

.bar-container {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.bar-icon {
    width: 20px;
    margin-right: 10px;
    text-align: center;
}

.bar {
    flex: 1;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.bar-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.health-fill {
    background: linear-gradient(90deg, #ff0000, #ff6666);
}

.health-fill.low {
    animation: pulse 1s infinite;
}

.energy-fill {
    background: linear-gradient(90deg, #0066ff, #00ccff);
}

.bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    color: white;
    font-weight: bold;
}

/* Stats row */
.stats-row {
    display: flex;
    justify-content: space-around;
    margin-top: 10px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: white;
}

/* Upgrade bar */
.upgrade-bar {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}

.upgrade-btn {
    font-size: 12px;
    padding: 5px 10px;
    transition: opacity 0.3s ease;
}

.upgrade-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    filter: grayscale(50%);
}

/* Mission objectives */
.mission-title {
    font-family: 'Orbitron', monospace;
    font-size: 18px;
    margin: 0 0 10px 0;
    color: #00ff00;
}

.objective-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 5px 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.objective-item.completed {
    color: #00ff00;
    text-decoration: line-through;
}

.objective-progress {
    color: #ffaa00;
    font-size: 12px;
}

/* Abilities */
.ability-bar {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.ability-slot {
    width: 60px;
    height: 60px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    position: relative;
    background: rgba(0, 0, 0, 0.5);
    transition: all 0.3s;
}

.ability-slot.ready {
    border-color: #00ff00;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.ability-slot.on-cooldown {
    opacity: 0.5;
}

.ability-slot.no-energy {
    border-color: #ff6600;
}

.ability-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    color: white;
}

.ability-cooldown {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 18px;
    font-weight: bold;
}

.ability-key {
    position: absolute;
    top: 2px;
    left: 2px;
    font-size: 12px;
    color: white;
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 4px;
    border-radius: 4px;
}

.ability-cost {
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 10px;
    color: #00ccff;
}

/* Charge indicator */
.charge-indicator {
    position: fixed;
    top: calc(50% - 50px);
    left: calc(50% - 50px);
    pointer-events: none;
    width: 100px;
    height: 100px;
    z-index: 1000;
}

.charge-ring {
    width: 100px;
    height: 100px;
    position: relative;
}

.charge-ring svg {
    width: 100px;
    height: 100px;
    transform: rotate(-90deg);
    position: absolute;
    top: 0;
    left: 0;
}

.charge-progress {
    fill: none;
    stroke: #00ffff;
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.1s linear;
}

.charge-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    line-height: 1;
}

/* Combo display */
.combo-display {
    position: absolute;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.combo-text {
    font-family: 'Orbitron', monospace;
}

.combo-label {
    display: block;
    font-size: 14px;
    color: #ffaa00;
}

.combo-value {
    display: block;
    font-size: 36px;
    font-weight: 900;
    color: #ffff00;
    text-shadow: 0 0 20px rgba(255, 255, 0, 0.8);
}

.combo-timer {
    width: 100px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 5px;
}

.combo-timer-fill {
    height: 100%;
    background: #ffff00;
    transition: width 0.1s linear;
}

/* Event notifications */
.event-notifications {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.event-notification {
    background: rgba(0, 0, 0, 0.8);
    padding: 10px 20px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    color: white;
}

.event-success {
    border: 1px solid #00ff00;
    color: #00ff00;
}

.event-danger {
    border: 1px solid #ff0000;
    color: #ff0000;
}

.event-warning {
    border: 1px solid #ffaa00;
    color: #ffaa00;
}

/* Controls display */
.controls-display {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}

/* Dash cooldown */
.dash-cooldown-container {
    position: absolute;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
}

.dash-cooldown-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.dash-cooldown-fill {
    height: 100%;
    background: #00ffff;
    transition: width 0.1s linear;
}

/* Game over overlay */
.game-over-overlay, .pause-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.game-over-content, .pause-content {
    text-align: center;
    padding: 40px;
    min-width: 400px;
}

.game-over-title {
    font-family: 'Orbitron', monospace;
    font-size: 48px;
    font-weight: 900;
    margin: 0 0 30px 0;
    color: #ffaa00;
}

.final-stats {
    margin: 30px 0;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
    font-size: 18px;
}

.game-over-buttons, .pause-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
}

/* Animations */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Body styles when game is active */
body.game-active {
    overflow: hidden;
    background: #000;
    cursor: crosshair; /* Crosshair cursor for aiming */
}

/* Default cursor for non-game scenes (menu, etc) */
body:not(.game-active) {
    cursor: default;
}

/* Hide UI overlay when not in game */
body:not(.game-active) #ui-overlay {
    display: none;
}

/* Canvas cursor - crosshair for aiming in game, default otherwise */
body.game-active #game-container canvas {
    cursor: crosshair !important;
}

/* Allow Phaser to control cursor in menu */
body:not(.game-active) #game-container canvas {
    /* No !important here - let Phaser's inline styles work */
    cursor: default;
}

/* Font loading */
body {
    font-family: 'Orbitron', monospace;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Disable text selection globally */
* {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Ensure UI overlay doesn't block cursor */
#ui-overlay {
    pointer-events: none;
}

/* But allow interaction with UI elements */
#ui-overlay > *,
#ui-overlay button,
#ui-overlay .clickable {
    pointer-events: auto;
}

/* Interactive elements should show pointer cursor */
button,
.nes-btn,
a,
.clickable,
[role="button"],
[onclick],
.upgrade-btn,
.ability-slot,
.pause-buttons button,
.game-over-buttons button {
    cursor: pointer !important;
}

/* Make sure the game container is set up properly */
#game-container {
    position: relative;
}

/* Input fields should show text cursor */
input[type="text"],
input[type="number"],
textarea {
    cursor: text !important;
}