:root {
    --bg-color: #05080c;
    --panel-color: #0c131a;
    --terminal-color: #070b0f;
    --primary: #00ff66; /* Verde Matrix */
    --secondary: #00e5ff; /* Cian Cyberpunk */
    --text-main: #e2e8f0;
    --text-muted: #4e6178;
    --border: #142534;
    --glow: rgba(0, 255, 102, 0.2);
    /* Color de la lluvia de fondo (sutil) */
    --matrix-rain-color: rgba(0, 255, 102, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Fira Code", monospace;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 28px 20px 40px;
    position: relative;
    overflow-x: hidden;
    line-height: 1.6;
}

a {
    color: var(--secondary);
}

p {
    color: #a9b8c8;
}

code {
    color: var(--primary);
    background: rgba(0, 255, 102, 0.08);
    border: 1px solid rgba(0, 255, 102, 0.12);
    border-radius: 4px;
    padding: 2px 5px;
}

/* ESTILOS DEL CANVAS DE FONDO (NUEVO) */
#matrix-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0; /* Detrás de todo */
    overflow: hidden;
    pointer-events: all; /* Permitir que capture clics */
}

#matrixCanvas {
    width: 100%;
    height: 100%;
}

.page-shell {
    width: min(1100px, 100%);
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 650px) minmax(260px, 1fr);
    gap: 24px;
    align-items: start;
}

/* Contenedor Principal Premium */
.mainframe {
    width: 100%;
    max-width: 650px;
    background: var(--panel-color);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.7),
        0 0 15px rgba(0, 229, 255, 0.05);
    overflow: hidden;
    z-index: 1; /* Por delante del canvas */
    transition: box-shadow 0.2s ease;
    /* Un ligero difuminado detrás del panel para que el fondo no distraiga */
    backdrop-filter: blur(2px);
}

.tool-intro {
    margin-bottom: 24px;
}

.eyebrow {
    color: var(--secondary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

h1,
h2,
h3 {
    color: var(--text-main);
    line-height: 1.2;
}

h1 {
    color: var(--primary);
    font-size: clamp(1.7rem, 4vw, 2.8rem);
    margin-bottom: 12px;
    text-shadow: 0 0 18px rgba(0, 255, 102, 0.22);
}

h2 {
    font-size: clamp(1.25rem, 2.5vw, 1.65rem);
    margin-bottom: 12px;
}

h3 {
    font-size: 1rem;
    margin-bottom: 8px;
}

/* Resto de estilos permanecen igual */
.mainframe.pulse-flash {
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.7),
        0 0 25px rgba(0, 255, 102, 0.4);
}

.window-header {
    background: #090e14;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.window-dots {
    display: flex;
    gap: 8px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.dot.r {
    background: #ff5555;
}
.dot.y {
    background: #ffb86c;
}
.dot.g {
    background: #50fa7b;
}

.window-title {
    color: var(--secondary);
    font-size: 0.8rem;
    letter-spacing: 2px;
    font-weight: 700;
    text-transform: uppercase;
}

.system-status {
    font-size: 0.75rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--primary);
    animation: pulse 1.5s infinite;
}

.window-body {
    padding: 30px;
}

.console-log {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 25px;
    line-height: 1.4;
}

.display-box {
    background: var(--terminal-color);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.display-box:focus-within {
    border-color: var(--secondary);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.1);
}

.uuid-output {
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: 1.1rem;
    width: 100%;
    outline: none;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: color 0.1s ease;
}

.uuid-output.scanning {
    color: var(--secondary);
    text-shadow: 0 0 8px var(--secondary);
}

.controls-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 15px;
    margin-bottom: 25px;
}

.input-wrapper {
    background: var(--terminal-color);
    border: 1px solid var(--border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding: 0 15px;
}

.input-wrapper label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-right: 10px;
    white-space: nowrap;
}

.quantity-input {
    -moz-appearance: textfield;
    appearance: textfield;
    background: transparent;
    border: none;
    color: var(--text-main);
    width: 100%;
    min-width: 0;
    padding: 12px 0;
    outline: none;
    font-size: 1rem;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-stepper {
    display: grid;
    grid-template-rows: repeat(2, 1fr);
    gap: 4px;
    width: 30px;
    height: 34px;
    margin-left: 10px;
}

.quantity-step-btn {
    background: rgba(0, 229, 255, 0.06);
    border: 1px solid rgba(0, 229, 255, 0.35);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.quantity-step-btn::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
}

.quantity-step-up::before {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 5px solid var(--secondary);
}

.quantity-step-down::before {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--secondary);
}

.quantity-step-btn:hover {
    background: rgba(0, 255, 102, 0.08);
    border-color: rgba(0, 255, 102, 0.45);
    box-shadow: 0 0 10px rgba(0, 255, 102, 0.12);
}

.btn {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s ease;
}

.btn:hover {
    background: rgba(0, 255, 102, 0.1);
    box-shadow: 0 0 12px var(--glow);
    text-shadow: 0 0 5px var(--primary);
}

.btn-cyan {
    border-color: var(--secondary);
    color: var(--secondary);
}

.btn-cyan:hover {
    background: rgba(0, 229, 255, 0.1);
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.2);
    text-shadow: 0 0 5px var(--secondary);
}

.w-100 {
    width: 100%;
}

.batch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 0.75rem;
}

.batch-title {
    color: var(--secondary);
}

.batch-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.batch-copy {
    background: rgba(0, 255, 102, 0.04);
    border: 1px solid rgba(0, 255, 102, 0.25);
    border-radius: 3px;
    color: var(--primary);
    cursor: pointer;
    font: inherit;
    padding: 5px 7px;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, text-shadow 0.2s ease;
}

.batch-download {
    background: rgba(0, 229, 255, 0.04);
    border-color: rgba(0, 229, 255, 0.25);
    color: var(--secondary);
}

.batch-copy:hover {
    background: rgba(0, 255, 102, 0.1);
    border-color: rgba(0, 255, 102, 0.45);
    box-shadow: 0 0 10px rgba(0, 255, 102, 0.12);
    text-shadow: 0 0 8px var(--primary);
}

.batch-download:hover {
    background: rgba(0, 229, 255, 0.1);
    border-color: rgba(0, 229, 255, 0.45);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.12);
    text-shadow: 0 0 8px var(--secondary);
}

.sql-export-panel {
    background: rgba(7, 11, 15, 0.72);
    border: 1px solid rgba(20, 37, 52, 0.85);
    border-radius: 4px;
    display: grid;
    gap: 12px;
    margin-bottom: 12px;
    padding: 14px;
}

.sql-export-heading span {
    color: var(--secondary);
    display: block;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    margin-bottom: 4px;
}

.sql-export-heading p {
    font-size: 0.78rem;
}

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

.sql-input-wrapper {
    background: rgba(5, 8, 12, 0.85);
    border: 1px solid var(--border);
    border-radius: 4px;
    display: grid;
    gap: 6px;
    padding: 10px 12px;
}

.sql-input-wrapper span {
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.sql-input-wrapper input {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 0.9rem;
    outline: none;
}

.sql-input-wrapper:focus-within {
    border-color: var(--secondary);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.1);
}

.terminal-block {
    background: var(--terminal-color);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 15px;
    max-height: 220px;
    overflow-y: auto;
}

.terminal-block::-webkit-scrollbar {
    width: 6px;
}
.terminal-block::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.terminal-row {
    font-size: 0.85rem;
    padding: 6px 0;
    border-bottom: 1px solid rgba(20, 37, 52, 0.4);
    display: flex;
    justify-content: space-between;
    color: #a0aec0;
}

.terminal-row span.index {
    color: var(--text-muted);
    margin-right: 15px;
}

.hidden {
    display: none !important;
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
}

.hacker-toast {
    background: #090f16;
    border-left: 4px solid var(--secondary);
    border-top: 1px solid var(--border);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    padding: 12px 20px;
    border-radius: 0 4px 4px 0;
    font-size: 0.8rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(120%);
    animation: slideIn 0.3s forwards;
}

.hacker-toast .toast-tag {
    color: var(--secondary);
    font-weight: bold;
}

.monetization-panel {
    display: grid;
    gap: 18px;
}

.ad-slot,
.support-card,
.info-panel,
.code-section,
.affiliate-section,
.faq-section,
.legal-card {
    background: rgba(12, 19, 26, 0.92);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
}

.ad-slot {
    min-height: 250px;
    padding: 24px;
    display: grid;
    place-items: center;
    text-align: center;
    border-style: dashed;
    background:
        linear-gradient(135deg, rgba(0, 229, 255, 0.05), rgba(0, 255, 102, 0.03)),
        rgba(7, 11, 15, 0.92);
}

.ad-slot span {
    color: var(--secondary);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.manual-ad {
    width: 100%;
}

.manual-ad-sidebar {
    min-height: 250px;
}

.manual-ad-horizontal {
    min-height: 90px;
}

.ad-slot-loaded > span {
    display: none;
}

.ad-slot-wide {
    min-height: 120px;
}

.support-card,
.info-panel,
.code-section,
.affiliate-section,
.faq-section,
.legal-card {
    padding: 28px;
}

.support-card .btn {
    display: inline-block;
    margin-top: 18px;
    text-align: center;
    text-decoration: none;
}

.content-grid,
.resource-grid,
.faq-grid,
.code-grid {
    display: grid;
    gap: 18px;
}

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

.feature-list {
    margin-top: 14px;
    padding-left: 20px;
    color: #a9b8c8;
}

.feature-list li + li {
    margin-top: 8px;
}

.code-section {
    display: grid;
    gap: 20px;
}

.code-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.code-card,
.faq-item,
.resource-card,
.contact-box {
    background: var(--terminal-color);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 18px;
}

.code-card pre {
    overflow-x: auto;
}

.code-card-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 10px;
}

.code-card-header h3 {
    margin-bottom: 0;
}

.copy-code-btn {
    background: rgba(0, 229, 255, 0.06);
    border: 1px solid rgba(0, 229, 255, 0.35);
    color: var(--secondary);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 6px 9px;
    transition: background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.copy-code-btn:hover {
    background: rgba(0, 229, 255, 0.14);
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.16);
}

.copy-code-btn.is-copied {
    border-color: rgba(0, 255, 102, 0.45);
    color: var(--primary);
}

.code-card code {
    display: block;
    background: transparent;
    border: none;
    padding: 0;
    white-space: pre;
}

.section-heading {
    margin-bottom: 20px;
}

.resource-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.resource-card {
    display: block;
    color: var(--text-main);
    text-decoration: none;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.resource-card:hover {
    border-color: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 0 18px rgba(0, 229, 255, 0.12);
}

.resource-card span,
.contact-box span {
    display: block;
    color: var(--secondary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.4px;
    margin-bottom: 8px;
}

.resource-card strong {
    display: block;
    margin-bottom: 10px;
}

.resource-card p,
.faq-item p {
    font-size: 0.9rem;
}

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

.site-footer {
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    border-top: 1px solid var(--border);
    padding: 22px 0 0;
    font-size: 0.82rem;
}

.site-footer nav {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.site-footer a {
    color: var(--secondary);
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

.legal-shell {
    max-width: 860px;
}

.legal-card h1 {
    margin-bottom: 18px;
}

.legal-card h2 {
    margin-top: 28px;
}

.legal-card .btn {
    display: inline-block;
    margin-top: 28px;
    text-decoration: none;
}

.contact-box {
    margin: 22px 0 12px;
}

.muted-note {
    color: var(--text-muted);
    font-size: 0.85rem;
}

@media (max-width: 920px) {
    .hero-grid,
    .content-grid,
    .code-grid,
    .resource-grid,
    .faq-grid {
        grid-template-columns: 1fr;
    }

    .mainframe {
        max-width: none;
    }

    .ad-slot {
        min-height: 150px;
    }
}

@media (max-width: 620px) {
    body {
        padding: 14px;
    }

    .window-header,
    .display-box,
    .controls-grid,
    .site-footer {
        gap: 12px;
    }

    .window-header,
    .display-box,
    .site-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .window-title,
    .system-status {
        text-align: center;
        justify-content: center;
    }

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

    .window-body,
    .support-card,
    .info-panel,
    .code-section,
    .affiliate-section,
    .faq-section,
    .legal-card {
        padding: 20px;
    }

    .uuid-output,
    .terminal-row {
        font-size: 0.82rem;
    }

    .terminal-row {
        flex-direction: column;
        gap: 4px;
    }

    .batch-header {
        flex-direction: column;
        align-items: stretch;
    }

    .batch-actions {
        justify-content: flex-start;
    }

    .sql-input-grid {
        grid-template-columns: 1fr;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0.6;
    }
}

@keyframes slideIn {
    to {
        transform: translateX(0);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}
