/* ==========================================
   DISEÑO VISUAL PREMIUM (HOJA DE ESTILOS GENERAL)
   ========================================== */

:root {
    --bg-dark: #090d16;
    --bg-card: rgba(17, 25, 40, 0.65);
    --bg-card-hover: rgba(30, 41, 59, 0.8);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --primary-color: #1e3a8a; /* Color fallback, se pisa dinámicamente */
    --primary-glow: rgba(30, 58, 138, 0.25);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --font-sans: 'Inter', sans-serif;
    --font-serif: 'Cinzel', serif;
}

body {
    background: radial-gradient(circle at top, var(--primary-glow) 0%, var(--bg-dark) 80%);
    color: var(--text-primary);
    font-family: var(--font-sans);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

/* Tipografía */
h1, h2, h3, h4, .serif-font {
    font-family: var(--font-serif);
    letter-spacing: 0.03em;
}

/* Envoltura */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Botones con Micro-Interacciones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    border: none;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, rgba(var(--primary-color), 0.8) 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px var(--primary-glow);
    border: 1px solid rgba(255,255,255,0.1);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--primary-glow), 0 0 12px var(--primary-color);
    filter: brightness(1.1);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #b91c1c 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.35);
}

/* Efectos de Vidrio (Glassmorphism) */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    margin-bottom: 30px;
    transition: border-color 0.3s ease;
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

/* Inputs Premium */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
}

.form-control {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    box-sizing: border-box;
    transition: all 0.3s ease;
    font-family: var(--font-sans);
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: rgba(0, 0, 0, 0.35);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Cabecera / Header */
.app-header {
    background: rgba(9, 13, 22, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
    gap: 12px;
}

.logo-img {
    height: 40px;
    width: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.2);
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
}

/* Insignias de Estado (Badges) */
.badge {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-approved {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-rejected {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* VISTA PÚBLICA DEL OBITUARIO */
.deceased-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: 20px;
    padding-bottom: 20px;
}

.deceased-photo-container {
    position: relative;
    margin-bottom: 25px;
}

.deceased-photo {
    width: 170px;
    height: 170px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary-color);
    box-shadow: 0 0 30px var(--primary-glow);
    transition: transform 0.5s ease;
}

.deceased-photo:hover {
    transform: scale(1.05);
}

.deceased-name {
    font-size: 2.5rem;
    margin: 10px 0 5px 0;
    color: var(--text-primary);
}

.deceased-dates {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-weight: 300;
}

.deceased-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .deceased-details-grid {
        grid-template-columns: 1fr;
    }
}

.detail-card {
    background: rgba(0,0,0,0.15);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

.detail-card h3 {
    margin-top: 0;
    font-size: 1rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-card p {
    margin-bottom: 0;
    color: var(--text-primary);
    white-space: pre-line;
}

/* Condolencias */
.condolences-section {
    margin-top: 40px;
}

.condolence-item {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 15px;
    animation: fadeIn 0.5s ease;
}

.condolence-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.condolence-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.condolence-author {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.condolence-relation {
    color: var(--text-muted);
    font-size: 0.8rem;
    background: rgba(255,255,255,0.05);
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: 8px;
}

.condolence-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.condolence-text {
    font-style: italic;
    color: var(--text-secondary);
    margin: 0;
}

/* Honeypot anti-spam (Capa 1) */
.h-pot {
    position: absolute;
    overflow: hidden;
    clip: rect(0 0 0 0);
    height: 1px;
    width: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
}

/* Alertas de Feedback */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* PANEL ADMINISTRATIVO */
.admin-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 30px;
    margin-top: 20px;
}

@media (max-width: 900px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }
}

.admin-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    height: fit-content;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin-bottom: 10px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
}

.sidebar-link:hover, .sidebar-link.active {
    background: var(--primary-glow);
    color: var(--text-primary);
    border-left: 3px solid var(--primary-color);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.admin-table th, .admin-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    background: rgba(0,0,0,0.2);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.admin-table tr:hover td {
    background: rgba(255,255,255,0.02);
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.footer {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding: 20px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}
