/**
 * Advanced FPS Aim Trainer - Main Stylesheet
 * Contains all styles for the application interface, game elements, and animations
 */

/* Root variables for consistent theming */
:root {
    --primary-color: #3498db;
    --secondary-color: #f1c40f;
    --accent-color: #e74c3c;
    --dark-bg: #1a1a2e;
    --darker-bg: #16213e;
    --light-text: #ecf0f1;
    --dark-text: #2c3e50;
    --border-color: #30475e;
}

/* Base styles and resets */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--dark-bg);
    color: var(--light-text);
    font-family: 'Roboto', sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--darker-bg) 100%);
}

/* Typography */
.game-title {
    margin: 20px 0;
    font-size: 3rem;
    font-family: 'Orbitron', sans-serif;
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(52, 152, 219, 0.5), 0 0 20px rgba(52, 152, 219, 0.3);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-bottom: 20px;
    opacity: 0.8;
    text-align: center;
}

/* Layout containers */
.main-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (min-width: 1024px) {
    .main-container {
        flex-direction: row;
        align-items: flex-start;
        gap: 20px;
    }
}

/* Game container */
#game-container {
    width: 100%;
    max-width: 1000px;
    height: 700px;
    position: relative;
    background: linear-gradient(to bottom, #141e30, #243b55);
    margin: 20px 0;
    cursor: none;
    overflow: hidden;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Enemy styles */
.npc {
    position: absolute;
    width: 40px;
    height: 60px;
    cursor: none;
    transition: transform 0.2s;
}

.npc.regular {
    background: url("../images/Regular_Enemy.png");
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

.npc.fast {
    background: url("../images/Fast_Enemy.png");
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

.npc.tank {
    background: url("../images/Tank_Enemy.png");
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

.npc.boss {
    background: url("../images/Boss_Enemy.png");
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    width: 80px;
    height: 100px;
}

.npc.hit {
    animation: hit 0.3s ease-out;
}

.npc.damage {
    filter: brightness(2);
    animation: damage 0.3s ease-out;
}

/* Powerup styles */
.power-up {
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    animation: pulse 1s infinite;
    z-index: 5;
    cursor: pointer;
}

.power-up.double-points {
    background: radial-gradient(circle, #f39c12 0%, #d35400 100%);
}

.power-up.rapid-fire {
    background: radial-gradient(circle, #3498db 0%, #2980b9 100%);
}

.power-up.slow-motion {
    background: radial-gradient(circle, #9b59b6 0%, #8e44ad 100%);
}

.power-up.shield {
    background: radial-gradient(circle, #2ecc71 0%, #27ae60 100%);
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.2); filter: brightness(1.5); }
    100% { transform: scale(1); filter: brightness(1); }
}

@keyframes hit {
    0% { transform: scale(1); filter: brightness(2); }
    50% { transform: scale(1.5); }
    100% { transform: scale(0); }
}

@keyframes damage {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes streakFade {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(-50px); opacity: 0; }
}

/* Crosshair and gun */
#crosshair {
    position: fixed;
    pointer-events: none;
    z-index: 1000;
    display: none;
}

#muzzle-flash {
    position: fixed;
    display: none;
    pointer-events: none;
    filter: drop-shadow(0 0 10px #ff0);
    z-index: 1000;
}

/* Stats display */
#stats {
    position: fixed;
    top: 20px;
    left: 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(5px);
    z-index: 100;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-value {
    color: var(--primary-color);
    font-weight: bold;
}

.enemy-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.enemy-card {
    display: flex;
    align-items: center;
    background: rgba(42, 42, 63, 0.7);
    padding: 8px;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    font-size: 12px;
}

.enemy {
    width: 30px;
    height: 30px;
    margin-right: 8px;
    border-radius: 3px;
    flex-shrink: 0;
}

.enemy.regular {
    background: url("../images/Regular_Enemy.png");
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

.enemy.fast {
    background: url("../images/Fast_Enemy.png");
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

.enemy.tank {
    background: url("../images/Tank_Enemy.png");
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

.enemy.boss {
    background: url("../images/Boss_Enemy.png");
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

.enemy-info p {
    margin: 2px 0;
    color: #bfc9db;
    line-height: 1.2;
}

/* Score popup */
#score-popup {
    position: absolute;
    color: #fff;
    font-weight: bold;
    pointer-events: none;
    text-shadow: 0 0 5px rgba(0,0,0,0.5);
    opacity: 0;
    transition: transform 0.5s, opacity 0.5s;
    z-index: 10;
}

/* Buttons */
button {
    padding: 12px 24px;
    font-size: 18px;
    background: linear-gradient(135deg, var(--accent-color) 0%, #c0392b 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin: 10px;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    font-family: 'Orbitron', sans-serif;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

button:disabled {
    background: #888;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.game-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 20px;
}

/* Game mode and difficulty selectors */
.difficulty-selector {
    display: flex;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 10px;
    max-width: 600px;
}

.difficulty-option {
    padding: 8px 16px;
    margin: 0 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.difficulty-option:hover {
    background: rgba(255, 255, 255, 0.2);
}

.difficulty-option.active {
    background: var(--primary-color);
    color: white;
}

.game-modes {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    gap: 10px;
}

.game-mode {
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.game-mode:hover {
    background: rgba(52, 152, 219, 0.3);
}

.game-mode.active {
    background: var(--primary-color);
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
}

/* Countdown display */
#countdown {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 80px;
    display: none;
    text-shadow: 0 0 20px rgba(255,255,255,0.5);
    font-weight: bold;
    color: var(--primary-color);
    font-family: 'Orbitron', sans-serif;
    z-index: 100;
}

/* Bullet hole */
.bullet-hole {
    position: absolute;
    width: 8px;
    height: 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    pointer-events: none;
    box-shadow: inset 0 0 2px rgba(0,0,0,0.8);
    z-index: 1;
}

/* Combo meter */
#combo-meter {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    display: none;
    z-index: 100;
}

.combo-text {
    color: var(--secondary-color);
    font-size: 24px;
    font-weight: bold;
    font-family: 'Orbitron', sans-serif;
}

/* Powerup status */
#powerup-status {
    position: fixed;
    bottom: 20px;
    left: 20px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    display: none;
    z-index: 100;
}

#powerup-status div {
    margin: 5px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

#powerup-status div::before {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

#powerup-status div.double-points::before {
    background: radial-gradient(circle, #f39c12 0%, #d35400 100%);
}

#powerup-status div.rapid-fire::before {
    background: radial-gradient(circle, #3498db 0%, #2980b9 100%);
}

#powerup-status div.slow-motion::before {
    background: radial-gradient(circle, #9b59b6 0%, #8e44ad 100%);
}

#powerup-status div.shield::before {
    background: radial-gradient(circle, #2ecc71 0%, #27ae60 100%);
}

/* Streak indicator */
.streak-indicator {
    position: fixed;
    font-size: 24px;
    font-weight: bold;
    color: var(--secondary-color);
    text-shadow: 0 0 10px rgba(241, 196, 15, 0.5);
    pointer-events: none;
    animation: streakFade 1s forwards;
    z-index: 100;
}

/* Health bar */
.health-bar-container {
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 2px;
    overflow: hidden;
}

.health-bar {
    height: 100%;
    background: linear-gradient(90deg, #e74c3c 0%, #f1c40f 100%);
    width: 100%;
    transition: width 0.2s;
}

/* Game over modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    margin: 5% auto;
    padding: 30px;
    border: 2px solid var(--border-color);
    width: 90%;
    max-width: 600px;
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    color: var(--light-text);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 28px;
    text-align: center;
    margin-bottom: 20px;
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
}

.modal-score {
    font-size: 48px;
    text-align: center;
    color: var(--secondary-color);
    margin-bottom: 30px;
    text-shadow: 0 0 15px rgba(241, 196, 15, 0.5);
    font-family: 'Orbitron', sans-serif;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.stat-box {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.stat-box .title {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 5px;
}

.stat-box .value {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
}

/* Form styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--light-text);
    font-size: 16px;
    outline: none;
    transition: all 0.3s;
}

.form-group input[type="text"]:focus {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 2px var(--primary-color);
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

/* Leaderboard styles */
.sidebar {
    width: 100%;
    max-width: 350px;
    margin: 20px 0;
}

.leaderboard {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
}

.leaderboard-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--primary-color);
    text-align: center;
    text-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
}

.leaderboard table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard th {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    color: var(--secondary-color);
    font-size: 14px;
}

.leaderboard td {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.leaderboard tr:last-child td {
    border-bottom: none;
}

.leaderboard .rank {
    width: 40px;
    text-align: center;
    font-weight: bold;
}

.leaderboard .score {
    font-weight: bold;
    color: var(--primary-color);
}

/* Top 3 ranks */
.leaderboard tr:nth-child(1) .rank {
    color: gold;
}

.leaderboard tr:nth-child(2) .rank {
    color: silver;
}

.leaderboard tr:nth-child(3) .rank {
    color: #cd7f32; /* bronze */
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    background: rgba(46, 204, 113, 0.9);
    color: white;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transform: translateX(120%);
    transition: transform 0.3s ease-out;
}

.notification.show {
    transform: translateX(0);
}

/* Game timer and wave indicator */
#game-info {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    border-radius: 30px;
    padding: 8px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    backdrop-filter: blur(5px);
    z-index: 100;
    border: 1px solid var(--border-color);
    font-family: 'Orbitron', sans-serif;
}

#game-info .time {
    color: var(--primary-color);
    font-size: 20px;
}

#game-info .wave {
    color: var(--secondary-color);
    padding-left: 15px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

/* Shield effect */
#shield-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    border-radius: 10px;
    display: none;
    z-index: 50;
    border: 10px solid rgba(46, 204, 113, 0.5);
    box-shadow: inset 0 0 20px rgba(46, 204, 113, 0.5);
}

/* Tutorial panel */
#tutorial {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    padding: 15px 25px;
    max-width: 600px;
    z-index: 100;
    display: none;
    text-align: center;
    backdrop-filter: blur(5px);
    border: 1px solid var(--border-color);
}

#tutorial h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-family: 'Orbitron', sans-serif;
}

#tutorial p {
    margin-bottom: 15px;
    line-height: 1.5;
}

#tutorial button {
    padding: 8px 16px;
    font-size: 14px;
}

/* Footer */
footer {
    text-align: center;
    padding: 15px;
    background: #141e30;
    color: #fff;
    font-family: 'Arial', sans-serif;
    font-size: 14px;
    width: 100%;
    border-top: 1px solid #30475e;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.2);
    margin-top: 40px;
}

footer p strong {
    color: var(--secondary-color);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #game-container {
        height: 500px;
    }
    
    .game-title {
        font-size: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    #game-info {
        padding: 5px 15px;
        font-size: 14px;
    }
    
    #game-info .time {
        font-size: 16px;
    }
    
    .enemy-cards {
        grid-template-columns: 1fr;
    }
}