/* --- SISTEMA DE DISEÑO PREMIUM (Etapa Final) --- */
:root {
    --bg-dark: #0f172a;               /* Azul profundo minimalista */
    --glass-bg: rgba(30, 41, 59, 0.4); /* Fondo cristalino */
    --glass-border: rgba(255, 255, 255, 0.08); /* Borde sutil del cristal */
    --accent: #38bdf8;                /* Color azul celeste X */
    --accent-hover: #7dd3fc;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --danger: #ef4444;
    --success: #10b981;
    --shadow-premium: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* 1. Base y tipografía */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; /* Evita flash azul en móviles */
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    /* Degradado de fondo para dar profundidad */
    background-image: 
        radial-gradient(circle at top right, #1e3a8a44, transparent),
        radial-gradient(circle at bottom left, #3b82f622, transparent);
    background-attachment: fixed;
    min-height: 100vh;
}

/* 2. El Efecto "Cristal" (Glassmorphism) */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-premium);
}

/* 3. Estructura y Contenedores */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 80px 16px 100px; /* Espacio para las barras superior e inferior */
    min-height: 100vh;
}

/* 4. Barras de Navegación */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
}

.nav-content {
    max-width: 600px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    text-decoration: none;
    color: var(--text-primary);
    letter-spacing: -1px;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(15px);
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom); /* iOS support */
}

/* 5. Botones y Elementos Interactivos */
.btn-primary {
    background: var(--accent);
    color: #fff;
    padding: 10px 22px;
    border-radius: 99px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px 0 rgba(56, 189, 248, 0.3);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4);
}

.btn-primary:active {
    transform: scale(0.96);
}

/* 6. Post Cards y su Animación */
.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 20px;
    animation: slideUp 0.5s ease-out backwards;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.post-content {
    font-size: 1.15rem;
    color: var(--text-primary);
    margin-bottom: 16px;
    word-break: break-word;
    white-space: pre-line; /* Mantiene saltos de línea */
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--glass-border);
    padding-top: 16px;
}

.post-meta span {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: monospace;
    opacity: 0.7;
}

/* 7. Iconos de Interacción */
.post-actions {
    display: flex;
    gap: 15px;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 6px 10px;
    border-radius: 8px;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.btn-icon.liked {
    color: #f43f5e;
    font-weight: 700;
}

.btn-icon.delete:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* 8. Formulario de publicación */
.textarea-premium {
    width: 100%;
    min-height: 180px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    color: #fff;
    font-size: 1.2rem;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: border-color 0.3s;
}

.textarea-premium:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.1);
}

/* 9. Loader (Espera elegante) */
.loader-container {
    display: flex;
    justify-content: center;
    padding: 60px 0;
}

.loader {
    width: 38px;
    height: 38px;
    border: 3px solid var(--glass-border);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 10. Adaptabilidad para Móviles */
@media (max-width: 600px) {
    .container {
        padding-top: 80px;
    }
    
    .navbar .btn-primary {
        display: none; /* En móvil usamos el botón inferior (+) */
    }

    .card {
        border-radius: 12px;
        padding: 16px;
    }

    .post-content {
        font-size: 1.05rem;
    }
}
