/**
 * Style SIA - Interface de Désamorçage Professionnel
 * Thème: Police / Militaire / SWAT
 */

:root {
    --primary-color: #0a4d68;
    --secondary-color: #088395;
    --accent-color: #05c3dd;
    --danger-color: #dc2626;
    --success-color: #16a34a;
    --warning-color: #f59e0b;
    --bg-dark: #0c1821;
    --bg-darker: #050b12;
    --text-primary: #e0e7ef;
    --text-secondary: #9ca3af;
    --border-color: #1e3a4f;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
    background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Grid background effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(8, 131, 149, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(8, 131, 149, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* ============================================ */
/* HEADER SIA */
/* ============================================ */

.sia-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 25px 30px;
    border-radius: 12px;
    border: 2px solid var(--accent-color);
    box-shadow: 0 8px 32px rgba(5, 195, 221, 0.2);
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.sia-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(5, 195, 221, 0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

@keyframes toastIn {
    from { transform: translateX(100px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.sia-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sia-badge {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border: 3px solid var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: bold;
    color: var(--accent-color);
    text-shadow: 0 0 10px var(--accent-color);
}

.sia-badge-img {
    width: 55px;
    height: 55px;
    max-width: 55px;
    max-height: 55px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 15px rgba(5, 195, 221, 0.4);
    flex-shrink: 0;
}

.sia-title {
    display: flex;
    flex-direction: column;
}

.sia-title h1 {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.sia-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
}

.user-status {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.status-indicator {
    width: 10px;
    height: 10px;
    background: var(--success-color);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--success-color);
    animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ============================================ */
/* STATUS BAR */
/* ============================================ */

.status-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(10, 77, 104, 0.3);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(5, 195, 221, 0.2);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent-color);
    font-family: 'Courier New', monospace;
}

.stat-value.timer {
    color: var(--warning-color);
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.stat-value.critical {
    color: var(--danger-color);
    animation: flash 1s ease-in-out infinite;
}

@keyframes flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============================================ */
/* ADMIN PANEL */
/* ============================================ */

.admin-panel {
    background: rgba(220, 38, 38, 0.1);
    border: 2px solid var(--danger-color);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.admin-title {
    color: var(--danger-color);
    font-weight: 700;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.admin-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ============================================ */
/* BOMBS GRID */
/* ============================================ */

.bombs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.bomb-card {
    background: linear-gradient(135deg, rgba(10, 77, 104, 0.4), rgba(8, 131, 149, 0.2));
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.bomb-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(5, 195, 221, 0.2), transparent);
    transition: left 0.5s ease;
}

.bomb-card:hover::before {
    left: 100%;
}

.bomb-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(5, 195, 221, 0.3);
}

.bomb-card.active {
    border-color: var(--warning-color);
}

.bomb-card.defused {
    border-color: var(--success-color);
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.2), rgba(22, 163, 74, 0.05));
}

.bomb-card.exploded {
    border-color: var(--danger-color);
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.3), rgba(220, 38, 38, 0.1));
    cursor: not-allowed;
}

.bomb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.bomb-icon {
    font-size: 48px;
    filter: drop-shadow(0 0 10px currentColor);
}

.bomb-id {
    font-size: 14px;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 8px;
    border-radius: 4px;
}

.bomb-name {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.bomb-location {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.bomb-status {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-active {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning-color);
    border: 1px solid var(--warning-color);
}

.status-defused {
    background: rgba(22, 163, 74, 0.2);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.status-exploded {
    background: rgba(220, 38, 38, 0.2);
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

/* ============================================ */
/* BUTTONS */
/* ============================================ */

.btn {
    padding: 12px 24px;
    border: 2px solid var(--accent-color);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(5, 195, 221, 0.2);
}

.btn:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(5, 195, 221, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.btn-small {
    padding: 8px 16px;
    font-size: 12px;
}

.btn-danger {
    border-color: var(--danger-color);
    background: linear-gradient(135deg, #991b1b, var(--danger-color));
}

.btn-danger:hover {
    background: linear-gradient(135deg, var(--danger-color), #ef4444);
}

.btn-success {
    border-color: var(--success-color);
    background: linear-gradient(135deg, #15803d, var(--success-color));
}

/* ============================================ */
/* LOADING SCREEN */
/* ============================================ */

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-darker);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(5, 195, 221, 0.2);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================ */
/* MODAL */
/* ============================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, var(--bg-dark), var(--bg-darker));
    border: 2px solid var(--accent-color);
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
    margin-bottom: 25px;
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-color);
    text-transform: uppercase;
    margin-bottom: 10px;
}

.code-input {
    width: 100%;
    padding: 15px;
    font-size: 28px;
    font-family: 'Courier New', monospace;
    text-align: center;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--accent-color);
    letter-spacing: 8px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.code-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 20px rgba(5, 195, 221, 0.3);
}

/* ============================================ */
/* BOUTON EDIT & INPUT EDIT                     */
/* ============================================ */

.btn-edit {
    background: rgba(5, 195, 221, 0.15);
    border: 1px solid rgba(5, 195, 221, 0.3);
    color: var(--accent-color);
    cursor: pointer;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    position: absolute;
    top: 10px;
    right: 40px;
    z-index: 2;
}

.btn-edit:hover {
    background: rgba(5, 195, 221, 0.3);
    border-color: var(--accent-color);
    transform: scale(1.1);
}

.bomb-card {
    position: relative;
}

.edit-input {
    width: 100%;
    padding: 12px 15px;
    font-size: 15px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.edit-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(5, 195, 221, 0.2);
}

.edit-input::placeholder {
    color: #4a5568;
}

/* ============================================ */
/* RESPONSIVE */
/* ============================================ */

@media (max-width: 768px) {
    .sia-header {
        padding: 20px;
    }
    
    .sia-title h1 {
        font-size: 20px;
    }
    
    .bombs-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-controls {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        width: 100%;
    }
}

/* ============================================ */
/* UTILITY CLASSES */
/* ============================================ */

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}
