@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;800&display=swap');

:root {
    --bg-color: #0b0d11;
    --accent: #1d9bf0;
    --accent-glow: rgba(29, 155, 240, 0.3);
    --glass: rgba(255, 255, 255, 0.03);
    --glass-heavy: rgba(255, 255, 255, 0.07);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f7f9f9;
    --text-muted: #71767b;
    --error: #f4212e;
    --nav-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    background-image: linear-gradient(to bottom, #000000 0%, #001a33 30%, #3399ff 100%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
}

#app {
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    padding-bottom: calc(var(--nav-height) + 20px);
    position: relative;
}

/* Header Transparente */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 2rem 1rem 1rem 1rem;
    border-bottom: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

header h1 {
    font-size: clamp(1.8rem, 8vw, 2.8rem);
    /* Tamaño flexible: ni muy grande en móvil ni muy pequeño */
    font-weight: 800;
    text-align: center;
    line-height: 1.1;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #fff, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Navegación Inferior */
#bottom-nav {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    height: var(--nav-height);
    background: var(--glass-heavy);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 40px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

#bottom-nav a {
    text-decoration: none;
    font-size: 1.8rem;
    color: var(--text-muted);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 10px;
}

#bottom-nav a:hover,
#bottom-nav a.active {
    color: var(--accent);
    transform: scale(1.1);
    text-shadow: 0 0 15px var(--accent-glow);
}

/* Feed */
#view-container {
    padding: 1rem;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: transform 0.2s;
}

.post-card:active {
    transform: scale(0.98);
}

.post-content {
    font-size: 1.1rem;
    font-weight: 300;
    margin-bottom: 1rem;
    word-wrap: break-word;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-like {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s;
}

.btn-like.liked {
    color: #f91880;
}

.btn-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.5;
    padding: 5px;
}

.btn-delete:hover {
    color: var(--error);
    opacity: 1;
}

/* Formulario NEW */
.new-post-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1rem;
}

textarea {
    background: var(--glass-heavy);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.25rem;
    color: #fff;
    font-family: inherit;
    font-size: 1.2rem;
    resize: none;
    min-height: 200px;
    outline: none;
    transition: border-color 0.3s;
}

textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}

.btn-publish {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 30px;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-publish:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-publish:active {
    transform: scale(0.95);
}

/* Pulido Final: Animaciones y Estados */
.loading-spinner {
    text-align: center;
    padding: 2rem;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 1px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.4;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.4;
    }
}

.btn-like span {
    font-size: 0.9rem;
    font-weight: 600;
}

/* Efecto de explosión al dar like */
@keyframes heartBeat {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}

.liked-animation {
    animation: heartBeat 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Scrollbar Premium */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--glass-heavy);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--glass-border);
}

/* Optimización para iOS */
input,
textarea {
    font-size: 16px !important;
    /* Evita que iOS haga zoom al enfocar */
}

/* Utils */
.timestamp {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
    /* Blanco con alta opacidad para máximo contraste */
    font-weight: 500;
}