/* CSS variables */
:root {
    --laser-color: #ff0040;
    --timer-color: #00ff40;
    --transition-duration: 200ms;
    --control-width: 460px;
}

/* Top control bar styles */
.top-control-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    width: var(--control-width) !important;
    margin-left: auto;
}

/* Status box and badges */
.status-box {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.1rem;
    border-radius: 0.25rem;
    margin: 0px 0.1rem;
}

#connectionStatus, #lastCommand {
    height: 25px;
    line-height: 25px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    width: 80px;
    text-align: center;
}

#connectionStatus {
    display: none; /* Hide Connected/Not Connected text */
}

.command-badge {
    background: var(--bs-gray-700);
    color: var(--bs-light);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    width: 30px;
    text-align: center;
    display: inline-block;
    margin: 0 0.25rem;
}

/* Laser Control Buttons */
#laserOnBtn, #laserOffBtn {
    height: 45px;
    line-height: 1;
    font-weight: bold;
    font-size: 0.775rem;
    width: 50px;
    text-align: center;
    padding: 0.15rem 0.5rem;
}

/* Game buttons */
.game-button {
    min-width: 120px;
    height: 48px;
    line-height: 48px;
    transition: all 0.3s ease;
    margin: 0 0.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bs-primary);
    border: none;
}

.game-button:disabled {
    opacity: 0.5;
    background: var(--bs-secondary);
}

.game-button:not(:disabled):hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

/* Timer display */
.timer-display {
    font-family: 'Courier New', monospace;
    font-size: 6rem;
    font-weight: bold;
    color: var(--timer-color);
    text-shadow: 0 0 15px var(--timer-color);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 0.75rem;
    margin: 0.25rem 0; /* Optimized vertical spacing */
}

/* Timer display container */
.timer-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1rem;
}

/* Game Controls Grid */
.game-controls-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

.control-group {
    display: flex;
    flex-direction: column;
}

.control-group .control-label {
    color: var(--bs-light);
    margin-bottom: 0.5rem;
}

.control-group .btn-group {
    width: 100%;
}

.control-group .btn {
    flex: 1;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

/* Layout and general styles */
.game-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    max-height: 1080px;
    background-color: rgba(0, 0, 0, 0.8);
    overflow-y: auto;
}

/* Game area positioning */
.game-area {
    margin-top: 0; /* Reset margin after navbar removal */
    padding-top: 0; /* Remove any default padding */
    flex: 1;
    max-width: calc(100% - var(--control-width));
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Remove all navbar-related elements */
.navbar,
.navbar-expand-lg,
.navbar-dark,
.navbar-brand,
.navbar-nav {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Reset container spacing */
.container-fluid {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Ensure first element starts at top */
.game-area > :first-child {
    margin-top: 0.5rem !important;
}

/* Game button spacing */
.d-flex.justify-content-center.gap-4.mb-4 {
    position: fixed;
    bottom: 35px; /* Position just above the 30px progress bar */
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 0;
    width: auto;
}

/* Status font update */
#gameStatus {
    display: block !important;
    opacity: 1;
    font-size: 5rem; /* Reduced from 6rem */
    line-height: 1;
    padding: 0.25rem;
    margin: 0.25rem 0;
    font-family: 'Montserrat Regular', sans-serif;
    color: #ffffff;
}

/* Brighter status colors with stronger glow for larger text */
#gameStatus.status-success {
    color: #00ff40;
    text-shadow: 0 0 30px rgba(0, 255, 64, 0.9);
}

#gameStatus.status-warning {
    color: #ffff00;
    text-shadow: 0 0 30px rgba(255, 255, 0, 0.9);
}

#gameStatus.status-danger {
    color: #ff3333;
    text-shadow: 0 0 30px rgba(255, 51, 51, 0.9);
}

#gameStatus.status-info {
    color: #40ffff;
    text-shadow: 0 0 30px rgba(64, 255, 255, 0.9);
}

/* Alert styles */
.alert {
    margin: 1rem 0;
    padding: 1rem;
}

/* Progress bar positioning */
.progress-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 5px;
    background: rgba(0, 0, 0, 0);
    z-index: 1000;
}

.progress {
    height: 30px;
    background-color: rgba(255, 255, 255, 0.1);
}

.progress-bar {
    transition: width 0.1s linear;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.5rem;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
}

.progress-bar.time-warning {
    background-color: #dc3545 !important;
}

/* Media queries for HD screens */
@media (max-width: 1920px) {
    .timer-display {
        font-size: 5rem;
        padding: 0.5rem;
        margin: 0.25rem 0;
    }

    #gameStatus {
        font-size: 5rem;
        margin: 0.25rem 0;
    }

    .progress {
        height: 30px;
    }
}

/*Laser Visualization*/
.laser-visualization {
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bs-dark);
    border-radius: 10px;
    margin: 20px 0;
    padding: 20px;
    box-shadow: 0 0 20px rgba(255, 0, 64, 0.2);
    border: 1px solid rgba(255, 0, 64, 0.1);
}

.laser-effect {
    width: 100%;
    height: 100%;
    max-width: 800px;
}

#laserStatus {
    font-weight: bold;
    min-width: 120px;
    padding: 0.35rem 0.65rem;
    transition: all 0.3s ease;
}

#laserStatus.laser-on {
    background-color: var(--bs-success) !important;
}

#laserStatus.laser-off {
    background-color: var(--bs-danger) !important;
}

/* Difficulty Selector Animations */
.difficulty-selector {
    transition: all 0.3s ease-in-out;
    margin-left: 1rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
}

.difficulty-selector .btn-group {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.difficulty-selector .btn {
    transition: all 0.3s ease;
    transform-origin: center;
    padding: 0.5rem 1rem;
}

.difficulty-selector .btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.difficulty-selector .btn-check:checked + .btn {
    transform: scale(1.1);
    font-weight: bold;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

/* Difficulty-specific animations */
.difficulty-easy .timer-display {
    color: var(--bs-success);
    text-shadow: 0 0 15px var(--bs-success);
}

.difficulty-challenging .timer-display {
    color: var(--bs-warning);
    text-shadow: 0 0 15px var(--bs-warning);
}

.difficulty-hard .timer-display {
    color: var(--bs-danger);
    text-shadow: 0 0 15px var(--bs-danger);
}

/* Transition animations */
.difficulty-transition {
    animation: difficultyChange 0.3s ease-in-out;
}

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

@media (min-width: 1200px) {
    .leaderboard-area {
        width: var(--control-width) !important;
        flex: 0 0 var(--control-width) !important;
        max-width: var(--control-width) !important;
        background: rgba(0, 0, 0, 0.2);
        border-left: 1px solid rgba(255, 255, 255, 0.1);
    }

    .game-area {
        flex: 1;
        max-width: calc(100% - var(--control-width));
    }
}
.top-control-bar {
    padding: 0.25rem 0;
}

.list-group-item {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.1);
}

.control-group .btn:hover {
    transform: scale(1.05);
}

.control-group .btn-check:checked + .btn {
    transform: scale(1.1);
    font-weight: bold;
}


/* Video background styles */
.video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.video-background video {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 100vh;
    transform: translate(-50%, -50%);
    object-fit: cover;
    min-width: 100%;
    min-height: 100%;
}

/* Enhanced logo */
.laser-text {
    font-size: 9rem;
    font-weight: 900;
    text-transform: uppercase;
    background: linear-gradient(45deg, #ff0040 0%, #ff6b6b 50%, #ff0040 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 2px 2px 4px rgba(255, 0, 64, 0.3);
    letter-spacing: 0.5rem;
    margin-bottom: 2rem;
    animation: pulse 2s ease-in-out infinite alternate,
               gradientMove 3s linear infinite;
}

@keyframes pulse {
    from {
        text-shadow: 0 0 15px rgba(255, 0, 64, 0.8),
                     0 0 30px rgba(255, 0, 64, 0.6),
                     0 0 45px rgba(255, 0, 64, 0.4);
    }
    to {
        text-shadow: 0 0 30px rgba(255, 107, 107, 0.8),
                     0 0 60px rgba(255, 107, 107, 0.6),
                     0 0 90px rgba(255, 107, 107, 0.4);
    }
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}