/* ============================================
   ESTILOS GLOBALES - CROWCLOCK STUDIOS
   Colores: Oscuros, acogedores, letras blancas
   ============================================ */

:root {
    --bg-dark: #1a1a1a;
    --bg-card: #2a2a2a;
    --bg-sidebar: #111111;
    --text-main: #e0e0e0;
    --text-muted: #a0a0a0;
    --accent: #c0392b;
    --accent-hover: #e74c3c;
    --border-color: #333333;
    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
}

/* ============================================
   MENÚ LATERAL
   ============================================ */

.sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    padding: 20px;
    border-right: 1px solid var(--border-color);
    height: 100vh;
    overflow-y: auto;
    position: sticky;
    top: 0;
    flex-shrink: 0;
    transition: width 0.3s ease;
}

.sidebar h1 {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.sidebar .subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 30px;
    text-transform: uppercase;
}

.sidebar nav ul {
    list-style: none;
}

.sidebar nav li {
    margin-bottom: 5px;
}

.sidebar nav a {
    color: var(--text-main);
    text-decoration: none;
    display: block;
    padding: 8px 10px;
    border-radius: 4px;
    transition: background 0.2s;
    font-size: 0.95rem;
}

.sidebar nav a:hover {
    background-color: var(--bg-card);
    color: #fff;
}

/* Carpetas plegables */
.sidebar .folder {
    cursor: pointer;
    font-weight: bold;
    color: #fff;
    padding: 8px 10px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar .folder:hover {
    background-color: var(--bg-card);
}

.sidebar .folder-content {
    display: none;
    padding-left: 15px;
    margin-top: 5px;
    border-left: 1px solid var(--border-color);
}

.sidebar .folder.open + .folder-content {
    display: block;
}

.sidebar .folder::after {
    content: '▼';
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.sidebar .folder.open::after {
    transform: rotate(180deg);
}

/* ============================================
   CONTENIDO PRINCIPAL
   ============================================ */

.main-content {
    flex: 1;
    padding: 40px 50px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.main-content h1 {
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 10px;
}

.main-content h2 {
    font-size: 1.8rem;
    color: #fff;
    margin-top: 30px;
    margin-bottom: 15px;
}

.main-content h3 {
    font-size: 1.3rem;
    color: #fff;
    margin-top: 20px;
    margin-bottom: 10px;
}

.main-content p {
    margin-bottom: 15px;
    color: var(--text-main);
}

.main-content a {
    color: var(--accent-hover);
    text-decoration: none;
}

.main-content a:hover {
    text-decoration: underline;
}

/* Listas anidadas (Habilidades con sub-puntos) */
.main-content ul ul {
    margin-left: 20px;
    margin-top: 5px;
    margin-bottom: 10px;
}

.main-content ul ul li {
    margin-bottom: 4px;
    color: var(--text-muted);
}

.main-content ul ul li strong {
    color: var(--text-main);
}

/* ============================================
   TARJETAS Y CAJAS
   ============================================ */

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

/* ============================================
   INFO BOX (Personajes)
   ============================================ */

.info-box {
    flex: 0 0 340px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    max-height: 600px;
    overflow-y: auto;
    position: sticky;
    top: 20px;
    margin-bottom: 20px;
}

.info-box::-webkit-scrollbar {
    width: 8px;
}
.info-box::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
.info-box::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
.info-box::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.info-box .info-image {
    width: 100%;
    max-width: 100%;
    margin-bottom: 15px;
}

.info-box .info-image img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.info-box .info-details {
    flex: 2 1 300px;
}

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

.info-box table th {
    text-align: left;
    padding: 8px;
    background-color: rgba(0,0,0,0.2);
    color: #fff;
    font-weight: bold;
    border-bottom: 1px solid var(--border-color);
}

.info-box table td {
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.info-box table tr:last-child td {
    border-bottom: none;
}

/* Listas dentro de la info box */
.info-box table td ul {
    list-style: disc;
    padding-left: 18px;
    margin: 0;
}

.info-box table td ul li {
    margin-bottom: 3px;
    line-height: 1.4;
}

.info-box table td ul li:last-child {
    margin-bottom: 0;
}

/* ============================================
   LAYOUT DE PERSONAJE (contenido + info box)
   ============================================ */

.character-layout {
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

.character-content {
    flex: 1;
    min-width: 0;
}

/* ============================================
   PESTAÑAS (TABS) Y SUB-PESTAÑAS
   ============================================ */

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.tab-button {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 4px 4px 0 0;
    font-size: 0.9rem;
    transition: all 0.2s;
    font-family: inherit;
}

.tab-button:hover {
    background-color: var(--bg-card);
    color: #fff;
}

.tab-button.active {
    background-color: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.sub-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 20px 0 15px 0;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.sub-tab-button {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 6px 14px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.85rem;
    transition: all 0.2s;
    font-family: inherit;
}

.sub-tab-button:hover {
    background-color: var(--bg-card);
    color: #fff;
}

.sub-tab-button.active {
    background-color: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.sub-tab-content {
    display: none;
}

.sub-tab-content.active {
    display: block;
}

/* ============================================
   TABLAS GENERALES
   ============================================ */

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

table th, table td {
    border: 1px solid var(--border-color);
    padding: 10px;
    text-align: left;
}

table th {
    background-color: rgba(0,0,0,0.3);
    color: #fff;
}

table tr:nth-child(even) {
    background-color: rgba(255,255,255,0.02);
}

/* ============================================
   GALERÍA DE PERSONAJES (Grid)
   ============================================ */

.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 10px;
    margin-bottom: 50px;
}

.character-grid:last-of-type {
    margin-bottom: 20px;
}

.character-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s;
    text-decoration: none;
    color: var(--text-main);
}

.character-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}

.character-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.character-card .name {
    padding: 10px;
    font-weight: bold;
    background-color: rgba(0,0,0,0.5);
    color: #fff;
}

/* ============================================
   CABECERA DE PROYECTO (Personajes / Portafolio)
   ============================================ */

.project-header {
    display: flex;
    gap: 25px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    align-items: stretch;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.project-header:hover {
    border-color: var(--accent);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.project-cover {
    flex: 0 0 300px;
}

.project-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

.project-info {
    flex: 1;
}

.project-info h2 {
    margin-top: 0;
    border: none;
    padding: 0;
}

.project-info .project-tags {
    margin: 10px 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.project-info .project-tags span {
    display: inline-block;
    background-color: var(--bg-dark);
    padding: 3px 10px;
    border-radius: 12px;
    margin-right: 5px;
    border: 1px solid var(--border-color);
}

/* ============================================
   CITA GRANDE DEL PERSONAJE
   ============================================ */

.character-quote {
    background-color: var(--bg-card);
    border-left: 4px solid var(--accent);
    padding: 25px 30px;
    margin: 20px 0 30px 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    font-size: 1.15rem;
    color: #d0d0d0;
    line-height: 1.7;
    position: relative;
}

.character-quote::before {
    content: '"';
    font-size: 4rem;
    color: var(--accent);
    opacity: 0.3;
    position: absolute;
    top: -10px;
    left: 10px;
    font-family: Georgia, serif;
}

.character-quote .quote-author {
    display: block;
    margin-top: 15px;
    font-style: normal;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: right;
}

/* ============================================
   CONVERSACIONES
   ============================================ */

.conversacion {
    background-color: var(--bg-card);
    border-left: 3px solid var(--accent);
    padding: 15px 20px;
    margin: 15px 0;
    border-radius: 0 6px 6px 0;
    font-size: 0.95rem;
    line-height: 1.7;
}

.conversacion .personaje {
    color: var(--accent-hover);
    font-weight: bold;
}

.conversacion .accion {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.85rem;
    display: block;
    margin-top: 8px;
    border-top: 1px dashed var(--border-color);
    padding-top: 8px;
}

.conversacion p {
    margin: 0 0 8px 0;
}

/* ============================================
   SAMBLEZA (Info Box horizontal)
   ============================================ */

.sambleza-box {
    display: flex;
    gap: 20px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    align-items: center;
}

.sambleza-box .sambleza-info {
    flex: 1;
}

.sambleza-box .sambleza-info h3 {
    margin-top: 0;
    color: var(--accent-hover);
}

.sambleza-box .sambleza-image {
    flex: 0 0 200px;
}

.sambleza-box .sambleza-image img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    display: block;
}

/* ============================================
   LISTA DE RECIÉN MODIFICADOS (index)
   ============================================ */

.recientes-lista {
    list-style: none;
    padding: 0;
}

.recientes-lista li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.recientes-lista li:last-child {
    border-bottom: none;
}

.recientes-lista a {
    color: var(--accent-hover);
    font-weight: 500;
}

.recientes-lista .fecha {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: monospace;
}

/* ============================================
   CENSURA / SPOILERS
   ============================================ */

/* Bloque colapsable (spoiler grande) */
.spoiler {
    background-color: #000;
    color: #000;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 15px 20px;
    margin: 15px 0;
}

.spoiler summary {
    cursor: pointer;
    color: var(--accent-hover);
    font-weight: bold;
    font-style: italic;
    padding: 5px 0;
    list-style: none;
    user-select: none;
}

.spoiler summary::-webkit-details-marker {
    display: none;
}

.spoiler summary::before {
    content: '🔒 ';
    margin-right: 5px;
}

.spoiler[open] summary::before {
    content: '🔓 ';
}

.spoiler[open] summary {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 15px;
    padding-bottom: 10px;
}

.spoiler .spoiler-content {
    color: var(--text-main);
    font-style: normal;
    font-weight: normal;
    line-height: 1.6;
}

/* Blur sutil: clic para revelar */
.blur-spoiler {
    filter: blur(5px);
    cursor: pointer;
    transition: filter 0.3s ease;
    user-select: none;
    padding: 1px 3px;
    border-radius: 3px;
    background-color: rgba(192, 57, 43, 0.08);
    border-bottom: 1px dashed var(--accent);
}

.blur-spoiler:hover {
    filter: blur(3px);
}

.blur-spoiler.revealed {
    filter: blur(0);
    cursor: text;
    user-select: text;
    background-color: transparent;
    border-bottom: 1px solid transparent;
}

.blur-spoiler::before {
    content: '🔒 ';
    font-size: 0.85em;
    filter: none;
    opacity: 0.8;
}

.blur-spoiler.revealed::before {
    content: '';
}

/* Blur sutil: solo hover */
.blur-hover {
    filter: blur(5px);
    cursor: help;
    transition: filter 0.3s ease;
    padding: 1px 3px;
    border-radius: 3px;
    background-color: rgba(192, 57, 43, 0.08);
    border-bottom: 1px dashed var(--accent);
}

.blur-hover:hover {
    filter: blur(0);
    background-color: transparent;
    border-bottom: 1px solid transparent;
}

/* Blur: bloque entero */
.blur-block {
    filter: blur(6px);
    cursor: pointer;
    transition: filter 0.4s ease;
    user-select: none;
    padding: 10px 15px;
    border-radius: 6px;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px dashed var(--border-color);
}

.blur-block:hover {
    filter: blur(4px);
}

.blur-block.revealed {
    filter: blur(0);
    cursor: text;
    user-select: text;
    background-color: transparent;
    border: 1px solid transparent;
}

/* ============================================
   TÍTULOS DE SECCIÓN (Sobre Mí)
   ============================================ */

.section-title {
    font-size: 2rem;
    color: #fff;
    margin: 50px 0 25px 0;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 10px;
}

/* ============================================
   FOTO DE PERFIL (Sobre Mí)
   ============================================ */

.profile-photo {
    flex: 0 0 260px;
}

.profile-photo img {
    width: 100%;
    height: auto;
    border-radius: 50%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border: 3px solid var(--accent);
    display: block;
}

/* ============================================
   BOTÓN DE ENLACE (Portafolio)
   ============================================ */

.project-link {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 20px;
    background-color: var(--accent);
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.project-link:hover {
    background-color: var(--accent-hover);
    text-decoration: none;
    color: #fff;
}

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

@media (max-width: 900px) {
    .character-layout {
        flex-direction: column-reverse;
    }
    .info-box {
        flex: 1 1 100%;
        max-height: none;
        position: static;
        width: 100%;
    }
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    .main-content {
        padding: 20px;
    }
    .info-box {
        flex-direction: column;
    }
    .info-box .info-image {
        max-width: 100%;
    }
    .tabs {
        flex-direction: column;
    }
    .tab-button {
        width: 100%;
        border-radius: 4px;
        text-align: center;
    }
}

@media (max-width: 700px) {
    .project-header {
        flex-direction: column;
    }
    .project-cover {
        flex: 1 1 100%;
    }
    .profile-photo {
        flex: 1 1 100%;
        max-width: 220px;
        margin: 0 auto;
    }
}

@media (max-width: 600px) {
    .sambleza-box {
        flex-direction: column;
    }
    .sambleza-box .sambleza-image {
        flex: 1 1 100%;
        width: 100%;
    }
}