/* Estilos personalizados */

#main-header nav a {
    font-family: 'Orbitron', monospace !important;
}

.hero-bg {
    background-image: url('images/mars-sunset.webp');
    background-size: cover;
    background-position: center;
}

.panel {
    background-color: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(56, 189, 248, 0.3);
    clip-path: polygon(0 10px, 10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
}
.text-cyan-glow { text-shadow: 0 0 8px rgba(56, 189, 248, 0.7); }

.term-definition { display: none; }
.term-definition.active { display: block; }

/* Estilos para la barra de scroll de la línea de tiempo */
.timeline-container::-webkit-scrollbar {
    height: 8px;
}

.timeline-container::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 4px;
}

.timeline-container::-webkit-scrollbar-thumb {
    background-color: rgba(56, 189, 248, 0.6);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: content-box;
}

.timeline-container::-webkit-scrollbar-thumb:hover {
    background-color: rgba(56, 189, 248, 0.8);
}

/* Estilos para el contenido del editor (Prose) */
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
    color: #ea6612; /* Color 'brand' */
    text-shadow: 0 0 8px rgba(234, 102, 18, 0.5);
    margin-bottom: 1rem;
    margin-top: 1.5rem;
    font-weight: 700;
}

.prose h1 {
    font-size: 2.25rem;
    line-height: 2.5rem;
}

.prose h2 {
    font-size: 1.875rem;
    line-height: 2.25rem;
}

.prose h3 {
    font-size: 1.5rem;
    line-height: 2rem;
}

.prose p {
    color: #a9a4d4; /* Color 'secondary' */
    margin-bottom: 1.25rem;
    line-height: 1.75;
}

.prose strong {
    color: #FFFFFF; /* Color 'primary' */
    font-weight: 700;
}

.prose em {
    font-style: italic;
}

.prose a {
    color: #ffad6b; /* Color 'brand-light' */
    text-decoration: underline;
}

.prose a:hover {
    color: #ea6612;
}

.prose ul, .prose ol {
    color: #a9a4d4;
    margin-left: 1.75rem;
    margin-bottom: 1.25rem;
}

.prose ul {
    list-style-type: disc;
}

.prose ol {
    list-style-type: decimal;
}

.prose li {
    margin-bottom: 0.5rem;
}

.prose blockquote {
    border-left: 4px solid #ea6612;
    padding-left: 1rem;
    margin-left: 0;
    font-style: italic;
}

/* Estilos para el Carrusel de la Mediateca */
.carousel-container {
    position: relative;
}

.carousel {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.carousel::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

.carousel-item {
    flex: 0 0 auto;
    width: 40%; /* 2.5 items visible on mobile */
}

@media (min-width: 640px) { /* sm */
    .carousel-item {
        width: 33.333333%; /* 3 items */
    }
}

@media (min-width: 768px) { /* md */
    .carousel-item {
        width: 25%; /* 4 items */
    }
}

@media (min-width: 1024px) { /* lg */
    .carousel-item {
        width: 20%; /* 5 items */
    }
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(30, 27, 51, 0.8);
    backdrop-filter: blur(5px);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 10;
}

.carousel-container:hover .carousel-btn {
    opacity: 1;
    visibility: visible;
}

.carousel-btn:hover {
    background-color: rgba(234, 88, 12, 0.9); /* brand color */
}

.carousel-btn.prev {
    left: 10px;
}

.carousel-btn.next {
    right: 10px;
}

/* --- Estilos para la Marspedia --- */

/* Overlay */
#marspedia-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.8); /* slate-900/80 */
    backdrop-filter: blur(8px);
    z-index: 40;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
}
#marspedia-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Contenedor del visor de la tarjeta */
#marspedia-viewer {
    position: fixed;
    left: 50%;
    top: 50%;
    width: 90vw;
    max-width: 600px;
    height: 400px;
    z-index: 50;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
    transition: all 0.3s ease-in-out;
    pointer-events: none;
    perspective: 1500px;
}
#marspedia-viewer.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

/* Estructura de la tarjeta que gira */
.viewer-card {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}
#marspedia-viewer.is-flipped .viewer-card {
    transform: rotateY(180deg);
}

.viewer-card-front, .viewer-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 0.75rem; /* rounded-xl */
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: #1e293b; /* slate-800 */
}
.viewer-card-back {
    transform: rotateY(180deg);
}

.alphabet-index button.active {
    background-color: #EA580C; /* brand color */
    color: white;
}

/* Estilos para vídeo responsivo (Custom) */
.video-responsive-embed {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
}

.video-responsive-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Estilos para el efecto de volteo de las tarjetas de Marspedia */
.scene {
    perspective: 1000px;
}

.term-grid-card {
    transform-style: preserve-3d;
    transition: transform 0.7s;
    position: relative;
    cursor: pointer;
}

.term-grid-card.is-flipped {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; /* Safari */
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    border-radius: 0.75rem; /* rounded-xl */
}

.card-face--front {
    background-color: rgba(30, 41, 59, 0.7); /* bg-surface/70 */
    border: 1px solid rgba(255, 255, 255, 0.1); /* border-white/10 */
}

.card-face--back {
    background-color: #0284c7; /* Color alternativo, más legible */
    border: 1px solid #0369a1;
    transform: rotateY(180deg);
    overflow-y: auto;
    text-align: left;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 1.5rem;
}

.card-face--back .definition-content {
    font-size: 0.875rem; /* text-sm */
    line-height: 1.6;
}

/* Animación de entrada para las tarjetas */
.term-grid-card {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
    animation: card-enter-anim 0.5s forwards ease-out;
}

@keyframes card-enter-anim {
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}
