/* ===============================================================
   BASE.CSS - Estilos fundamentales del sistema
   Inspirado en el diseño original con mejoras modernas
   =============================================================== */

/* ===============================
   RESET Y VARIABLES
================================ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Colores principales */
    --color-primario: #ffcc00;
    --color-primario-hover: #e6b800;
    --color-primario-dark: #cc9900;
    
    /* Acentos */
    --color-exito: #1db954;
    --color-exito-hover: #1ed760;
    --color-peligro: #e74c3c;
    --color-peligro-hover: #c0392b;
    --color-info: #3498db;
    
    /* Fondos */
    --bg-gradient-start: #1a1a2e;
    --bg-gradient-end: #16213e;
    --bg-container: rgba(0, 0, 0, 0.85);
    --bg-card: rgba(255, 255, 255, 0.08);
    --bg-card-hover: rgba(255, 255, 255, 0.12);
    
    /* Texto */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --text-muted: rgba(255, 255, 255, 0.6);
    
    /* Bordes y sombras */
    --border-subtle: rgba(255, 255, 255, 0.1);
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-medium: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-strong: 0 12px 48px rgba(0, 0, 0, 0.5);
    
    /* Radios */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    
    /* Transiciones */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;
}

/* ===============================
   BODY Y FONDO
================================ */
body {
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    padding: 16px;
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Fondo animado sutil */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(255, 204, 0, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(29, 185, 84, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ===============================
   CONTENEDOR PRINCIPAL
================================ */
.container {
    max-width: 640px;
    margin: 5vh auto;
    background: var(--bg-container);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-strong);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    backdrop-filter: blur(10px);
}

/* ===============================
   HEADER
================================ */
.header {
    background: linear-gradient(135deg, var(--color-primario) 0%, var(--color-primario-hover) 100%);
    color: #0a0a0a;
    padding: 18px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(50%); }
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.header p {
    font-size: 0.9rem;
    opacity: 0.85;
    margin-top: 4px;
    position: relative;
    z-index: 1;
}

/* ===============================
   CONTENT
================================ */
.content {
    padding: 20px;
}

/* ===============================
   MENSAJES DE ESTADO
================================ */
.mensaje {
    font-weight: 600;
    text-align: center;
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
}

.mensaje.error,
.mensaje-error {
    background: rgba(231, 76, 60, 0.15);
    color: #ff6b6b;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.mensaje.exito,
.mensaje-exito {
    background: rgba(29, 185, 84, 0.15);
    color: var(--color-exito-hover);
    border: 1px solid rgba(29, 185, 84, 0.3);
}

.mensaje.info,
.mensaje-info {
    background: rgba(52, 152, 219, 0.15);
    color: #5dade2;
    border: 1px solid rgba(52, 152, 219, 0.3);
}

/* ===============================
   DATOS / INFORMACIÓN
================================ */
.data-container {
    text-align: center;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
}

.data-container p {
    margin: 6px 0;
    font-size: 0.95rem;
}

.highlight {
    font-weight: 700;
    color: var(--color-primario);
}

/* ===============================
   CAJAS DE TOTALES
================================ */
.totals-section {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.total-box {
    flex: 1;
    background: linear-gradient(145deg, var(--bg-card), rgba(255, 255, 255, 0.05));
    border-radius: var(--radius-md);
    text-align: center;
    padding: 16px 12px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-subtle);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.total-box:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.total-box .label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-primario);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.total-box .amount {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

/* Variantes de color */
.total-box.success .amount {
    color: var(--color-exito);
}

.total-box.danger .amount {
    color: var(--color-peligro);
}

/* ===============================
   SECCIONES CON TÍTULO
================================ */
.section-title {
    text-align: center;
    color: var(--color-primario);
    font-size: 1.1rem;
    font-weight: 700;
    margin: 24px 0 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.section-title::before,
.section-title::after {
    content: "";
    flex: 1;
    max-width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-primario), transparent);
}

/* ===============================
   BOTONES
================================ */
.btn,
.back-button {
    display: block;
    width: 100%;
    text-align: center;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all var(--transition-normal);
    text-decoration: none;
}

.btn-primary,
.back-button {
    background: linear-gradient(135deg, var(--color-primario) 0%, var(--color-primario-hover) 100%);
    color: #0a0a0a;
    box-shadow: 0 4px 15px rgba(255, 204, 0, 0.3);
}

.btn-primary:hover,
.back-button:hover {
    background: linear-gradient(135deg, var(--color-primario-hover) 0%, var(--color-primario-dark) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 204, 0, 0.4);
}

.btn-primary:active,
.back-button:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
}

.btn-danger {
    background: linear-gradient(135deg, var(--color-peligro) 0%, var(--color-peligro-hover) 100%);
    color: white;
}

.btn-danger:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, var(--color-exito) 0%, var(--color-exito-hover) 100%);
    color: white;
}

.btn-success:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

/* Botones en línea */
.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.btn-group .btn {
    flex: 1;
}

/* ===============================
   LISTAS
================================ */
ul {
    list-style: none;
}

/* ===============================
   RESPONSIVE
================================ */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        margin: 2vh auto;
        border-radius: var(--radius-md);
    }
    
    .content {
        padding: 16px;
    }
    
    .totals-section {
        flex-direction: column;
        gap: 10px;
    }
    
    .total-box .amount {
        font-size: 1.3rem;
    }
    
    .header h1 {
        font-size: 1.3rem;
    }
}

/* ===============================
   UTILIDADES
================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.hidden { display: none !important; }
