* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    background-color: #121212;
    color: #f0f0f0;
}

body.admin-body {
    background: linear-gradient(180deg, #101010 0%, #161616 100%);
}

/* =========================
   HEADER / MENÚ
========================= */

header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.9);
    padding: 15px 30px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

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

.logo img {
    width: 20vw;
    max-width: 220px;
    min-width: 120px;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #fff;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

header nav.open .menu-toggle span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

header nav.open .menu-toggle span:nth-child(2) {
    opacity: 0;
}

header nav.open .menu-toggle span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

header nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 18px;
}

header nav ul li a {
    text-decoration: none;
    color: #f0f0f0;
    font-weight: 600;
    transition: color 0.3s;
}

header nav ul li a:hover,
header nav ul li a.active {
    color: #ff0066;
}

/* =========================
   HERO
========================= */

.hero {
    min-height: 72vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 140px 20px 70px;
    background: linear-gradient(rgba(18, 18, 18, 0.65), rgba(18, 18, 18, 0.92)), url("../img/background.jpg") center/cover no-repeat;
}

.hero-content {
    max-width: 980px;
}

.hero h1 {
    font-size: 3.2rem;
    margin-bottom: 20px;
    color: #ffcc00;
}

.hero p {
    font-size: 1.15rem;
    color: #ddd;
    max-width: 780px;
    margin: 0 auto 28px;
}

/* =========================
   BOTONES / BLOQUES FLEX
========================= */

.hero-buttons,
.filters,
.stats-grid,
.plugin-meta,
.plugin-actions,
.admin-actions,
.admin-toolbar,
.form-grid,
.table-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.cta-button,
.secondary-button,
.project-link,
.filter-pill,
.form-button,
.inline-button,
.admin-link {
    padding: 12px 22px;
    font-size: 0.98rem;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.3s, background 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.cta-button,
.project-link.primary,
.form-button.primary,
.inline-button.primary {
    background: #ff0066;
    color: #fff;
}

.cta-button:hover,
.project-link.primary:hover,
.form-button.primary:hover,
.inline-button.primary:hover {
    background: #ffcc00;
    color: #000;
    transform: translateY(-2px);
}

.secondary-button,
.project-link.secondary,
.form-button.secondary,
.inline-button.secondary,
.filter-pill,
.admin-link {
    background: transparent;
    color: #f0f0f0;
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.secondary-button:hover,
.project-link.secondary:hover,
.form-button.secondary:hover,
.inline-button.secondary:hover,
.filter-pill:hover,
.filter-pill.active,
.admin-link:hover {
    border-color: #ffcc00;
    color: #ffcc00;
    transform: translateY(-2px);
}

/* =========================
   ESTRUCTURA GENERAL
========================= */

main {
    max-width: 1200px;
    margin: auto;
    padding: 40px 20px 80px;
}

section,
.card-surface,
.admin-card,
.plugin-card,
.plugin-sidebar,
.stat-card,
.login-card,
.admin-table-wrap {
    background: #1e1e1e;
    border-radius: 18px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.45);
}

section {
    margin-bottom: 40px;
    padding: 40px 28px;
}

.section-title {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 12px;
    color: #ffcc00;
}

.section-subtitle,
.muted {
    text-align: center;
    color: #cfcfcf;
    max-width: 780px;
    margin: 0 auto 35px;
    font-size: 1.02rem;
}

/* =========================
   STATS
========================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.stat-card {
    padding: 22px;
    background: #222;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-card .label {
    display: block;
    color: #bfbfbf;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.stat-card .value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
}

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

.projects-grid,
.plugins-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.project-card,
.plugin-card {
    background: #2a2a2a;
    border-radius: 16px;
    padding: 24px;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 340px;
}

.project-card:hover,
.plugin-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
    border-color: rgba(255, 0, 102, 0.35);
}

.project-type,
.plugin-type,
.badge {
    display: inline-flex;
    width: fit-content;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 6px 10px;
    border-radius: 30px;
    margin-bottom: 16px;
    background: rgba(255, 204, 0, 0.12);
    color: #ffcc00;
}

.badge.alt {
    background: rgba(255, 0, 102, 0.12);
    color: #ff80b3;
}

/* =========================
   IMÁGENES / FICHA PLUGIN
========================= */

.plugin-card-image,
.plugin-hero-image {
    width: 100%;
    border-radius: 16px;
    object-fit: cover;
    background: #161616;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.plugin-card-image {
    height: 190px;
    margin-bottom: 18px;
}

.plugin-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.9fr);
    gap: 24px;
    align-items: start;
}

.plugin-main-card,
.plugin-sidebar,
.admin-card,
.login-card {
    padding: 28px;
}

.plugin-main-card h2,
.plugin-sidebar h3,
.admin-card h2,
.login-card h2 {
    color: #ffcc00;
    margin-bottom: 18px;
}

.plugin-hero-image {
    max-height: 420px;
    margin-bottom: 24px;
}

.plugin-copy h1 {
    font-size: 2.6rem;
    margin-bottom: 12px;
}

.plugin-copy p {
    color: #d7d7d7;
}

.plugin-meta {
    margin: 20px 0 24px;
}

.meta-chip {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #f2f2f2;
    font-size: 0.9rem;
}

.content-list {
    list-style: none;
    display: grid;
    gap: 12px;
}

.content-list li {
    padding: 14px 16px;
    background: #242424;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-stat {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-stat:last-child {
    border-bottom: none;
}

/* =========================
   FILTROS / FORMULARIOS
========================= */

.filters {
    justify-content: center;
    margin-bottom: 24px;
}

.search-box,
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #161616;
    color: #fff;
    padding: 14px 16px;
    outline: none;
}

.search-box {
    max-width: 420px;
    margin: 0 auto 24px;
    display: block;
}

.search-box:focus,
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #ff0066;
    box-shadow: 0 0 0 4px rgba(255, 0, 102, 0.1);
}

.plugin-empty {
    text-align: center;
    padding: 30px;
    background: #222;
    border-radius: 16px;
    color: #d8d8d8;
}

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

footer {
    text-align: center;
    padding: 24px 20px;
    background: #000;
    color: #fff;
}

footer .footer-links {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
}

footer a {
    text-decoration: none;
    color: white;
    transition: 0.3s ease;
}

footer a:hover {
    color: grey;
}

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

.admin-shell {
    max-width: 1250px;
    margin: 0 auto;
    padding: 130px 20px 60px;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1.1fr 1.4fr;
    gap: 24px;
    align-items: start;
}

.admin-card {
    margin-bottom: 24px;
}

.admin-toolbar {
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group.full {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-help {
    display: block;
    margin-top: 8px;
    color: #a8a8a8;
    font-size: 0.9rem;
}

.checkbox-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
}

.alert {
    padding: 16px 18px;
    border-radius: 14px;
    margin-bottom: 18px;
    font-weight: 600;
}

.alert.success {
    background: rgba(19, 184, 123, 0.16);
    color: #8ff4cb;
    border: 1px solid rgba(19, 184, 123, 0.35);
}

.alert.error {
    background: rgba(255, 0, 102, 0.14);
    color: #ff9fc3;
    border: 1px solid rgba(255, 0, 102, 0.35);
}

.admin-table-wrap {
    overflow-x: auto;
    padding: 18px;
}

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

.admin-table th,
.admin-table td {
    padding: 14px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
    vertical-align: top;
}

.admin-table th {
    color: #ffcc00;
    font-size: 0.92rem;
}

.admin-table td {
    color: #e5e5e5;
}

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.login-card {
    max-width: 480px;
    width: 100%;
}

.note-box {
    margin-top: 18px;
    padding: 16px;
    border-radius: 14px;
    background: rgba(255, 204, 0, 0.08);
    color: #ffe58f;
    border: 1px solid rgba(255, 204, 0, 0.22);
}

/* =========================
   ANIMACIONES
========================= */

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.9s ease-out, transform 0.9s ease-out;
}

.fade-in.appear {
    opacity: 1;
    transform: translateY(0);
}

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

@media only screen and (max-width: 900px) {
    .plugin-hero-grid,
    .admin-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }
}

@media only screen and (max-width: 700px) {
    header {
        padding: 14px 16px;
    }

    header nav {
        position: relative;
        flex-direction: row;
        gap: 10px;
    }

    .menu-toggle {
        display: flex;
    }

    header nav ul {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(0, 0, 0, 0.95);
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 18px 20px 22px;
        margin-top: 8px;
        z-index: 999;
    }

    header nav.open ul {
        display: flex;
    }

    header nav ul li {
        width: 100%;
    }

    header nav ul li a {
        width: 100%;
        padding: 12px 0;
    }

    header nav ul {
        gap: 10px;
        flex-wrap: wrap;
        justify-content: center;
        font-size: 0.95rem;
    }

    .logo img {
        width: 45vw;
    }

    .hero {
        padding-top: 170px;
        min-height: 64vh;
    }

    .hero h1,
    .plugin-copy h1 {
        font-size: 2.15rem;
    }

    main,
    .admin-shell {
        padding-left: 14px;
        padding-right: 14px;
    }

    section,
    .plugin-main-card,
    .plugin-sidebar,
    .admin-card,
    .login-card {
        padding: 22px 18px;
    }

    .section-title {
        font-size: 1.8rem;
    }
}