﻿/* ==========================================================================
   VARIABLES DE COLOR CORPORATIVAS (Inspiradas en tu logotipo)
   ========================================================================== */
:root {
    --bg-principal: #030d16; /* Azul noche ultra profundo (Fondo de pantalla) */
    --azul-logo: #021a2e; /* El tono base de tu logotipo */
    --cian-destello: #00f2fe; /* El brillo inferior del logo llevado a neón UI */
    --cian-medio: #176b87; /* Tono de enfoque e interactividad */
    --texto-blanco: #ffffff;
    --texto-mutado: #94a3b8; /* Gris azulado elegante para etiquetas */
    --rojo-error: #f87171; /* Tono de borrado o alertas */
    --borde-cristal: rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   REGLAS GENERALES Y RESETEO
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: radial-gradient(circle at 50% 0%, #08203e 0%, var(--bg-principal) 70%);
    min-height: 100vh;
    color: var(--texto-blanco);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    overflow-x: hidden;
}

/* Contenedor principal para pantallas tipo listado / dashboard */
.dashboard-container {
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

/* ==========================================================================
   ESTRUCTURAS GLASSMORPHISM PREMIUM (Tarjetas y Paneles)
   ========================================================================== */
.form-container, .action-bar, .grid-wrapper {
    background: rgba(4, 21, 37, 0.45);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid var(--borde-cristal);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
}

/* Formulario específico */
.form-container {
    padding: 32px;
    max-width: 440px;
    width: 100%;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

    /* Efecto aura brillante en la parte inferior del formulario */
    .form-container::after {
        content: "";
        position: absolute;
        bottom: -20px;
        left: 10%;
        width: 80%;
        height: 40px;
        background: var(--cian-destello);
        filter: blur(40px);
        opacity: 0.15;
        pointer-events: none;
    }

/* Barra de herramientas superior en listados */
.action-bar {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
    padding: 20px;
    border-radius: 20px;
}

/* Envoltorio de la grilla para soporte scroll móvil */
.grid-wrapper {
    overflow-x: auto;
    width: 100%;
}

/* ==========================================================================
   TIPOGRAFÍAS Y ENCABEZADOS
   ========================================================================== */
h2 {
    color: var(--texto-blanco);
    font-size: 22px;
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.form-container h2 {
    text-align: center;
}

.subtitle {
    color: var(--texto-mutado);
    font-size: 13px;
    text-align: center;
    margin-bottom: 28px;
    display: block;
}

.title-area h2 {
    margin-bottom: 2px;
}

.title-area span {
    color: var(--texto-mutado);
    font-size: 13px;
}

/* ==========================================================================
   ELEMENTOS DE FORMULARIO e INPUTS
   ========================================================================== */
.form-group {
    margin-bottom: 22px;
    position: relative;
}

    .form-group label {
        display: block;
        margin-bottom: 8px;
        font-weight: 500;
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 1px;
        color: var(--texto-mutado);
    }

    .form-group input {
        width: 100%;
        padding: 14px 16px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 14px;
        font-size: 15px;
        background-color: rgba(2, 13, 24, 0.6);
        color: var(--texto-blanco);
        transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        -webkit-appearance: none;
    }

        .form-group input:focus {
            border-color: var(--cian-destello);
            background-color: rgba(2, 13, 24, 0.9);
            box-shadow: 0 0 0 4px rgba(0, 242, 254, 0.08);
            outline: none;
        }

/* ==========================================================================
   COMPONENTES DE BOTONES (Primarios y de Grilla)
   ========================================================================== */
/* Botón principal del formulario y botón de nuevo registro */
.btn-enviar, .btn-nuevo {
    background: linear-gradient(135deg, #0072ff 0%, #00f2fe 100%);
    color: #021a2e;
    border: none;
    padding: 16px 20px;
    border-radius: 14px;
    cursor: pointer;
    width: 100%;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 24px rgba(0, 242, 254, 0.25);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-nuevo {
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    width: auto;
    align-self: flex-start;
}

    .btn-enviar:hover, .btn-nuevo:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 32px rgba(0, 242, 254, 0.4);
        filter: brightness(1.05);
    }

    .btn-enviar:active, .btn-nuevo:active {
        transform: translateY(0);
    }

/* Botones de acción dentro de la tabla (Editar / Borrar) */
.btn-action {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    background: transparent;
    transition: all 0.2s ease;
    display: inline-block;
    margin-right: 5px;
}

.btn-edit {
    color: var(--cian-destello);
    border-color: rgba(0, 242, 254, 0.2);
}

    .btn-edit:hover {
        background: rgba(0, 242, 254, 0.1);
        border-color: var(--cian-destello);
    }

.btn-delete {
    color: var(--rojo-error);
    border-color: rgba(248, 113, 113, 0.2);
}

    .btn-delete:hover {
        background: rgba(248, 113, 113, 0.1);
        border-color: var(--rojo-error);
    }

/* ==========================================================================
   ESTILIZACIÓN DE GRILLAS (GridView)
   ========================================================================== */
.custom-grid {
    width: 100%;
    border-collapse: collapse;
    border: none !important;
    font-size: 15px;
}

    .custom-grid th {
        background-color: rgba(2, 13, 24, 0.7);
        color: var(--texto-mutado);
        text-transform: uppercase;
        font-size: 11px;
        letter-spacing: 1px;
        font-weight: 600;
        padding: 18px 16px;
        text-align: left;
        border-bottom: 1px solid var(--borde-cristal);
    }

    .custom-grid td {
        padding: 16px;
        border-bottom: 1px solid var(--borde-cristal);
        color: #e2e8f0;
    }

    .custom-grid tr:hover td {
        background-color: rgba(255, 255, 255, 0.02);
    }

/* ==========================================================================
   ESTADOS DE ALERTAS Y NOTIFICACIONES
   ========================================================================== */
.mensaje {
    margin-top: 20px;
    padding: 14px;
    border-radius: 14px;
    display: none;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    backdrop-filter: blur(10px);
}

.exito {
    display: block;
    background-color: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.error {
    display: block;
    background-color: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

/* ==========================================================================
   MEDIA QUERIES (Soporte Responsivo)
   ========================================================================== */
@media (min-width: 600px) {
    body {
        padding: 40px;
    }

    .form-container {
        padding: 40px;
        border-radius: 32px;
    }

    .action-bar {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .btn-nuevo {
        align-self: auto;
    }

    h2 {
        font-size: 26px;
    }
}

@media (min-width: 1024px) {
    .form-container {
        max-width: 460px;
    }
}
