:root {
    --bg-color: #0d0d0d;
    --text-primary: #e6e6e6;
    --text-secondary: #a3a3a3;
    --accent-gold: #d4af37;
    --accent-gold-hover: #f1c40f;
    --glass-bg: rgba(13, 13, 13, 0.7);
    --border-color: rgba(212, 175, 55, 0.3);
    --font-heading: 'Cinzel', serif;
    --font-body: 'Lora', serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Protección contra selección y guardado */
.noselect {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
img {
    pointer-events: none; /* Evita arrastrar imágenes */
}

/* Video de fondo */
#bg-video {
    position: fixed;
    right: 0;
    bottom: 0;
    min-width: 100%;
    min-height: 100%;
    z-index: -2;
    object-fit: cover;
    opacity: 0.4;
    transition: opacity 1s ease;
}
#video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 20%, #000 90%);
    z-index: -1;
}

/* Secciones */
.active-section {
    display: flex;
    flex-direction: column;
    opacity: 1;
    transition: opacity 1s ease-in-out;
    min-height: 100vh;
}
.hidden-section {
    display: none !important;
    opacity: 0;
}
.fade-in {
    animation: fadeIn 1s forwards;
}
@keyframes fadeIn {
    to { opacity: 1; }
}

/* Landing Page */
#landing-section {
    justify-content: center;
    align-items: center;
    text-align: center;
    height: 100vh;
}
.logo-container {
    margin-bottom: 3rem;
}
#main-logo {
    max-width: 450px;
    width: 100%;
    filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.5));
    animation: pulse 4s infinite alternate;
}
#text-logo {
    font-family: var(--font-heading);
    font-size: 4rem;
    color: var(--accent-gold);
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.6);
}

@keyframes pulse {
    from { filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.3)); }
    to { filter: drop-shadow(0 0 25px rgba(212, 175, 55, 0.7)); }
}

/* Botones */
.mystic-btn {
    background: transparent;
    color: var(--accent-gold);
    border: 1px solid var(--accent-gold);
    padding: 15px 30px;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
}
.mystic-btn:hover {
    background: rgba(212, 175, 55, 0.1);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
    color: var(--accent-gold-hover);
}
.small-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Header & Menu */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 3rem;
    background: var(--glass-bg);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--accent-gold);
}
nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}
nav a {
    text-decoration: none;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 1.1rem;
    transition: color 0.3s ease;
}
nav a:hover, nav a.active {
    color: var(--accent-gold);
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

/* Main Content Grid */
#content-list-container {
    padding: 3rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}
.section-title {
    font-family: var(--font-heading);
    color: var(--accent-gold);
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}
.card {
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid var(--border-color);
    padding: 2rem;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(212, 175, 55, 0.2);
    border-color: var(--accent-gold);
}
.card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}
.card-icon {
    font-size: 2.2rem;
    line-height: 1;
    filter: drop-shadow(0 0 5px rgba(212, 175, 55, 0.5));
}
.card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.card-tag {
    font-size: 0.85rem;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}
.card-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: var(--font-body);
}
.card-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    margin-bottom: 1rem;
    color: #fff;
    line-height: 1.3;
}
.card-desc {
    color: var(--text-secondary);
    font-size: 1rem;
    flex-grow: 1;
}

/* Immersive Reading Mode */
.immersive-mode {
    background-color: #050505; /* Fondo más oscuro para inmersión */
    z-index: 200;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100vh;
}
.reader-toolbar {
    padding: 1.5rem 3rem;
    background: linear-gradient(to bottom, rgba(5,5,5,1) 0%, rgba(5,5,5,0) 100%);
    position: sticky;
    top: 0;
    z-index: 201;
}
.markdown-body {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 2rem 6rem 2rem;
    font-size: 1.25rem;
    color: #dedede;
}
.markdown-body h1 {
    font-family: var(--font-heading);
    color: var(--accent-gold);
    margin-top: 2rem;
    margin-bottom: 1.5rem;
    font-size: 2.8rem;
    text-align: center;
}
.markdown-body h2, .markdown-body h3 {
    font-family: var(--font-heading);
    color: var(--accent-gold);
    margin-top: 2rem;
    margin-bottom: 1rem;
}
.markdown-body p {
    margin-bottom: 1.5rem;
    text-align: justify;
    line-height: 1.8;
}
.markdown-body em {
    color: var(--text-secondary);
}
.markdown-body blockquote {
    border-left: 3px solid var(--accent-gold);
    padding-left: 1rem;
    margin-left: 0;
    font-style: italic;
    color: var(--text-secondary);
}
.markdown-body img {
    max-width: 100%;
    border-radius: 4px;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
    display: block;
    margin: 2rem auto;
}

/* Acerca de */
.about-section {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}
.about-section p {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

/* Responsive */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        padding: 1rem;
    }
    nav ul {
        margin-top: 1.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    #text-logo {
        font-size: 2.5rem;
    }
    .markdown-body {
        padding: 1.5rem;
        font-size: 1.1rem;
    }
    .markdown-body h1 {
        font-size: 2.2rem;
    }
    #content-list-container {
        padding: 2rem 1rem;
    }
}

/* Firebase Interaction Section */
.interaction-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    align-self: center;
    padding: 0 2rem 4rem 2rem;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    padding-top: 2rem;
}

.like-container {
    text-align: center;
    margin-bottom: 3rem;
}

.heart-icon {
    vertical-align: middle;
    margin-right: 8px;
    transition: fill 0.3s ease, stroke 0.3s ease;
}

#like-btn.liked {
    background: rgba(212, 175, 55, 0.2);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
}

#like-btn.liked .heart-icon {
    fill: var(--accent-gold);
}

.comments-section {
    background: rgba(20, 20, 20, 0.6);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 8px;
}

.comments-title {
    font-family: var(--font-heading);
    color: var(--accent-gold);
    margin-bottom: 2rem;
    font-size: 1.5rem;
    text-align: center;
}

.comments-list {
    margin-bottom: 2rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.comments-list::-webkit-scrollbar {
    width: 6px;
}

.comments-list::-webkit-scrollbar-thumb {
    background: var(--accent-gold);
    border-radius: 3px;
}

.comment-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.comment-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.comment-author {
    font-family: var(--font-heading);
    color: var(--accent-gold);
    font-weight: bold;
}

.comment-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.comment-body {
    color: #ccc;
    font-size: 1rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mystic-input, .mystic-textarea {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 15px;
    font-family: var(--font-body);
    font-size: 1rem;
    outline: none;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.mystic-input:focus, .mystic-textarea:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.mystic-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Authentication & UI additions */
.login-prompt {
    text-align: center;
    padding: 1rem;
    border: 1px dashed rgba(212, 175, 55, 0.3);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.3);
}

.login-prompt p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-style: italic;
}

.google-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #fff;
    color: #333;
    border: none;
    font-family: Arial, sans-serif;
    font-weight: bold;
    text-transform: none;
}

.google-btn:hover {
    background: #eee;
    color: #111;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.user-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.user-name-display {
    color: var(--accent-gold);
    font-family: var(--font-heading);
    font-size: 1.1rem;
}

.text-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.9rem;
    text-decoration: underline;
    transition: color 0.3s;
}

.text-btn:hover {
    color: #fff;
}

/* Custom Checkbox for ReCaptcha */
.recaptcha-container {
    margin: 10px 0;
    display: flex;
    align-items: center;
}

.custom-checkbox {
    display: block;
    position: relative;
    padding-left: 35px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-secondary);
    user-select: none;
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: -2px;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: rgba(0,0,0,0.5);
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.custom-checkbox:hover input ~ .checkmark {
    background-color: rgba(212, 175, 55, 0.2);
}

.custom-checkbox input:checked ~ .checkmark {
    background-color: var(--accent-gold);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.custom-checkbox input:checked ~ .checkmark:after {
    display: block;
}

.custom-checkbox .checkmark:after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid black;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

#submit-comment-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #555;
    color: #555;
}

/* Footer & Counter Additions */
.mystic-counter {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 10px 20px;
    border-radius: 4px;
    backdrop-filter: blur(5px);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.1);
    font-family: var(--font-heading);
    z-index: 10;
    transition: all 0.3s ease;
}

.mystic-counter:hover {
    border-color: var(--accent-gold);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
    transform: translateY(-2px);
}

.counter-icon {
    font-size: 1.2rem;
    filter: drop-shadow(0 0 5px var(--accent-gold));
}

.counter-number {
    color: var(--accent-gold);
    font-weight: bold;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.counter-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.mystic-footer {
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 4rem;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    background: linear-gradient(to top, rgba(13, 13, 13, 0.9) 0%, rgba(13, 13, 13, 0) 100%);
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.footer-content a {
    color: var(--accent-gold);
    text-decoration: none;
    transition: text-shadow 0.3s;
}

.footer-content a:hover {
    text-shadow: 0 0 8px var(--accent-gold);
}

.cc-icons {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.5rem;
    filter: invert(0.8) sepia(1) hue-rotate(5deg) saturate(3) brightness(0.9); /* Makes the SVGs goldish */
}

/* Search and Pagination */
.search-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.search-input {
    width: 100%;
    max-width: 600px;
    padding: 15px 25px;
    border-radius: 30px;
    font-size: 1.1rem;
    background: rgba(10, 10, 10, 0.7);
    text-align: center;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.pagination-container {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.page-btn {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-family: var(--font-heading);
    transition: all 0.3s;
    border-radius: 4px;
}

.page-btn:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.page-btn.active {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    font-weight: bold;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}


