/* === VARIABLES GLOBALES === */
:root {
    --neon-green: #00ff9f;
    --neon-pink: #ff00ff;
    --neon-blue: #00ffff;
    --neon-red: #ff0033;
    --dark-bg: #0a0a0a;
    --darker-bg: #050505;
    --card-bg: #111111;
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --blood-red: #8b0000;
    --matrix-green: #00ff41;
}

/* === RESET Y ESTILOS BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Courier New', monospace;
}

body {
    background: var(--dark-bg);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    padding: 20px;
}

/* === EFECTO MATRIX BACKGROUND === */
.matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    opacity: 0.1;
}

.app-title {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    position: relative;
}

.app-title h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--neon-green);
    text-shadow: 0 0 10px var(--neon-green);
    letter-spacing: 3px;
}

.app-title p {
    font-size: 1.2rem;
    color: var(--neon-blue);
    opacity: 0.9;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* === PANEL DE CONTROLES === */
.control-panel {
    background: rgba(17, 17, 17, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid var(--neon-green);
    box-shadow: 0 0 30px rgba(0, 255, 159, 0.2);
}

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    color: var(--neon-green);
    font-size: 0.9rem;
    font-weight: 600;
}

.filter-select, .search-input {
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(0, 255, 159, 0.3);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
}

.filter-select:focus, .search-input:focus {
    border-color: var(--neon-green);
    box-shadow: 0 0 15px rgba(0, 255, 159, 0.5);
}

/* === ESTADÍSTICAS === */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.stat-card {
    background: rgba(0, 255, 159, 0.1);
    border: 1px solid var(--neon-green);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 20px rgba(0, 255, 159, 0.4);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--neon-green);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* === TABLA DE LIVES === */
.table-container {
    background: rgba(17, 17, 17, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid var(--neon-green);
    box-shadow: 0 0 30px rgba(0, 255, 159, 0.2);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--neon-green);
}

.table-header h3 {
    color: var(--neon-green);
    font-size: 1.5rem;
}

.table-actions {
    display: flex;
    gap: 10px;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid rgba(0, 255, 159, 0.3);
}

.lives-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(0, 0, 0, 0.5);
}

.lives-table th {
    background: rgba(0, 255, 159, 0.2);
    color: var(--neon-green);
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--neon-green);
    cursor: pointer;
    transition: all 0.3s;
    user-select: none;
}

.lives-table th:hover {
    background: rgba(0, 255, 159, 0.3);
}

.lives-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    vertical-align: middle;
}

.lives-table tbody tr {
    transition: all 0.3s;
}

.lives-table tbody tr:hover {
    background: rgba(0, 255, 159, 0.1);
    transform: scale(1.01);
}

/* Estados de las lives */
.status-live {
    color: var(--neon-green);
    font-weight: bold;
    text-shadow: 0 0 5px var(--neon-green);
}

.status-die {
    color: var(--neon-red);
    font-weight: bold;
    text-shadow: 0 0 5px var(--neon-red);
}

.status-unknown {
    color: var(--neon-blue);
    font-weight: bold;
}

/* Botones de acción */
.btn-action {
    padding: 6px 12px;
    margin: 2px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s;
}

.btn-edit {
    background: rgba(0, 255, 255, 0.2);
    color: var(--neon-blue);
    border: 1px solid var(--neon-blue);
}

.btn-edit:hover {
    background: rgba(0, 255, 255, 0.4);
}

.btn-delete {
    background: rgba(255, 0, 0, 0.2);
    color: var(--neon-red);
    border: 1px solid var(--neon-red);
}

.btn-delete:hover {
    background: rgba(255, 0, 0, 0.4);
}

/* === PIE DE TABLA === */
.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.pagination {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-pag {
    padding: 8px 16px;
    background: rgba(0, 255, 159, 0.2);
    color: var(--neon-green);
    border: 1px solid var(--neon-green);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-pag:hover:not(:disabled) {
    background: rgba(0, 255, 159, 0.3);
}

.btn-pag:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.results-count {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* === BOTONES GENERALES === */
.btn {
    padding: 12px 20px;
    background: rgba(0, 255, 159, 0.2);
    color: var(--neon-green);
    border: 2px solid var(--neon-green);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    background: rgba(0, 255, 159, 0.3);
    box-shadow: 0 0 15px rgba(0, 255, 159, 0.5);
    transform: translateY(-2px);
}

.btn-refresh {
    background: rgba(0, 255, 255, 0.2);
    border-color: var(--neon-blue);
    color: var(--neon-blue);
}

.btn-export {
    background: rgba(255, 0, 255, 0.2);
    border-color: var(--neon-pink);
    color: var(--neon-pink);
}

.btn-clear {
    background: rgba(255, 0, 0, 0.2);
    border-color: var(--neon-red);
    color: var(--neon-red);
}

/* === MODAL === */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--card-bg);
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    border: 2px solid var(--neon-green);
    box-shadow: 0 0 50px rgba(0, 255, 159, 0.5);
    position: relative;
}

.modal-header {
    background: rgba(0, 255, 159, 0.2);
    padding: 20px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: var(--neon-green);
    margin: 0;
}

.close {
    color: var(--neon-green);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.close:hover {
    color: var(--neon-red);
    transform: scale(1.2);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

/* Formularios */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    color: var(--neon-green);
    font-size: 0.9rem;
    font-weight: 600;
}

.form-input, .form-textarea {
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 159, 0.3);
    border-radius: 5px;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s;
}

.form-input:focus, .form-textarea:focus {
    border-color: var(--neon-green);
    box-shadow: 0 0 10px rgba(0, 255, 159, 0.5);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.btn-cancel {
    background: rgba(255, 0, 0, 0.2);
    border-color: var(--neon-red);
    color: var(--neon-red);
}

.btn-save {
    background: rgba(0, 255, 159, 0.2);
    border-color: var(--neon-green);
    color: var(--neon-green);
}

/* === EFECTOS GLITCH === */
.glitch-text {
    position: relative;
    display: inline-block;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch-text::before {
    left: 2px;
    text-shadow: -2px 0 var(--neon-pink);
    animation: glitch-1 2s infinite linear alternate-reverse;
}

.glitch-text::after {
    left: -2px;
    text-shadow: -2px 0 var(--neon-blue);
    animation: glitch-2 3s infinite linear alternate-reverse;
}

@keyframes glitch-1 {
    0% { clip-path: inset(20% 0 65% 0); }
    20% { clip-path: inset(60% 0 5% 0); }
    40% { clip-path: inset(35% 0 40% 0); }
    60% { clip-path: inset(80% 0 5% 0); }
    80% { clip-path: inset(15% 0 70% 0); }
    100% { clip-path: inset(50% 0 30% 0); }
}

@keyframes glitch-2 {
    0% { clip-path: inset(65% 0 20% 0); }
    20% { clip-path: inset(5% 0 60% 0); }
    40% { clip-path: inset(40% 0 35% 0); }
    60% { clip-path: inset(5% 0 80% 0); }
    80% { clip-path: inset(70% 0 15% 0); }
    100% { clip-path: inset(30% 0 50% 0); }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .filters {
        grid-template-columns: 1fr;
    }
    
    .table-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .table-actions {
        justify-content: center;
    }
    
    .table-footer {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .lives-table {
        font-size: 0.8rem;
    }
    
    .lives-table th,
    .lives-table td {
        padding: 8px 6px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
}