/* =====================================================
   SebasTecnico - Main Stylesheet
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700;800&display=swap');

/* --- CSS Variables --- */
:root {
    --primary: #E8524A;
    --primary-dark: #d44540;
    --primary-light: #F05858;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow-soft: 0 10px 25px -5px rgba(0, 0, 0, 0.07);
    --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.1);
    --radius-lg: 1.5rem;
    --radius-md: 1rem;
    --radius-sm: 0.5rem;
    --font: 'Poppins', sans-serif;
    --transition: 0.25s ease;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

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

img {
    max-width: 100%;
    display: block;
}

ul {
    list-style: none;
}

button,
input,
textarea,
select {
    font-family: var(--font);
}

/* =====================================================
   HEADER - HOME TYPE
   ===================================================== */

.site-header {
    background: #1a0a0a;
    position: relative;
    overflow: visible;
}

#hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 0;
}

/* Nav Bar */
.nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 2rem;
    gap: 1rem;
    position: relative;
    z-index: 10;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-shrink: 0;
}

.nav-logo {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--white);
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    gap: 1.4rem;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: color var(--transition);
}

.nav-links a:hover {
    color: var(--white);
}

.nav-search {
    flex: 1;
    max-width: 380px;
    position: relative;
}

.nav-search input {
    width: 100%;
    padding: 0.55rem 1.2rem 0.55rem 2.8rem;
    border-radius: 50px;
    border: none;
    background: rgba(255, 255, 255, 0.22);
    color: var(--white);
    font-size: 0.85rem;
    outline: none;
    backdrop-filter: blur(4px);
    transition: background var(--transition);
}

.nav-search input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.nav-search input:focus {
    background: rgba(255, 255, 255, 0.3);
}

.nav-search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    opacity: 0.8;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-shrink: 0;
}

.nav-right a {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    transition: color var(--transition);
    white-space: nowrap;
}

.nav-right a:hover {
    color: var(--white);
}

.nav-right .nav-sep {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
}

.nav-right .btn-login {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    color: var(--white) !important;
    transition: background var(--transition);
}

.nav-right .btn-login:hover {
    background: rgba(255, 255, 255, 0.32);
}

/* =====================================================
   HERO TECNOLÓGICO
   ===================================================== */

@keyframes glitch-1 {

    0%,
    100% {
        clip-path: inset(0 0 96% 0);
        transform: translate(-3px, 0);
    }

    20% {
        clip-path: inset(30% 0 50% 0);
        transform: translate(3px, 0);
    }

    40% {
        clip-path: inset(70% 0 10% 0);
        transform: translate(-2px, 0);
    }

    60% {
        clip-path: inset(10% 0 80% 0);
        transform: translate(2px, 0);
    }

    80% {
        clip-path: inset(55% 0 30% 0);
        transform: translate(-3px, 0);
    }
}

@keyframes glitch-2 {

    0%,
    100% {
        clip-path: inset(50% 0 30% 0);
        transform: translate(3px, 0);
    }

    20% {
        clip-path: inset(5% 0 85% 0);
        transform: translate(-3px, 0);
    }

    40% {
        clip-path: inset(80% 0 5% 0);
        transform: translate(2px, 0);
    }

    60% {
        clip-path: inset(20% 0 60% 0);
        transform: translate(-2px, 0);
    }

    80% {
        clip-path: inset(65% 0 15% 0);
        transform: translate(3px, 0);
    }
}

@keyframes scanline {
    0% {
        top: -10%;
    }

    100% {
        top: 110%;
    }
}

@keyframes blink-cursor {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Home Header Hero */
.header-hero {
    text-align: center;
    padding: 1.6rem 2rem 3rem;
    position: relative;
    z-index: 5;
    overflow: hidden;
}

/* "> _ Bienvenido a" */
.hero-sub {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.75rem, 1.8vw, 1rem);
    color: rgba(255, 255, 255, 0.65);
    letter-spacing: 0.18em;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    animation: fade-in-up 0.6s ease both;
}

.hero-cursor {
    color: rgba(255, 255, 255, 0.9);
    animation: blink-cursor 1s step-end infinite;
    margin-right: 0.4em;
}

/* Título principal */
.hero-title {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.9rem, 6vw, 4.2rem);
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.05;
    margin-bottom: 0.6rem;
    position: relative;
    display: inline-block;
    animation: fade-in-up 0.7s 0.1s ease both;
}

/* Texto base */
.hero-glitch {
    color: #ffffff;
    text-shadow:
        0 0 10px rgba(255, 255, 255, 0.6),
        0 0 30px rgba(255, 255, 255, 0.25),
        0 0 60px rgba(255, 200, 200, 0.15);
    position: relative;
    display: inline-block;
}

/* Capa glitch 1 (cian) */
.hero-glitch::before {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    color: #00f0ff;
    text-shadow: -2px 0 rgba(0, 240, 255, 0.7);
    animation: glitch-1 4.5s infinite linear;
    opacity: 0.7;
    pointer-events: none;
}

/* Capa glitch 2 (magenta) */
.hero-glitch::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    color: #ff2d78;
    text-shadow: 2px 0 rgba(255, 45, 120, 0.7);
    animation: glitch-2 4.5s infinite linear;
    opacity: 0.7;
    pointer-events: none;
}

/* Línea de escaneo */
.hero-scanline {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
    animation: scanline 3s linear infinite;
    pointer-events: none;
}

/* Tagline */
.hero-tagline {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.65rem, 1.4vw, 0.82rem);
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.12em;
    animation: fade-in-up 0.8s 0.2s ease both;
}

/* Categories */
.header-categories {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0 2rem 2.5rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 5;
}

.cat-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.cat-item:hover {
    background: rgba(255, 255, 255, 0.18);
}

.cat-item.active {
    background: var(--white);
    color: var(--primary);
}

.cat-item .cat-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.cat-item.active .cat-icon {
    color: var(--primary);
}

.cat-item:not(.active) .cat-icon {
    color: rgba(255, 255, 255, 0.9);
}

/* Header Wave */
.header-wave {
    position: relative;
    margin-top: -2px;
    line-height: 0;
}

.header-wave svg {
    display: block;
    width: 100%;
    height: auto;
}

/* =====================================================
   INNER HEADER (post, login, etc.)
   ===================================================== */

.site-header.inner {
    background: var(--primary);
}

.site-header.inner .nav-bar {
    padding: 0.85rem 2rem;
}

/* =====================================================
   MAIN CONTENT AREA
   ===================================================== */

.main-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
}

/* On home, content overlaps the wave */
.home-content {
    margin-top: -60px;
    position: relative;
    z-index: 20;
}

/* =====================================================
   CARDS GRID
   ===================================================== */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.4rem;
    padding: 0 0 2rem;
}

/* Card */
.service-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.12);
}

/* Card Top (white section) */
.card-top {
    background: var(--white);
    padding: 1.8rem 1.2rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    min-height: 110px;
}

.card-top:has(.card-img) {
    padding: 0;
    min-height: unset;
}

.card-tag {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    padding: 0.22rem 0.7rem;
    border-radius: 50px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.card-tag.mas-visto {
    background: #d1fae5;
    color: #065f46;
}

.card-tag.nuevo {
    background: #dbeafe;
    color: #1e40af;
}

.card-tag.destacado {
    background: #fef3c7;
    color: #92400e;
}

.card-logo {
    width: 52px;
    height: 52px;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    border-radius: 0;
    display: block;
    margin: 0;
}

.card-logo svg {
    width: 100%;
    height: 100%;
}

.card-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gray-800);
    text-align: center;
    line-height: 1.2;
}


/* Card Bottom (red section) */
.card-bottom {
    background: var(--primary);
    text-align: center;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-install-text {
    color: var(--white);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 5px;
}

/* =====================================================
   POST PAGE
   ===================================================== */

.post-container {
    max-width: 860px;
    margin: 2.5rem auto;
    padding: 0 1.5rem 3rem;
}

/* Post Row 1: Title + Date */
.post-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.4rem;
}

.post-title {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1.2;
}

.post-meta-pills {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-top: 0.3rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.post-date-pill {
    background: var(--gray-100);
    color: var(--gray-500);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}

.post-views-pill {
    background: var(--gray-100);
    color: var(--gray-500);
    padding: 0.4rem 0.85rem;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* Post Row 2: Logo + Buttons */
.post-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.4rem;
    flex-wrap: wrap;
}

.post-service-brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.post-service-img {
    width: 250px;
    height: 130px;
    object-fit: cover;
    border-radius: .75rem;
}

.post-service-logo {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-service-logo svg {
    width: 100%;
    height: 100%;
}

.post-service-name {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--gray-900);
}

.post-buttons {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.btn-outline-red {
    padding: 0.5rem 1.1rem;
    border: 2px solid var(--primary);
    border-radius: 50px;
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 600;
    background: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-outline-red:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-grey {
    padding: 0.5rem 1.1rem;
    border: none;
    border-radius: 50px;
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-grey:hover {
    background: var(--gray-200);
}

.btn-grey.active {
    background: var(--primary);
    color: var(--white);
}

/* Social Embed Container */
#social-embed-wrap {
    display: none;
    margin-bottom: 1.2rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #000;
    position: relative;
    animation: embedFadeIn 0.3s ease;
}

@keyframes embedFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#social-embed-wrap iframe {
    display: block;
    width: 100%;
    height: 400px;
    border: none;
}

.social-embed-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 10;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-embed-close:hover {
    background: rgba(0, 0, 0, 0.85);
}

/* Post Row 3: Checkmarks */
.post-features-row {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    flex-wrap: wrap;
    margin-bottom: 1.2rem;
    padding: 0.9rem 1.2rem;
    background: var(--white);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-soft);
}

.post-feature {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
}

.checkmark-icon {
    width: 16px;
    height: 16px;
    color: #10b981;
    flex-shrink: 0;
}

/* Post Row 4: Description */
.post-description {
    color: var(--gray-500);
    font-size: 0.95rem;
    line-height: 1.75;
    margin-bottom: 2rem;
}

/* Post Row 5: "Como instalar" heading */
.post-how-title {
    margin-bottom: 1.2rem;
    line-height: 1.2;
}

.post-how-title .black-part {
    font-size: clamp(1.5rem, 4vw, 2.4rem);
    font-weight: 800;
    color: var(--gray-900);
}

.post-how-title .gradient-part {
    font-size: clamp(1.5rem, 4vw, 2.4rem);
    font-weight: 800;
    background: linear-gradient(90deg, #9333ea, #f97316);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.post-how-subtitle {
    color: #f97316;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 1.6rem;
}

/* Post Step Row 6 */
.post-step {
    font-size: 0.97rem;
    color: var(--gray-700);
    margin-bottom: 1.4rem;
    line-height: 1.7;
}

.post-step .highlight-marker {
    background: linear-gradient(180deg, transparent 55%, #fde68a 55%);
    font-weight: 600;
    color: var(--gray-800);
    padding: 0 2px;
}

/* Post Screenshot Container */
.post-screenshot {
    background: var(--gray-100);
    border-radius: var(--radius-md);
    padding: 1.2rem;
    margin-bottom: 1.6rem;
    text-align: center;
}

.post-screenshot img {
    border-radius: 0.75rem;
    max-width: 100%;
    margin: 0 auto;
    box-shadow: var(--shadow-md);
}

.screenshot-placeholder {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    font-size: 0.9rem;
    font-weight: 600;
    flex-direction: column;
    gap: 0.5rem;
}

/* Post Steps List */
.post-steps-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.step-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.step-content {
    font-size: 0.95rem;
    color: var(--gray-700);
    line-height: 1.65;
    padding-top: 0.2rem;
}

.step-content-img {
    display: block;
    margin-top: .8rem;
    max-width: 100%;
    border-radius: .75rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* Comments Section */
.comments-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--gray-100);
}

.comments-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1.4rem;
}

.comment-form {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1.4rem;
    box-shadow: var(--shadow-soft);
    margin-bottom: 1.8rem;
}

.comment-form textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    resize: vertical;
    min-height: 100px;
    outline: none;
    transition: border-color var(--transition);
    color: var(--gray-700);
}

.comment-form textarea:focus {
    border-color: var(--primary);
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 0.8rem;
    transition: background var(--transition), transform var(--transition);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.comment-item {
    background: var(--white);
    border-radius: var(--radius-sm);
    padding: 1rem 1.2rem;
    margin-bottom: 0.8rem;
    box-shadow: var(--shadow-soft);
}

.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.comment-author {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--gray-800);
}

.comment-time {
    font-size: 0.78rem;
    color: var(--gray-400);
}

.comment-text {
    font-size: 0.9rem;
    color: var(--gray-600);
    line-height: 1.6;
}

/* Favorite Button */
.favorite-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.1rem;
    border-radius: 50px;
    border: 2px solid var(--gray-200);
    background: var(--white);
    color: var(--gray-500);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.favorite-btn:hover,
.favorite-btn.active {
    border-color: #ef4444;
    color: #ef4444;
    background: #fff5f5;
}

.favorite-btn svg {
    width: 16px;
    height: 16px;
}

/* =====================================================
   LOGIN / REGISTER PAGES
   ===================================================== */

.auth-page {
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, #fff5f5 0%, var(--gray-50) 100%);
}

.auth-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px -10px rgba(232, 82, 74, 0.15);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-logo .logo-mark {
    width: 60px;
    height: 60px;
    background: var(--primary);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.7rem;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gray-900);
    text-align: center;
    margin-bottom: 0.3rem;
}

.auth-subtitle {
    font-size: 0.88rem;
    color: var(--gray-400);
    text-align: center;
    margin-bottom: 1.8rem;
}

.form-group {
    margin-bottom: 1.1rem;
}

.form-label {
    display: block;
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.35rem;
}

.form-input {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--gray-800);
    outline: none;
    transition: border-color var(--transition);
}

.form-input:focus {
    border-color: var(--primary);
}

.form-submit {
    width: 100%;
    padding: 0.85rem;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
    margin-top: 0.4rem;
}

.form-submit:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.auth-footer {
    text-align: center;
    margin-top: 1.4rem;
    font-size: 0.87rem;
    color: var(--gray-500);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* =====================================================
   FORUM PAGE
   ===================================================== */

.forum-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1.5rem 3rem;
}

.page-heading {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
}

.forum-category {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    margin-bottom: 1.2rem;
}

.forum-cat-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.4rem;
    background: var(--primary);
    color: var(--white);
}

.forum-cat-icon {
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.forum-cat-name {
    font-size: 1rem;
    font-weight: 700;
    flex: 1;
}

.forum-cat-count {
    font-size: 0.8rem;
    opacity: 0.8;
}

.forum-topic {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.4rem;
    border-bottom: 1px solid var(--gray-100);
    transition: background var(--transition);
    text-decoration: none;
    color: inherit;
}

.forum-topic:last-child {
    border-bottom: none;
}

.forum-topic:hover {
    background: var(--gray-50);
}

.forum-topic-icon {
    width: 36px;
    height: 36px;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--primary);
}

.forum-topic-info {
    flex: 1;
}

.forum-topic-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.15rem;
}

.forum-topic-meta {
    font-size: 0.78rem;
    color: var(--gray-400);
}

.forum-topic-stats {
    text-align: right;
    font-size: 0.78rem;
    color: var(--gray-400);
}

/* =====================================================
   ADMIN PANEL
   ===================================================== */

.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 250px;
    background: var(--gray-900);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.admin-sidebar-logo {
    padding: 1.4rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-sidebar-logo h2 {
    color: var(--white);
    font-size: 1rem;
    font-weight: 700;
}

.admin-sidebar-logo span {
    color: var(--primary);
}

.admin-nav {
    flex: 1;
    padding: 1rem 0;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.88rem;
    font-weight: 600;
    transition: all var(--transition);
    text-decoration: none;
    cursor: pointer;
}

.admin-nav-item:hover,
.admin-nav-item.active {
    color: var(--white);
    background: rgba(255, 255, 255, 0.07);
}

.admin-nav-item.active {
    border-left: 3px solid var(--primary);
}

.admin-nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.admin-main {
    flex: 1;
    background: var(--gray-50);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.admin-topbar {
    background: var(--white);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-topbar h1 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gray-900);
}

.admin-content {
    padding: 2rem;
    flex: 1;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1.4rem;
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.red {
    background: #fee2e2;
    color: var(--primary);
}

.stat-icon.blue {
    background: #dbeafe;
    color: #2563eb;
}

.stat-icon.green {
    background: #d1fae5;
    color: #059669;
}

.stat-icon.purple {
    background: #ede9fe;
    color: #7c3aed;
}

.stat-icon svg {
    width: 22px;
    height: 22px;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1;
    margin-bottom: 0.2rem;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--gray-500);
    font-weight: 600;
}

.admin-card {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.admin-card-header {
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
}

.admin-card-body {
    padding: 1.5rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.88rem;
}

.data-table th {
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    background: var(--gray-50);
}

.data-table td {
    color: var(--gray-700);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: var(--gray-50);
}

.btn-sm {
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all var(--transition);
}

.btn-sm.edit {
    background: #dbeafe;
    color: #1e40af;
}

.btn-sm.edit:hover {
    background: #bfdbfe;
}

.btn-sm.delete {
    background: #fee2e2;
    color: #991b1b;
}

.btn-sm.delete:hover {
    background: #fecaca;
}

.btn-sm.primary {
    background: var(--primary);
    color: var(--white);
}

.btn-sm.primary:hover {
    background: var(--primary-dark);
}

/* Admin Form */
.admin-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.admin-form-group {
    margin-bottom: 1rem;
}

.admin-label {
    display: block;
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.35rem;
}

.admin-input,
.admin-textarea,
.admin-select {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    color: var(--gray-800);
    outline: none;
    transition: border-color var(--transition);
    background: var(--white);
}

.admin-input:focus,
.admin-textarea:focus,
.admin-select:focus {
    border-color: var(--primary);
}

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

.badge {
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
    font-size: 0.73rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-active {
    background: #d1fae5;
    color: #065f46;
}

.badge-draft {
    background: var(--gray-100);
    color: var(--gray-500);
}

/* =====================================================
   FOOTER
   ===================================================== */

.site-footer {
    background: var(--gray-900);
    color: rgba(255, 255, 255, 0.6);
    padding: 2rem;
    text-align: center;
    font-size: 0.85rem;
}

.site-footer a {
    color: rgba(255, 255, 255, 0.6);
    transition: color var(--transition);
}

.site-footer a:hover {
    color: var(--primary);
}

/* =====================================================
   CATEGORY SECTION TITLE
   ===================================================== */

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.2rem;
    padding-top: 1.5rem;
}

.section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gray-900);
}

.section-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
}

/* =====================================================
   HOME SECTIONS (Recientes / Destacados / Más vistos)
   ===================================================== */

.home-section {
    margin-bottom: 0.5rem;
}

.home-section .section-header {
    padding-top: 1.8rem;
    padding-bottom: 0.2rem;
    border-bottom: 2px solid var(--gray-100);
    margin-bottom: 1.4rem;
}

/* =====================================================
   POST ADMIN BAR
   ===================================================== */

.post-admin-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    background: #fefce8;
    border: 1.5px solid #fde68a;
    border-radius: var(--radius-sm);
    padding: 0.55rem 1rem;
    margin-bottom: 1rem;
}

.post-admin-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #92400e;
    background: #fde68a;
    padding: 0.15rem 0.5rem;
    border-radius: 50px;
    margin-right: 0.2rem;
}

.btn-admin-action {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: none;
    font-family: var(--font);
    transition: all var(--transition);
}

.btn-admin-edit {
    background: #eff6ff;
    color: #1d4ed8;
}

.btn-admin-edit:hover {
    background: #1d4ed8;
    color: #fff;
}

.btn-admin-del {
    background: #fef2f2;
    color: #dc2626;
}

.btn-admin-del:hover {
    background: #dc2626;
    color: #fff;
}

.btn-admin-star {
    background: #f9fafb;
    color: #6b7280;
    border: 1.5px solid #e5e7eb;
}

.btn-admin-star:hover {
    background: #fffbeb;
    color: #d97706;
    border-color: #fde68a;
}

.btn-admin-star.starred {
    background: #fffbeb;
    color: #d97706;
    border-color: #fde68a;
}

/* =====================================================
   ESTRELLA EN TABLA ADMIN
   ===================================================== */

.btn-star-admin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 1.5px solid #e5e7eb;
    background: #f9fafb;
    cursor: pointer;
    transition: all var(--transition);
    padding: 0;
}

.btn-star-admin:hover {
    background: #fffbeb;
    border-color: #fde68a;
}

.btn-star-admin.starred {
    background: #fffbeb;
    border-color: #fde68a;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 1100px) {
    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 860px) {
    .nav-links {
        display: none;
    }

    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-sidebar {
        display: none;
    }

    .admin-form-row {
        grid-template-columns: 1fr;
    }

    .post-title-row {
        flex-direction: column;
    }

    .post-meta-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* =====================================================
   HAMBURGER & MOBILE DRAWER
   ===================================================== */

/* Hamburger button — hidden on desktop */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,.15);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    padding: 6px;
    flex-shrink: 0;
    transition: background .2s;
}
.nav-hamburger:hover { background: rgba(255,255,255,.25); }
.nav-hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform .3s, opacity .3s;
    transform-origin: center;
}
/* Animate to X when open */
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(2px);
    z-index: 900;
    opacity: 0;
    transition: opacity .3s;
}
.mobile-menu-overlay.open {
    display: block;
    opacity: 1;
}

/* Drawer panel */
.mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 82%;
    max-width: 300px;
    height: 100%;
    background: #fff;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform .32s cubic-bezier(.4,0,.2,1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 32px rgba(0,0,0,.18);
}
.mobile-drawer.open { transform: translateX(0); }

/* Drawer header */
.mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.2rem;
    background: var(--primary);
}
.mobile-drawer-logo {
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -.3px;
}
.mobile-drawer-close {
    background: rgba(255,255,255,.2);
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: background .2s;
}
.mobile-drawer-close:hover { background: rgba(255,255,255,.35); }

/* Drawer search */
.mobile-drawer-search {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin: 1rem 1rem .5rem;
    background: var(--gray-100);
    border-radius: 50px;
    padding: .55rem 1rem;
}
.mobile-drawer-search input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: var(--font);
    font-size: .85rem;
    color: var(--gray-800);
    outline: none;
}
.mobile-drawer-search svg { flex-shrink: 0; color: var(--gray-400); }

/* Drawer nav links */
.mobile-drawer-nav {
    display: flex;
    flex-direction: column;
    padding: .5rem 0;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .8rem 1.2rem;
    font-size: .9rem;
    font-weight: 600;
    color: var(--gray-700);
    text-decoration: none;
    transition: background .15s, color .15s;
    border-left: 3px solid transparent;
}
.mobile-nav-link:hover {
    background: var(--gray-50);
    color: var(--primary);
    border-left-color: var(--primary);
}
.mobile-nav-link svg { flex-shrink: 0; opacity: .7; }

.mobile-drawer-divider {
    height: 1px;
    background: var(--gray-100);
    margin: .5rem 1rem;
}
.mobile-drawer-user { display: flex; flex-direction: column; padding-bottom: 1.5rem; }

.mobile-nav-admin { color: var(--gray-600); }
.mobile-nav-admin:hover { color: #7c3aed; border-left-color: #7c3aed; background: #f5f3ff; }

.mobile-nav-logout { color: #ef4444; }
.mobile-nav-logout:hover { color: #dc2626; border-left-color: #dc2626; background: #fef2f2; }

.mobile-nav-register {
    background: var(--primary);
    color: #fff !important;
    border-radius: 8px;
    margin: .25rem 1rem;
    padding: .7rem 1rem;
    border-left: none !important;
}
.mobile-nav-register:hover { background: var(--primary-dark) !important; border-left-color: transparent !important; }

/* Show hamburger on mobile, hide desktop nav items */
@media (max-width: 768px) {
    .nav-hamburger { display: flex; }
    .nav-links { display: none; }
    .nav-search { display: none; }
    .nav-right { display: none; }
    .nav-bar { padding: .85rem 1.1rem; justify-content: space-between; }
}

/* =====================================================
   END HAMBURGER & MOBILE DRAWER
   ===================================================== */

@media (max-width: 560px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }

    .nav-bar {
        padding: 0.85rem 1rem;
    }

    .hero-title {
        font-size: 1.7rem;
        letter-spacing: 0.03em;
    }

    .hero-sub {
        font-size: 0.7rem;
    }

    .hero-tagline {
        font-size: 0.6rem;
    }

    .post-container {
        padding: 0 1rem 2rem;
    }

    .auth-card {
        padding: 1.8rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}