:root {
    --bg-base: #0f1115;
    --surface: #181b22;
    --surface-hover: #222632;
    --border-color: #2b303c;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --primary: #facc15;
    --primary-hover: #eab308;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* HEADER Y NAVEGACIÓN COMPACTA (SIN SCROLL HORIZONTAL) */
header {
    background-color: var(--surface);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    overflow: hidden;
}

.brand-logo {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: -0.5px;
    white-space: nowrap;
    flex-shrink: 0;
}

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

.nav-right-group {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2px;
    align-items: center;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 5px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-btn:hover {
    color: var(--text-main);
    background: var(--surface-hover);
}

.nav-btn.active {
    background: var(--primary);
    color: #000;
}

.theme-toggle-btn {
    background: var(--surface-hover);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    flex-shrink: 0;
    margin-left: 2px;
}

/* CONTENEDOR PRINCIPAL Y SECCIONES */
.main-container {
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
    padding: 16px 12px;
    flex: 1;
}

.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.25s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    margin-bottom: 14px;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 4px;
    line-height: 1.2;
}

.section-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.3;
}

/* BARRA DE CATEGORÍAS (CHIPS) */
.categories-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 14px;
    scrollbar-width: none;
}

.categories-bar::-webkit-scrollbar {
    display: none;
}

.cat-chip {
    background: var(--surface);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.cat-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #000;
}

/* GRID DE CÓMICS / SERIES */
.comics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.comic-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
}

.comic-card img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    background: var(--surface-hover);
}

.comic-card-info {
    padding: 10px;
}

.comic-card-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.comic-card-chapters {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* BUSCADOR */
.search-wrapper {
    position: relative;
    margin-bottom: 14px;
}

.search-input {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px 10px 36px;
    color: var(--text-main);
    font-size: 0.85rem;
    outline: none;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* VISTA DETALLE DE SERIE */
.series-hero {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.series-hero img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.chapters-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.chapter-item {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.release-schedule-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

/* PANEL ADMINISTRACIÓN Y FORMULARIOS */
.admin-container {
    max-width: 600px;
    margin: 0 auto;
}

.admin-minimal-box {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 14px;
}

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

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.form-input {
    width: 100%;
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 10px;
    color: var(--text-main);
    font-size: 0.85rem;
    outline: none;
}

.btn-subtle {
    width: 100%;
    background: var(--primary);
    border: none;
    color: #000;
    font-weight: 700;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
}

.admin-divider {
    height: 1px;
    background: var(--border-color);
    margin: 14px 0;
}

/* VISOR VERTICAL WEBTOON */
.reader-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: #000 !important;
    z-index: 99999 !important;
    display: none;
    flex-direction: column !important;
}

.reader-top-bar {
    width: 100% !important;
    background: rgba(15, 17, 21, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.reader-comic-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 65%;
}

.reader-close-btn {
    background: var(--surface-hover);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

.reader-vertical-viewport {
    width: 100% !important;
    flex: 1 !important;
    overflow-y: auto !important;
    background: #000 !important;
    display: flex !important;
    justify-content: center !important;
}

.vertical-pages-container {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
}
