:root {
    --accent: #c8102e;
    --accent-light: #e8475c;
    --accent-dark: #7d0a1c;
    --ink: #f5f5f7;                       /* texto principal (blanco suave) */
    --muted: rgba(245, 245, 247, .62);    /* texto secundario */
    --line: rgba(255, 255, 255, .09);     /* bordes */
    --glass: rgba(255, 255, 255, .045);   /* fondo de tarjetas */
    --radius: 18px;}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: #0a0a0c;
    color: var(--ink);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 90px; /* espacio para el footer fijo */
}

/* ========== Fondo de toda la página ========== */
.page-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        /* brillo rojo metálico arriba a la derecha */
        radial-gradient(ellipse 70% 55% at 85% -10%, rgba(200, 16, 46, .55), transparent 60%),
        /* reflejo blanco muy suave */
        radial-gradient(ellipse 40% 30% at 70% 0%, rgba(255, 255, 255, .10), transparent 70%),
        /* rojo profundo abajo a la izquierda */
        radial-gradient(ellipse 60% 50% at 0% 100%, rgba(125, 10, 28, .45), transparent 65%),
        /* base: negro → grafito → negro */
        linear-gradient(160deg, #050506 0%, #141418 45%, #1b0b0e 75%, #060607 100%);
}

.text-accent { color: var(--accent-light); }

/* ========== Botones Bootstrap con la marca ========== */
.btn-danger {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.btn-danger:hover, .btn-danger:focus {
    background-color: #a80d27;
    border-color: #a80d27;
    color: #fff;
}

.btn-outline-light {
    border-color: var(--line);
    color: var(--muted);
}
.btn-outline-light:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .25); color: #fff; }
.btn-check:checked + .btn-outline-light { background: #fff; color: #111; border-color: #fff; }

/* ========== Navbar ========== */
.topbar {
    background: rgba(10, 10, 12, .55);
    backdrop-filter: saturate(160%) blur(16px);
    -webkit-backdrop-filter: saturate(160%) blur(16px);
    border-bottom: 1px solid var(--line);
    padding: 12px 0;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 0 10px rgba(200, 16, 46, .45)); }
.brand-name { font-weight: 700; font-size: 1.1rem; letter-spacing: -.02em; color: #fff; }

.topbar .navbar-toggler { color: #fff; }
.topbar .nav-link {
    font-weight: 500;
    font-size: .92rem;
    color: var(--muted) !important;
    padding: 8px 14px !important;
    border-radius: 999px;
    transition: all .2s;
}
.topbar .nav-link:hover { color: #fff !important; background: rgba(255, 255, 255, .06); }
.topbar .nav-link.active { color: #fff !important; background: rgba(200, 16, 46, .25); }

/* ========== Hero ========== */
.hero { padding: 56px 0 44px; }

.hero-badge {
    background: rgba(255, 255, 255, .06);
    color: var(--ink);
    border: 1px solid var(--line);
    font-weight: 500;
    font-size: .8rem;
    padding: 8px 14px;
}
.hero-badge i { color: var(--accent-light); }

/* Buscador (vidrio oscuro) */
.search {
    max-width: 640px;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .05);
    backdrop-filter: blur(10px);
    box-shadow: 0 16px 40px -20px rgba(0, 0, 0, .8);
    transition: border-color .2s, box-shadow .2s;
}
.search .input-group-text {
    background: transparent;
    border: 0;
    color: var(--muted);
    padding-left: 22px;
}
.search .form-control {
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 1rem;
}
.search .form-control::placeholder { color: rgba(255, 255, 255, .4); }
.search .form-control:focus { box-shadow: none; background: transparent; color: #fff; }
.search .btn { border-radius: 0 999px 999px 0; }
.search:focus-within { border-color: rgba(200, 16, 46, .6); box-shadow: 0 0 0 4px rgba(200, 16, 46, .18); }

/* Stats */
.stat {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--glass);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px 16px;
}
.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: #fff;
    font-size: 1rem;
}
.stat strong { display: block; font-size: 1.3rem; line-height: 1.1; color: #fff; }
.stat span { font-size: .8rem; color: var(--muted); }

/* ========== Toolbar ========== */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
}
.section-title { font-size: 1.15rem; font-weight: 700; letter-spacing: -.015em; color: #fff; }
.section-title i { color: var(--accent-light); }
.counter { color: var(--muted); }

/* ========== Cards ========== */
.dev-card {
    position: relative;
    height: 100%;
    background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .025));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    color: var(--ink);
    backdrop-filter: blur(6px);
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}

.dev-card:hover {
    transform: translateY(-6px);
    border-color: rgba(200, 16, 46, .55);
    box-shadow: 0 24px 50px -20px rgba(200, 16, 46, .45), 0 0 0 1px rgba(200, 16, 46, .25);
}

/* Portada: color + patrón, imagen o miniatura de la página */
.dev-cover {
    position: relative;
    height: 160px;
    overflow: hidden;
    background-color: #1c1c21;
    border-bottom: 1px solid var(--line);
}
.dev-cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform .8s ease;
}
.dev-card:hover .dev-cover img { transform: scale(1.05); }

/* Patrones (se ponen encima del color elegido) */
.patron-franjas  { background-image: repeating-linear-gradient(-55deg, rgba(255,255,255,.10) 0 14px, transparent 14px 34px); }
.patron-puntos   { background-image: radial-gradient(rgba(255,255,255,.28) 1.5px, transparent 1.7px); background-size: 16px 16px; }
.patron-circulos { background-image: repeating-radial-gradient(circle at 100% 0, rgba(255,255,255,.14) 0 1px, transparent 1.5px 18px); }
.patron-rombos   { background-image:
                       repeating-linear-gradient(45deg,  rgba(255,255,255,.08) 0 1px, transparent 1px 22px),
                       repeating-linear-gradient(-45deg, rgba(255,255,255,.08) 0 1px, transparent 1px 22px); }
.patron-lineas   { background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.08) 0 1px, transparent 1px 10px); }
.patron-ninguno  { background-image: none; }

/* sombra suave abajo para que la etiqueta y el borde se lean bien */
.dev-cover::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(0,0,0,.15), transparent 40%, rgba(0,0,0,.25));
}

/* Miniatura en vivo de la página */
.dev-mini {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: #fff;
}
.dev-mini iframe {
    width: 400%;
    height: 400%;
    border: 0;
    transform: scale(.25);
    transform-origin: 0 0;
    pointer-events: none;
    transition: transform .8s ease;
}

/* reflejo metálico que cruza la portada al pasar el mouse */
.dev-cover::after {
    content: "";
    position: absolute;
    top: 0;
    left: -60%;
    z-index: 1;
    width: 50%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .22), transparent);
    transform: skewX(-20deg);
    transition: left .8s ease;
}
.dev-card:hover .dev-cover::after { left: 120%; }

.dev-status {
    position: absolute;
    z-index: 2;
    top: 14px;
    left: 14px;
    font-weight: 600;
    font-size: .7rem;
    padding: 6px 10px;
    background: rgba(10, 10, 12, .6);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, .12);
    color: #fff;
}
.dev-status .dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
    box-shadow: 0 0 8px currentColor;
}

.dev-card .card-body { padding: 20px 22px 10px; }

.dev-title {
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: -.015em;
    color: #fff;
    margin-bottom: 8px;
}

.dev-desc {
    color: var(--muted);
    font-size: .9rem;
    line-height: 1.55;
    margin-bottom: 0;
}

.dev-card .card-footer {
    background: transparent;
    border-top: 0;
    padding: 14px 22px 22px;
    display: flex;
    gap: 8px;
}

.dev-card .btn-open { flex-grow: 1; font-weight: 600; }
.dev-card .btn-open i { transition: transform .25s ease; }
.dev-card:hover .btn-open i { transform: translateX(4px); }

/* el botón de copiar queda encima del stretched-link */
.dev-card .btn-copy { position: relative; z-index: 2; }

/* ========== Vista lista ========== */
.vista-lista > div { flex: 0 0 100%; max-width: 100%; }
.vista-lista .dev-card { flex-direction: row; align-items: stretch; }
.vista-lista .dev-cover { width: 220px; height: auto; min-height: 120px; flex-shrink: 0; border-bottom: 0; border-right: 1px solid var(--line); }
.vista-lista .dev-status { display: none; }
.vista-lista .dev-card .card-body { padding: 20px 22px; }
.vista-lista .dev-card .card-footer { align-items: center; padding: 20px 22px; }
.vista-lista .dev-card .btn-open { flex-grow: 0; white-space: nowrap; }
.vista-lista .dev-card:hover { transform: translateY(-3px); }

@media (max-width: 575.98px) {
    .vista-lista .dev-card { flex-direction: column; }
    .vista-lista .dev-cover { width: 100%; height: 100px; }
}

/* Animación de entrada */
.fade-in { animation: fadeUp .5s ease both; }
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Vacío */
.empty { text-align: center; color: var(--muted); padding: 60px 0; }
.empty i { font-size: 2.6rem; margin-bottom: 14px; color: rgba(255, 255, 255, .25); }

/* Toast */
.toast { background: rgba(20, 20, 24, .92); backdrop-filter: blur(10px); border: 1px solid var(--line) !important; }

/* Tooltips */
.tooltip-inner { background: #fff; color: #111; font-weight: 500; }
.bs-tooltip-top .tooltip-arrow::before { border-top-color: #fff; }
.bs-tooltip-bottom .tooltip-arrow::before { border-bottom-color: #fff; }

/* ========== Footer fijo ========== */
.footer {
    border-top: 1px solid var(--line);
    background: linear-gradient(90deg, rgba(8, 8, 10, .88), rgba(40, 8, 14, .88) 50%, rgba(8, 8, 10, .88));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 14px 0;
    font-size: .85rem;
    color: var(--muted);
}
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    text-decoration: none;
    transition: color .2s;
}
.footer-brand:hover { color: #fff; }
.footer-logo { width: 20px; height: 20px; }

.dev-credit {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, .04);
    color: #fff;
    font-weight: 500;
}
.dev-credit i { color: var(--accent-light); }

/* en celular el footer se apila y ocupa más alto */
@media (max-width: 767.98px) {
    body { padding-bottom: 150px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
