/* ========== VARIABLES DE COLOR ========== */
:root {
    --primary-bg: #d6daf0;
    --primary-border: #b7c5d9;
    --text-dark: #34345c;
    --text-accent: #af0a0f;
    --accent-hover: #d00;
    --text-green: #117743;
    --text-red: #771111;
    --text-gray: #666;
    --text-light-gray: #89a;
    --success-bg: #ffe6e6;
}

/* ========== RESET Y ESTILOS GENERALES ========== */
a, a:visited {
    color: var(--text-dark);
    text-decoration: none;
}

a:active, a:hover {
    color: var(--accent-hover);
    text-decoration: none;
}

/* ========== HEADER Y NAVEGACIÓN ========== */
.header,
.nav {
    background-color: var(--primary-bg);
    border-bottom: 1px solid var(--primary-border);
    padding: 10px;
    text-align: center;
}

.nav {
    padding: 5px 10px;
}

.header h1 {
    color: var(--text-accent);
    font-size: 24pt;
    font-weight: bold;
    margin-bottom: 5px;
}

.header .subtitle {
    color: var(--text-light-gray);
    font-size: 9pt;
}

.nav a {
    margin: 0 10px;
    font-weight: bold;
}

.nav a:hover {
    color: var(--accent-hover);
}

/* ========== CONTENEDOR PRINCIPAL ========== */
.container {
    max-width: 1000px;
    margin: 20px auto;
    padding: 0 5px;
}

/* ========== TABLONES (INDEX) ========== */
.intro {
    background-color: var(--primary-bg);
    border: 1px solid var(--primary-border);
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.intro h2 {
    color: #0f0c5d;
    font-size: 20pt;
    margin-bottom: 10px;
}

.boards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.board-card {
    background-color: var(--primary-bg);
    border: 1px solid var(--primary-border);
    padding: 15px;
    color: #000;
    cursor: pointer;
    transition: background-color 0.2s;
}

.board-card:hover {
    background-color: #c5cfe0;
}

.board-title {
    color: #0f0c5d;
    font-size: 20pt;
    font-weight: bold;
    margin-bottom: 5px;
}

.board-name {
    color: var(--text-accent);
    font-size: 15pt;
    margin-bottom: 10px;
}

.board-desc {
    color: var(--text-gray);
    font-size: 10pt;
    line-height: 1.4;
}

/* ========== FORMULARIO DE POST ========== */
.post-form {
    background-color: var(--primary-bg);
    border: 1px solid var(--primary-border);
    padding: 10px;
    margin-bottom: 20px;
}

.post-form h3 {
    color: #0f0c5d;
    margin-bottom: 10px;
}

.post-form table {
    width: 100%;
}

.post-form td {
    padding: 2px;
    vertical-align: top;
}

.post-form td:first-child {
    width: 100px;
    font-weight: bold;
}

.post-form input[type="text"],
.post-form textarea {
    width: 100%;
    padding: 4px;
    border: 1px solid #aaa;
    background-color: #fff;
    box-sizing: border-box;
}

/* Estilo especial para campos de admin deshabilitados */
.post-form input[type="text"]:disabled.admin-field {
    font-weight: bold;
}

.post-form input[type="file"] {
    width: 100%;
}

.post-form button {
    border: 1px solid #0f0c5d;
    color: #0f0c5d;
    padding: 5px 10px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

.post-form button:hover {
    border: 1px solid #d00;
    color: #d00;
}

/* ========== THREADS Y POSTS ========== */
.thread-container,
.thread-op {
    margin-bottom: 10px;
    overflow: auto;
    float: left;
    display: contents;
}

.thread-preview,
.reply-post,
.report-container {
    display: table;
    background-color: var(--primary-bg);
    border: 1px solid var(--primary-border);
    padding: 10px;
    margin-bottom: 10px;
    overflow: auto;
}

.thread-preview,
.board-card {
    cursor: pointer;
    transition: background-color 0.2s;
}

.thread-preview:hover,
.board-card:hover {
    background-color: #c5cfe0;
}

/* ========== HEADERS DE POSTS ========== */
.thread-header,
.reply-header,
.report-header {
    margin-bottom: 5px;
}

.thread-header .subject,
.reply-header .subject,
.report-header .subject {
    color: var(--text-red);
    font-weight: bold;
    margin-bottom: 5px;
}

.thread-header .name,
.reply-header .name,
.report-header .name {
    color: var(--text-green);
    font-weight: bold;
}

/* Estilo especial para nombres de administrador */
.thread-header .name.admin-name,
.reply-header .name.admin-name,
.report-header .name.admin-name {
    color: var(--text-red);
    font-weight: bold;
}

.thread-header .date,
.reply-header .date,
.report-header .date,
.thread-header .id,
.reply-header .id,
.report-header .id {
    color: #000;
    font-weight: normal;
}

.thread-header a {
    text-decoration: none;
}

.post-header-file {
    font-size: 10pt;
    color: #474848;
}

/* ========== CONTENIDO DE POSTS ========== */
.post-subject {
    color: #0f0c5d;
    font-weight: bold;
    margin-bottom: 5px;
}

.thread-preview .post-subject {
    font-size: 11pt;
}

.thread-op .post-subject {
    font-size: 12pt;
}

.comment {
    color: #3a3a3a;
}

.post-message {
    margin: 5px 0;
    line-height: 1.4;
}

.thread-image {
    float: left;
    margin-right: 10px;
    max-width: 250px;
    cursor: pointer;
}

/* ========== ESTILOS DE TEXTO ========== */
.greentext {
    color: #789922;
}

.pinktext {
    color: #e0727f;
}

.post-reference {
    color: var(--text-dark);
    cursor: pointer;
}

.post-reference:hover {
    color: var(--accent-hover);
}

.board-reference {
    color: #0f0c5d;
    cursor: pointer;
}

.board-reference:hover {
    color: var(--accent-hover);
}

.url-link {
    color: var(--text-dark);
}

.url-link:hover {
    color: var(--accent-hover);
}

.banned-url {
    color: var(--accent-hover);
    font-weight: bold;
}

.id {
    color: var(--text-dark);
    font-weight: bold;
}

.id:hover {
    color: var(--accent-hover);
}

.backlink {
    color: var(--accent-hover);
    font-size: 8pt;
    margin-left: 5px;
}

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

.backlink a:hover {
    text-decoration: underline;
}

/* ========== BOTONES ========== */
.report-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-dark);
    transition: color 0.2s;
}

.report-btn:hover {
    color: var(--accent-hover);
}

.delete-btn {
    color: var(--accent-hover);
    background: none;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

.back-link {
    display: inline-block;
    margin-bottom: 15px;
    color: var(--text-dark);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--accent-hover);
}

/* ========== LIGHTBOX ========== */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
}

/* ========== TOOLTIPS Y PREVIEWS ========== */
.post-preview-tooltip {
    position: fixed;
    background-color: var(--primary-bg);
    border: 1px solid var(--primary-border);
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    padding: 8px;
    font-size: 10pt;
    pointer-events: none;
    max-width: 400px;
}

.post-preview-tooltip .post-preview,
.post-preview-tooltip .thread-container,
.post-preview-tooltip .thread-op {
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
}

.post-preview-tooltip .thread-header,
.post-preview-tooltip .reply-header {
    font-size: 10pt;
    margin-bottom: 5px;
}

.post-preview-tooltip .comment {
    font-size: 10pt;
    overflow: hidden;
}

.post-preview-tooltip .preview-image,
.post-preview-tooltip .thread-image {
    max-width: 100px;
    max-height: 100px;
    margin-top: 5px;
    cursor: pointer;
}

.post-preview-tooltip .board-indicator {
    color: var(--accent-hover);
    font-weight: bold;
    margin-right: 5px;
}

.post-preview-tooltip .preview-footer {
    margin-top: 8px;
    padding-top: 5px;
    border-top: 1px solid var(--primary-border);
    text-align: right;
}

.post-preview-tooltip .preview-footer a {
    color: var(--text-dark);
    text-decoration: none;
    font-size: 8pt;
}

.post-preview-tooltip .preview-footer a:hover {
    text-decoration: underline;
}

.post-preview-tooltip .post-header-file {
    color: #474848;
    font-size: 9pt;
    margin-bottom: 5px;
}

.post-preview-tooltip .post-image {
    float: left;
    margin-right: 5px;
    margin-bottom: 5px;
}

/* ========== PANEL ADMIN / LOGIN ========== */
.login-panel {
    background-color: #ffe;
    border: 2px solid var(--accent-hover);
    padding: 20px;
    max-width: 400px;
    margin: 50px auto;
    text-align: center;
}

.login-panel h2 {
    color: var(--accent-hover);
    margin-bottom: 15px;
}

.login-panel input {
    width: 100%;
    padding: 8px;
    margin: 10px 0;
    border: 1px solid #aaa;
    box-sizing: border-box;
}

.login-panel button {
    background-color: var(--accent-hover);
    color: #fff;
    border: none;
    padding: 10px 30px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 10px;
    transition: background-color 0.2s;
}

.login-panel button:hover {
    background-color: #a00;
}

/* ========== PANEL DE ADMINISTRACIÓN ========== */
.admin-content {
    display: none;
}

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

.stats-panel {
    background-color: var(--primary-bg);
    border: 1px solid var(--primary-border);
    padding: 15px;
    margin-bottom: 20px;
}

.stats-panel h3 {
    color: #0f0c5d;
    margin-bottom: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.stat-card {
    background-color: #fff;
    padding: 15px;
    border: 1px solid var(--primary-border);
    text-align: center;
}

.stat-number {
    font-size: 24pt;
    font-weight: bold;
    color: #0f0c5d;
}

.stat-label {
    color: var(--text-gray);
    font-size: 9pt;
}

.board-selector {
    background-color: var(--primary-bg);
    border: 1px solid var(--primary-border);
    padding: 10px;
    margin-bottom: 20px;
}

.board-selector select {
    padding: 5px;
    margin: 0 10px;
}

.board-selector button {
    background-color: var(--primary-bg);
    border: 1px solid var(--primary-border);
    padding: 5px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.board-selector button:hover {
    background-color: #c5cfe0;
}

.content-list {
    background-color: var(--primary-bg);
    border: 1px solid var(--primary-border);
    padding: 10px;
}

.content-item {
    background-color: #fff;
    border: 1px solid var(--primary-border);
    padding: 10px;
    margin-bottom: 10px;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #ccc;
}

.content-info {
    color: var(--text-gray);
    font-size: 9pt;
}

.content-info strong {
    color: var(--text-green);
}

.content-message {
    margin: 10px 0;
    color: #000;
}

.content-image {
    max-width: 150px;
    margin: 5px 0;
}

.content-image img {
    max-width: 100%;
    border: 1px solid var(--primary-border);
}

/* ========== TABS ========== */
.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
}

.tab {
    background-color: var(--primary-bg);
    border: 1px solid var(--primary-border);
    padding: 10px 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.tab:hover {
    background-color: #c5cfe0;
}

.tab.active {
    background-color: #0f0c5d;
    color: #fff;
}

.tab-content {
    display: none;
}

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

/* ========== REPORTES ========== */
.report-item {
    border-left: 4px solid #7d2d2f;
}

.reported-content {
    background-color: #f5f5f5;
    padding: 10px;
    margin-top: 10px;
    border-radius: 4px;
    border-left: 3px solid #7d2d2f;
}

.admin-item-header div {
    display: flex;
    gap: 10px;
}

.no-float {
    float: none !important;
    display: block !important;
}

/* ========== PÁGINA DE REGLAS ========== */
.rules-content h2 {
    color: var(--text-accent);
    font-size: 18pt;
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 2px solid var(--primary-bg);
    padding-bottom: 10px;
}

.rules-section {
    padding: 15px 0;
}

.rules-section h3 {
    color: var(--text-accent);
    font-size: 14pt;
    margin-bottom: 10px;
}

.rule-item {
    margin-bottom: 5px;
}

.rule-item strong {
    color: var(--text-accent);
}

.board-rules {
    padding: 10px 0;
}

.board-rules h4 {
    color: var(--text-accent);
    font-size: 12pt;
    margin-bottom: 5px;
}

.board-rules ul {
    margin-left: 20px;
    list-style-type: disc;
}

.board-rules ul li {
    margin-bottom: 5px;
    line-height: 1.3;
}

.disclaimer {
    background-color: var(--success-bg);
    padding: 15px;
}

.disclaimer h3 {
    color: var(--text-accent);
    font-size: 12pt;
    margin-bottom: 10px;
}

.disclaimer p {
    line-height: 1.4;
    margin-bottom: 8px;
}

.disclaimer p:last-child {
    margin-bottom: 0;
    color: #707070;
}

/* ========== VARIAS ========== */
.reply-preview {
    margin-left: 0px;
}

.omitted-replies {
    margin: 10px 0;
    color: var(--text-gray);
    font-size: 9pt;
    font-style: italic;
}

.omitted-replies a {
    color: var(--text-dark);
    text-decoration: none;
}

.omitted-replies a:hover {
    color: var(--accent-hover);
}

.loading {
    color: var(--text-gray);
    margin-bottom: 10px;
}

.hidden {
    display: none;
}

.footer {
    text-align: center;
    padding: 0 20px 20px 20px;
    color: var(--text-light-gray);
    font-size: 9pt;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .boards-grid {
        grid-template-columns: 1fr;
    }

    .reply-post {
        margin-left: 0;
    }

    .reply-preview {
        margin-left: 0;
    }

    .omitted-replies {
        margin-left: 0;
    }

    .post-image .thread-image {
        width: 100%;
        max-width: 100%;
        margin-bottom: 10px;
    }

    .post-preview-tooltip {
        max-width: 90vw;
        font-size: 8pt;
    }

    .post-preview-tooltip .preview-image {
        max-width: 120px;
        max-height: 120px;
    }

    .thread-container {
        margin-bottom: 0;
        padding: 5px;
    }

    .rules-content {
        padding: 10px;
    }

    .rules-content h2 {
        font-size: 16pt;
    }

    .rules-section h3 {
        font-size: 12pt;
    }

    .board-rules h4 {
        font-size: 11pt;
    }
}