/* Modal Components for System at War */

/* === ATTACK MODAL === */

.attack-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: var(--z-attack-modal);
    display: none;
    pointer-events: none;
}

.attack-modal-backdrop.active {
    display: flex;
}

.attack-modal {
    background: var(--modal-bg);
    border: var(--modal-border);
    border-radius: var(--border-radius);
    padding: var(--space-md);
    min-width: 175px;
    max-width: 225px;
    box-shadow: var(--modal-shadow);
    color: var(--color-text-primary);
    text-align: center;
    cursor: default;
    pointer-events: all;
}

.attack-modal h3 {
    color: var(--color-secondary);
    font-size: var(--font-size-base);
    margin: 0 0 var(--space-sm) 0;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
}

/* === ATTACK MODAL CONTROLS === */

.attack-controls {
    margin: var(--space-sm) 0;
}

.attack-controls label {
    display: block;
    color: var(--color-primary);
    font-size: 0.85em;
    margin-bottom: var(--space-sm);
    font-weight: var(--font-weight-bold);
}

.slider-container {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin: var(--space-sm) 0;
}

.slider-min, .slider-max {
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    min-width: 20px;
}

.attack-slider {
    flex: 1;
    height: 6px;
    background: linear-gradient(to right, var(--color-primary) 0%, var(--color-accent) 50%, var(--color-danger) 100%);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.attack-slider::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--color-secondary);
    border-radius: 50%;
    border: 1px solid var(--color-text-primary);
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
    transition: var(--transition-fast);
}

.attack-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.8);
}

.attack-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--color-secondary);
    border-radius: 50%;
    border: 1px solid var(--color-text-primary);
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
}

.unit-display {
    margin: var(--space-sm) 0;
    font-size: var(--font-size-base);
    color: var(--color-secondary);
    font-weight: var(--font-weight-bold);
    text-shadow: 0 0 4px rgba(0, 255, 255, 0.6);
}

.attack-buttons {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
    margin-top: var(--space-md);
}

/* === GAME MODAL === */

.game-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: var(--z-modal-backdrop);
    display: none;
}

.game-modal-backdrop.active {
    display: flex;
}

.game-modal {
    position: relative;
    transform: none;
    min-width: 250px;
    max-width: 400px;
    padding: var(--panel-padding-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.game-modal p {
    margin: 0;
    font-size: var(--font-size-md);
    line-height: 1.4;
}

.game-modal #modal-input-area {
    display: none;
    flex-direction: column;
    gap: var(--space-sm);
}

.game-modal input[type="text"],
.game-modal input[type="number"] {
    width: 100%;
    padding: var(--space-sm);
    background-color: var(--input-bg);
    border: var(--input-border);
    color: var(--color-text-primary);
    font-size: var(--font-size-base);
    border-radius: var(--border-radius-sm);
}

.game-modal input[type="text"]:focus,
.game-modal input[type="number"]:focus {
    border-color: var(--input-focus-border);
    box-shadow: var(--input-focus-shadow);
    outline: none;
}

.game-modal .modal-buttons-row {
    display: flex;
    justify-content: space-around;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

#modal-yes-no-area {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    width: 100%;
}

/* -- ADDED to style end-game buttons -- */
#modal-yes-no-area button {
    flex: 1;
    padding: 6px 12px;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition-button);
    font-family: var(--font-family-primary);
    background: rgba(0, 80, 80, 0.8);
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    text-shadow: var(--shadow-text);
    text-transform: uppercase;
}

#modal-yes-no-area button:hover {
    background: rgba(0, 120, 120, 0.9);
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow-lg);
}


/* === PAUSE MENU STYLES === */
#pause-menu {
    min-width: 300px;
    text-align: center;
}

#pause-menu h2 {
    font-size: var(--font-size-2xl);
    color: var(--color-primary);
    margin: 0 0 var(--space-md) 0;
    text-shadow: var(--shadow-glow-primary);
}

.pause-menu-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.pause-menu-buttons .menu-btn {
    width: 100%;
    text-align: center;
}

#tutorial-modal {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

#tutorial-modal h2 {
    font-size: clamp(1.2em, 4vw, 2em);
    margin-bottom: 15px;
}

#tutorial-modal p {
    font-size: clamp(0.9em, 2.5vw, 1.1em);
    line-height: 1.4;
    margin-bottom: 15px;
}

#tutorial-modal button {
    font-size: clamp(0.9em, 2.5vw, 1.1em);
    padding: 10px 20px;
    min-width: 80px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    #tutorial-modal {
        max-width: 95vw;
        padding: 15px;
    }
    
    #tutorial-modal h2 {
        margin-bottom: 10px;
    }
    
    #tutorial-modal p {
        margin-bottom: 12px;
    }
}

@media (max-width: 480px) {
    #tutorial-modal {
        max-width: 98vw;
        padding: 12px;
    }
}
