/* =========================================
   01. RESET E GLOBAIS
========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Fira Code', monospace;
    line-height: 1.6;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

@font-face {
    font-display: swap;
    font-family: 'Fira Code';
    font-style: normal;
    font-weight: 400;
    src: url('/assets/fonts/fira-code-v27-latin-regular.woff2') format('woff2');
}

@font-face {
    font-display: swap;
    font-family: 'Fira Code';
    font-style: normal;
    font-weight: 700;
    src: url('/assets/fonts/fira-code-v27-latin-700.woff2') format('woff2');
}

/* =========================================
   02. VARIÁVEIS
========================================= */
:root {
    --bg: #030503;
    --card-bg: #070d07;
    --neon: #00ff41;
    --dim: #008f11;
    --text: #e0ffe0;
    --black: #000000;
    --gray-dark: #111111;
    --gray-light: #666666;
    --white: #ffffff;

    --bg-rgb: 3, 5, 3;
    --neon-rgb: 0, 255, 65;

    --glow: rgba(var(--neon-rgb), 0.2);
    --toast-bg: rgba(10, 15, 10, 0.85);
    --shadow-dark: rgba(0, 0, 0, 0.5);
}

.pink-mode {
    --bg: #ffffff;
    --card-bg: #fff0f5;
    --neon: #ff1493;
    --dim: #ff69b4;
    --text: #2a081a;
    --black: #ffffff;
    --gray-dark: #ffe4e1;
    --gray-light: #ffb6c1;
    --white: #1a0510;

    --bg-rgb: 255, 255, 255;
    --neon-rgb: 255, 20, 147;

    --glow: rgba(var(--neon-rgb), 0.15);
    --toast-bg: rgba(255, 240, 245, 0.95);
    --shadow-dark: rgba(255, 20, 147, 0.1);
}

/* =========================================
   03. TIPOGRAFIA
========================================= */
pre,
code {
    font-family: inherit;
    text-transform: none;
}

pre {
    background: var(--black);
    padding: 20px;
    border: 1px solid var(--dim);
    margin: 20px auto;
    display: block;
    width: max-content;
    max-width: 100%;
    overflow-x: auto;
    text-align: left;
    white-space: pre;
}

code {
    color: var(--neon);
}

blockquote {
    border-left: 3px solid var(--neon);
    background: rgba(var(--neon-rgb), 0.03);
    margin: 30px 0;
    padding: 20px;
    font-style: italic;
    opacity: 0.8;
}

ul {
    list-style: none;
    padding-left: 0;
}

ul li::before {
    content: "> ";
    color: var(--neon);
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 40px;
    border-left: 4px solid var(--neon);
    padding-left: 20px;
    color: var(--neon);
    text-shadow: 0 0 10px var(--glow);
}

/* =========================================
   04. COMPONENTES
========================================= */

/* --- Estrutura Geral e Layouts Base --- */
.content-section,
.container-view {
    max-width: 1300px;
    margin: 0 auto;
    padding: 120px 10% 80px;
}

.container-internal,
.section-internal {
    padding-top: 0;
}

.container-internal {
    margin-top: 0;
}

.section-internal {
    padding: 0;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

/* --- Navegação --- */
nav {
    background: rgba(var(--bg-rgb), 0.7);
    border-bottom: 1px solid var(--glow);
    padding: 1.2rem 10%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.logo {
    color: var(--neon);
    font-weight: bold;
    letter-spacing: 2px;
    text-shadow: 0 0 10px var(--neon);
    text-decoration: none;
}

.links a,
.footer-links a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.links a {
    margin-left: 25px;
    opacity: 0.8;
}

.footer-links a {
    opacity: 0.8;
    margin: 0 15px;
}

.links a:hover,
.links a:focus-visible,
.links a.active,
.footer-links a:hover,
.footer-links a:focus-visible {
    color: var(--neon);
    opacity: 1;
}

.links a:hover,
.links a:focus-visible,
.links a.active {
    text-shadow: 0 0 12px var(--neon);
}

/* --- Footer --- */
footer {
    background: linear-gradient(to bottom, var(--black), var(--card-bg));
    border-top: 1px solid var(--glow);
    box-shadow: 0 -10px 30px rgba(var(--neon-rgb), 0.02);
    padding: 30px 10% 25px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    position: relative;
}

.footer-links {
    display: flex;
    gap: 30px;
    margin-bottom: 0;
}

.footer-links a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
    letter-spacing: 1px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.8;
}

.footer-links a:hover,
.footer-links a:focus-visible {
    color: var(--neon);
    opacity: 1;
    text-shadow: 0 0 10px var(--neon);
}

.footer-status p {
    color: var(--text);
    font-size: 0.8rem;
    opacity: 0.8;
    font-weight: normal;
}

.footer-copy {
    color: var(--neon);
    font-size: 0.65rem;
    letter-spacing: 2px;
    margin-top: 0;
}

.footer-status-dot {
    height: 8px;
    width: 8px;
    background-color: var(--neon);
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    box-shadow: 0 0 10px var(--neon);
    animation: pulse 2s infinite;
}

/* --- Headers e Heroes --- */
header,
.hero-internal {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
}

header {
    min-height: 100svh;
    background: radial-gradient(circle at center, rgba(var(--neon-rgb), 0.18) 0%, var(--bg) 80%);
    transform: translateZ(0);
}

.hero-internal {
    min-height: 60svh;
    background: radial-gradient(circle at center, rgba(var(--neon-rgb), 0.15) 0%, var(--bg) 100%);
}

.hero-title,
.hero-internal-title {
    color: var(--neon);
    position: relative;
}

.hero-title {
    font-size: clamp(2.5rem, 10vw, 5rem);
}

.hero-internal-title {
    font-size: 3rem;
}

.hero-internal-desc,
.article-subheader {
    opacity: 0.8;
    font-size: 0.8rem;
    letter-spacing: 4px;
}

/* --- Botões e Ações --- */
.btn,
.card-link {
    color: var(--neon);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: bold;
    border: 1px solid var(--neon);
    padding: 10px 20px;
    transition: 0.3s;
    background: transparent;
    text-align: center;
    cursor: pointer;
}

.btn {
    display: inline-block;
}

.card-link {
    display: block;
    align-self: flex-start;
    margin-top: auto;
}

.btn-back {
    margin: 20px 0;
}

.btn:hover,
.btn:focus-visible,
.card-link:hover,
.card-link:focus-visible {
    background: var(--neon);
    color: var(--bg);
    box-shadow: 0 0 15px var(--neon);
}

/* --- Cards --- */
.card,
.card-empty {
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.card {
    background: var(--card-bg);
    border: 1px solid rgba(var(--neon-rgb), 0.05);
    transition: 0.5s cubic-bezier(0.2, 1, 0.3, 1);
    text-decoration: none;
    height: 100%;
}

.card h2 {
    color: var(--neon);
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.card p {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 20px;
    flex-grow: 1;
}

.card:hover,
.card:focus-visible,
.card-post:hover,
.card-post:focus-visible {
    border-color: var(--neon);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow-dark);
}

.card-empty {
    border: 1px dashed var(--dim);
    justify-content: center;
    align-items: center;
    opacity: 0.8;
    min-height: 200px;
}

.card-empty p,
.card-post-empty p {
    font-size: 0.72rem;
    margin: 0;
    opacity: 0.8;
}

/* --- Artigos / Posts --- */
.article-header {
    margin-top: 40px;
    border-bottom: 1px solid var(--dim);
    padding-bottom: 20px;
}

.article-header .hero-title {
    font-size: 3rem;
    text-align: left;
}

.article-date {
    font-size: 0.7rem;
    color: var(--dim);
    margin-bottom: 5px;
}

.article-body {
    max-width: 800px;
    margin: 0 auto;
}

.article-body h1 {
    color: var(--neon);
    font-size: 2.2rem;
    margin-bottom: 20px;
}

.article-body p,
.article-content p,
.article-content ul {
    margin-bottom: 20px;
}

.article-content {
    margin-top: 40px;
    font-size: 1.05rem;
    color: var(--text);
}

.article-content p,
.article-content li {
    opacity: 0.8;
}

.article-content p.article-date {
    opacity: 1;
}

.article-content h2 {
    color: var(--neon);
    margin: 20px 0;
    border-bottom: 1px solid rgba(var(--neon-rgb), 0.1);
    display: inline-block;
    padding-bottom: 5px;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
    border: 1px solid var(--neon);
}

/* --- Sistema de Imagens --- */
.card-img-wrapper {
    width: 100%;
    display: block;
    margin: 1.5rem 0 5px;
    cursor: pointer;
    background-color: var(--card-bg);
    position: relative;
}

.card-img-wrapper img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border: 1px solid var(--dim);
    opacity: 0.8;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card .card-img-wrapper {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    margin-bottom: 15px;
}

.card .card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: var(--card-bg);
}

.card:hover .card-img-wrapper img,
.card:focus-visible .card-img-wrapper img,
.card-img-wrapper:hover img,
.card-img-wrapper:focus-visible img {
    opacity: 1;
    border-color: var(--neon);
    box-shadow: 0 0 15px var(--glow);
}

.fullscreen-modal {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(var(--bg-rgb), 0.98);
    z-index: 9999;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.fullscreen-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-img-container {
    max-width: 95%;
    width: fit-content;
    height: 75vh;
    max-height: 75vh;
    overflow: hidden;
    border: 1px solid var(--dim);
    box-shadow: 0 0 30px rgba(var(--neon-rgb), 0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    transition: border-color 0.3s ease;
}

.fullscreen-modal img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: crosshair;
    transform: scale(0.95) translate(0px, 0px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.2, 1, 0.3, 1), opacity 0.25s ease;
    user-select: none;
    -webkit-user-drag: none;
}

.fullscreen-modal.active img {
    transform: scale(1) translate(0px, 0px);
    opacity: 1;
}

.fullscreen-modal img.zoomed-state {
    opacity: 1;
    transition: transform 0.25s cubic-bezier(0.2, 1, 0.3, 1), opacity 0.25s ease;
}

.fullscreen-modal img.grabbing {
    cursor: grabbing;
    transition: transform 0s;
}

.fullscreen-modal .btn-back {
    margin: 0;
    cursor: pointer;
    z-index: 10000;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.2, 1, 0.3, 1) 0.1s;
}

.fullscreen-modal.active .btn-back {
    opacity: 1;
    transform: translateY(0);
}

/* --- Scripts Base --- */
#fileInput {
    display: none;
}

.tool-box {
    margin: 40px 0;
    padding: 30px;
    background: rgba(var(--neon-rgb), 0.02);
    border: 1px solid var(--dim);
    text-align: center;
}

.upload-area {
    border: 2px dashed var(--dim);
    padding: 40px;
    margin: 20px 0;
    display: block;
    cursor: pointer;
    transition: 0.3s;
    color: var(--text);
}

.upload-area:hover,
.upload-area:focus-within {
    border-color: var(--neon);
    background: rgba(var(--neon-rgb), 0.05);
    color: var(--text);
    outline: none;
}

.upload-area.dragover {
    border-color: var(--neon);
    background: rgba(var(--neon-rgb), 0.15);
    color: var(--neon);
    transform: scale(0.99);
}

.log-area {
    background: var(--black);
    color: var(--neon);
    padding: 15px;
    font-size: 0.8rem;
    text-align: left;
    margin-top: 20px;
    border: 1px solid var(--gray-dark);
    min-height: 80px;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
}

.download-btn {
    display: none;
    margin-top: 20px;
    width: 100%;
    cursor: pointer;
    padding: 15px;
}

.preset-container {
    display: none;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.preset-btn {
    font-size: 0.85rem;
    padding: 10px 15px;
}

/* --- Pop-ups (Toasts) --- */
.toast-popup {
    position: fixed;
    bottom: -150px;
    width: calc(100% - 40px);
    max-width: 350px;
    background-color: var(--toast-bg);
    border: 1px solid rgba(var(--neon-rgb), 0.2);
    box-shadow: 0 4px 20px var(--shadow-dark);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 4px;
    padding: 12px;
    display: flex;
    align-items: center;
    z-index: 9999;
    color: var(--white);
    font-size: 0.85rem;
    transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), transform 0.4s ease, opacity 0.3s ease;
    opacity: 0;
}

.toast-right {
    right: 20px;
}

.toast-left {
    left: 20px;
}

.toast-popup.toast-show {
    bottom: 20px;
    opacity: 1;
}

.toast-icon {
    color: var(--neon);
    font-weight: bold;
    font-size: 1.2rem;
    margin-right: 10px;
    animation: toast-popup-blink 1.5s step-end infinite;
}

.toast-divider {
    width: 2px;
    align-self: stretch;
    background-color: var(--neon);
    margin-right: 12px;
    box-shadow: 0 0 8px var(--neon);
}

.toast-content {
    flex-grow: 1;
    line-height: 1.4;
    word-break: break-word;
}

.toast-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
}

.toast-close,
.toast-ignore {
    background: none;
    border: none;
    color: var(--gray-light);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 2px;
    line-height: 1;
    transition: color 0.2s, text-shadow 0.2s;
}

.toast-close:hover,
.toast-close:focus-visible,
.toast-ignore:hover,
.toast-ignore:focus-visible {
    color: var(--neon);
    text-shadow: 0 0 5px var(--neon);
}

/* =========================================
   05. UTILITÁRIOS E ANIMAÇÕES
========================================= */
@keyframes toast-popup-blink {

    from,
    to {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.4;
        box-shadow: 0 0 4px var(--glow);
    }

    50% {
        opacity: 1;
        box-shadow: 0 0 12px var(--neon);
    }
}