:root {
    --primary-purple: #C873C4;
    --secondary-green: #97E88D;
    --background-dark: #1e1e1e;
    --text-color: #fff;
    --footer-color: #3b0066;
}

/* =======================================
   BASE
   ======================================= */
body {
    margin: 0;
    padding: 0;
    font-family: sans-serif;
    background-color: var(--background-dark);
    color: var(--text-color);
}

/* =======================================
   HEADER
   ======================================= */
.header-top-bar {
    display: flex;
    justify-content: flex-end;
    padding: 10px 40px;
}

.btn-auth, .main-nav a {
    font-family: 'Metal Mania', cursive;
}

.btn-register {
    background: linear-gradient(to bottom, #920092, #660066);
}
.btn-login {
    background: linear-gradient(to bottom, #2e2e2e, #000);
}
.btn-perfil {
    background: #1f1f1f; /* Color solicitado exactamente */
    color: #fff;
    border: 1px solid rgba(255,255,255,0.06);
}
.btn-auth {
    padding: 8px 15px;
    margin-left: 10px;
    border-radius: 5px;
    font-weight: bold;
    color: var(--text-color);
    text-decoration: none;
    transition: background-color 0.3s;
}

.btn-auth:hover {
    filter: brightness(1.2);
}

.logo-area {
    background-image: url('ChatGPT\ Image\ 27\ oct\ 2025\,\ 10_40_35.png');
    text-align: center;
    padding: 20px 0;
}

.logo-main {
    width: 600px; /* Ajusta según el tamaño de tu logo.png */
    height: auto;
}

.main-nav {
    text-align: center;
    padding: 10px 0;
    margin-bottom: 20px;
}

.main-nav a {
    text-decoration: none;
    padding: 10px 15px;
    display: inline-block;
    text-transform: uppercase;
    color: var(--text-color);
}
.main-nav .active {
    color: var(--secondary-green);
    border-bottom: 2px solid var(--secondary-green);
}

/* =======================================
   GALERÍA
   ======================================= */
.gallery-content {
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
}
.gallery-title {
    text-align: center;
    font-family: 'Metal Mania';
    color: var(--primary-purple);
    margin-bottom: 50px;
    font-size: 3em;
    text-shadow: 0 0 3px var(--primary-purple);
}

/* =======================================
   FILTROS
   ======================================= */
.filters-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap; /* Asegurar responsive */
}

/* Estilos para los filtros */
.filter-input, .filter-select {
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #444;
    background-color: #333;
    color: var(--text-color);
}

.filter-input:focus, .filter-select:focus {
    outline: none;
    border-color: var(--primary-purple);
    box-shadow: 0 0 5px rgba(200, 115, 196, 0.5);
}

.filter-select:hover, .filter-input:hover {
    border-color: var(--primary-purple);
}

.btn-auth {
    padding: 8px 15px;
    margin-left: 10px;
    border-radius: 5px;
    color: #ffffff;
    text-decoration: none;
    background-color: #1f1f1f;
    border: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s, border-color 0.3s;
}

.btn-auth:hover {
    background-color: #333;
    border-color: var(--primary-purple);
}

.card-grid {
    display: grid;
    /* Ajustado: minmax permite que las cartas sean más grandes */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 25px;
    justify-items: center;
}

.card-container {
    width: 100%;
    /* AUMENTADO: De 280px a 320px */
    max-width: 320px; 
    transition: transform 0.2s;
}

.card-container:hover {
    transform: scale(1.05);
}

.card-image {
    width: 100%;
    height: auto;
    display: block;
    border: none;
    border-radius: 5px;
}

/* =======================================
   FOOTER
   ======================================= */
.main-footer {
    background-image: url('ChatGPT\ Image\ 27\ oct\ 2025\,\ 10_40_35.png');
    color: #fff;
    padding: 20px 0;
    text-align: center;
    margin-top: 40px;
}
.footer-section h3 {
    font-family: 'Metal Mania', cursive;
    margin-bottom: 5px;
}
.footer-section p {
    font-size: 0.8em;
    margin: 0;
}

/* =======================================
   ESTILOS DE LA VENTANA MODAL (LIGHTBOX)
   ======================================= */

/* Fondo oscuro y pantalla completa */
.modal {
    display: none; /* Oculto por defecto, se muestra con JS */
    position: fixed; 
    z-index: 100; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; 
    background-color: rgba(0, 0, 0, 0.9); 
    justify-content: center; 
    align-items: center; 
    padding: 20px;
}

/* Contenido de la Modal */
.modal-content {
    background-color: #222; 
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.8);
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto; 
    position: relative;
}

/* Contenedor principal de la imagen y los detalles */
.modal-body {
    display: flex;
    gap: 40px;
    align-items: flex-start; 
}

/* Imagen de la carta */
.modal-image-container {
    flex-shrink: 0; 
    /* Dimensiones por defecto para cartas normales (380x540) */
    width: 380px; 
    height: 540px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease; 
}

#modal-image {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    transform-origin: center; 
    transition: transform 0.3s ease;
    object-fit: contain;
}

/* Rotación de 90 grados para Panteones */
#modal-image.rotated {
    /* Rota 90 grados manteniendo el mismo tamaño visual que una carta normal */
    transform: rotate(90deg); 
}


/* Detalles (Tabla) */
.modal-details-container {
    flex-grow: 1; 
    color: #fff;
}

#modal-card-name {
    font-family: 'Metal Mania', cursive;
    color: #c873c4;
    font-size: 2em;
    margin-top: 0;
    margin-bottom: 20px;
}

/* Tabla de Atributos */
#modal-card-table {
    width: 100%;
    border-collapse: collapse;
    font-family: sans-serif;
    font-size: 1em;
}

#modal-card-table tr {
    border-bottom: 1px solid #444;
}
#modal-card-table tr:last-child {
    border-bottom: none;
}
#modal-card-table tr:nth-child(even) {
    background-color: #333;
}

#modal-card-table td {
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

#modal-card-table td:first-child {
    /* Atributo (Etiqueta) */
    font-weight: bold;
    color: var(--secondary-green);
    width: 30%; 
}

/* Botón de Cierre (X) */
.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    color: #fff;
    background: var(--primary-purple);
    border: 2px solid #fff;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.3s, transform 0.1s;
    z-index: 101; 
}

.modal-close-btn:hover {
    background-color: #55008b;
    transform: scale(1.05);
}

/* Media Query para dispositivos pequeños */
@media (max-width: 900px) {
    .modal-body {
        flex-direction: column; 
        align-items: center;
        gap: 20px;
    }
    
    .modal-content {
        padding: 20px;
    }
    
    .modal-image-container {
        width: 100%;
        max-width: 300px;
        height: auto;
        aspect-ratio: 1;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Desactivamos la rotación en móviles para ahorrar espacio */
    #modal-image.rotated {
        transform: rotate(0deg); 
    }
    .modal-image-container {
        width: 100%;
    }
    
    /* Logo responsive para móviles */
    .logo-main {
        width: 90%;
        max-width: 300px;
        height: auto;
    }
    
    .logo-area {
        padding: 10px 0;
    }
}

/* =======================================
   PLACEHOLDER STYLES
   ======================================= */
.card-name-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(59, 0, 102, 0.9);
    color: white;
    padding: 8px 5px;
    font-size: 11px;
    font-weight: bold;
    text-align: center;
    border-radius: 0 0 8px 8px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    transition: opacity 0.3s ease;
}

/* Estilos para imágenes placeholder */
img[data-is-placeholder="true"] {
    filter: grayscale(20%) brightness(0.8);
    border: 2px solid rgba(200, 115, 196, 0.3);
}

/* Media Query adicional para dispositivos muy pequeños */
@media (max-width: 480px) {
    .logo-main {
        width: 80%;
        max-width: 250px;
    }
    
    .header-top-bar {
        padding: 10px 20px;
    }
    
    .btn-auth {
        padding: 6px 12px;
        font-size: 0.9em;
    }
    
    .card-name-overlay {
        font-size: 10px;
        padding: 6px 4px;
    }
}

/* =======================================
   LOADING SCREEN CON SPINNER 3D
   ======================================= */

.loading-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e1e1e 0%, #3b0066 50%, #1e1e1e 100%);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 30px;
}

.loading-screen.active {
    display: flex;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.loading-screen.fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Contenedor 3D */
.spinner-container {
    perspective: 1000px;
    width: 200px;
    height: 200px;
}

/* Cubo 3D rotativo */
.spinner-cube {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    animation: rotateCube 8s infinite linear;
}

@keyframes rotateCube {
    from {
        transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
    }
    to {
        transform: rotateX(360deg) rotateY(360deg) rotateZ(0deg);
    }
}

.spinner-face {
    position: absolute;
    width: 200px;
    height: 200px;
    background: center/contain no-repeat;
    background-image: url('Logo.png');
    opacity: 0.9;
    border: 2px solid rgba(200, 115, 196, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Posiciones del cubo 3D */
.spinner-face:nth-child(1) {
    transform: rotateY(0deg) translateZ(100px);
}

.spinner-face:nth-child(2) {
    transform: rotateY(90deg) translateZ(100px);
}

.spinner-face:nth-child(3) {
    transform: rotateY(180deg) translateZ(100px);
}

.spinner-face:nth-child(4) {
    transform: rotateY(270deg) translateZ(100px);
}

.spinner-face:nth-child(5) {
    transform: rotateX(90deg) translateZ(100px);
}

.spinner-face:nth-child(6) {
    transform: rotateX(-90deg) translateZ(100px);
}

/* Texto de carga */
.loading-text {
    color: var(--secondary-green);
    font-size: 1.5em;
    font-family: 'Metal Mania', cursive;
    text-align: center;
    letter-spacing: 2px;
}

.loading-text.animated {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}