/**
 * Metro Life RP - Estilos de Galería de Personajes
 * Copyright (c) 2025 Metro Life Studios. Desarrollado por Mercurio & Melman.
 * Todos los derechos reservados.
 * 
 * Este código fuente es propiedad exclusiva de Metro Life Studios.
 * Queda estrictamente prohibida su reproducción, distribución, modificación
 * o uso no autorizado, total o parcial, sin consentimiento expreso por escrito.
 * 
 * El uso indebido de este material está sujeto a acciones legales conforme
 * a la legislación vigente sobre propiedad intelectual y derechos de autor.
 */

:root {
    --bg-dark: #0e151f;
    --bg-secondary: #1a1f2e;
    --text-main: #ffffff;
    --text-muted: #aaaaaa;

    /* Character Theme Colors */
    --color-primary: #9d4edd;
    /* Light Purple */
    --color-secondary: #c77dff;
    /* Lighter Purple/Pink */

    --glass-border: rgba(157, 78, 221, 0.3);
    --glass-bg: rgba(26, 31, 46, 0.8);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(135deg, #0e151f 0%, #1a1f2e 100%);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* =========================================
   HEADER & NAVIGATION (Standardized for Character Theme)
   ========================================= */
.site-header {
    position: fixed;
    top: 20px;
    left: 30px;
    right: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    pointer-events: none;
}

.logo,
.hamburger {
    pointer-events: auto;
}

.logo {
    text-decoration: none;
    font-weight: 900;
    font-size: 24px;
    letter-spacing: 4px;
    display: flex;
    gap: 5px;
}

.logo-text {
    color: #fff;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

.logo-accent {
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: var(--color-primary);
    text-shadow: 0 0 10px var(--color-primary);
}

.hamburger {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hamburger span {
    width: 30px;
    height: 3px;
    background: #fff;
    transition: 0.3s;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    border-radius: 2px;
}

.hamburger:hover span {
    background: var(--color-primary);
    box-shadow: 0 0 10px var(--color-primary);
}

/* Side Menu */
.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 190;
}

.menu-overlay.show {
    opacity: 1;
    visibility: visible;
}

.side-menu {
    position: fixed;
    top: 0;
    right: -400px;
    width: 350px;
    height: 100%;
    background: var(--bg-secondary);
    border-left: 1px solid var(--glass-border);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 200;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.side-menu.open {
    right: 0;
}

.side-menu-header {
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}

.side-menu-logo {
    font-weight: 800;
    color: #fff;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 18px;
}

.menu-logo-text {
    color: #fff;
}

.menu-logo-accent {
    color: var(--color-primary);
}

.close-menu {
    background: transparent;
    border: 1px solid var(--glass-border);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.close-menu:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    transform: rotate(90deg);
}

.close-icon::before,
.close-icon::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 2px;
    background: currentColor;
}

.close-icon::before {
    transform: rotate(45deg);
}

.close-icon::after {
    transform: rotate(-45deg);
}

.side-menu-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.side-title {
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
    border-left: 2px solid var(--color-primary);
    padding-left: 10px;
}

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.side-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    border-radius: 8px;
    text-decoration: none;
    color: #fff;
    transition: 0.3s;
}

.side-link:hover,
.side-link.active {
    background: rgba(157, 78, 221, 0.1);
    border-color: var(--color-primary);
    transform: translateX(5px);
}

.side-link.active {
    box-shadow: 0 0 15px rgba(157, 78, 221, 0.2);
}

.link-icon {
    font-size: 20px;
}

.link-text {
    font-weight: 600;
    font-size: 14px;
}

.link-arrow {
    margin-left: auto;
    opacity: 0;
    transition: 0.3s;
    color: var(--color-primary);
}

.side-link:hover .link-arrow,
.side-link.active .link-arrow {
    opacity: 1;
    transform: translateX(0);
}

.side-menu-footer {
    padding: 20px;
    text-align: center;
    border-top: 1px solid var(--glass-border);
}

.footer-text {
    color: var(--text-muted);
    font-size: 11px;
}

/* =========================================
   CHARACTER PAGE STYLES (Extracted)
   ========================================= */
.cars-container {
    /* Using same class name from HTML but ensuring background matches body */
    background: transparent;
    min-height: 100vh;
}

.page-header {
    text-align: center;
    padding: 100px 40px 40px;
    /* Adjusted top padding for fixed header */
}

.page-title {
    font-size: 48px;
    font-weight: 900;
    margin-bottom: 15px;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: 'Montserrat', sans-serif;
    text-shadow: 0 0 20px rgba(157, 78, 221, 0.4);
}

.page-subtitle {
    font-size: 18px;
    color: var(--text-muted);
    font-weight: 300;
    margin-bottom: 0;
}

.characters-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 40px;
    padding: 0 40px 60px;
    max-width: 1400px;
    margin: 0 auto;
}

.character-card {
    perspective: 1000px;
    cursor: pointer;
    transition: transform 0.3s ease;
    position: relative;
}

.character-card:hover:not(.locked) {
    transform: translateY(-15px);
}

.character-card-inner {
    background: white;
    padding: 15px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
    position: relative;
    transform: rotate(-2deg);
    transition: transform 0.3s ease;
    border-radius: 12px;
}

.character-number {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--color-primary);
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fredoka One', cursive;
    font-size: 14px;
    font-weight: 700;
    z-index: 5;
    box-shadow: 0 4px 10px rgba(157, 78, 221, 0.3);
}

.character-card:hover:not(.locked) .character-card-inner {
    transform: rotate(0deg);
}

.character-image-wrapper {
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
    background: #f0f0f0;
    position: relative;
    border-radius: 8px;
}

.character-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(100%);
    transition: filter 0.5s ease;
}

.character-card:hover:not(.locked) .character-image {
    filter: grayscale(0%) brightness(1.1);
}

.character-name {
    margin-top: 15px;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--color-primary);
    font-family: 'Fredoka One', cursive;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Locked State */
.lock-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 60px;
    z-index: 10;
}

.character-card.locked {
    cursor: pointer;
    opacity: 1;
    transition: transform 0.3s ease;
}

.character-card.locked:hover {
    transform: translateY(-15px);
}

.character-card.locked:hover .character-card-inner {
    transform: rotate(0deg);
}

.character-card.locked .character-image {
    filter: grayscale(100%) brightness(0.5);
}

/* Character Modal */
.character-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.character-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    position: relative;
    background: linear-gradient(135deg, #1a1f2e 0%, #0e151f 100%);
    border-radius: 20px;
    max-width: 1000px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    display: flex;
    gap: 40px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 2px solid var(--glass-border);
    z-index: 1001;
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    z-index: 1002;
    transition: 0.3s ease;
}

.modal-close:hover {
    color: var(--color-primary);
    transform: rotate(90deg);
}

.modal-left {
    flex: 1;
    min-width: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image,
#modalVideo {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: block;
    object-fit: cover;
}

.modal-right {
    flex: 1;
    color: #fff;
}

.modal-character-name {
    font-size: 32px;
    font-family: 'Fredoka One', cursive;
    color: var(--color-primary);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.modal-location {
    font-size: 14px;
    color: var(--color-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.modal-divider {
    height: 2px;
    background: linear-gradient(90deg, var(--color-primary), transparent);
    margin-bottom: 20px;
}

.modal-description {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-muted);
    text-align: justify;
}

/* Audio Player */
.audio-player {
    margin-top: 30px;
    background: rgba(157, 78, 221, 0.1);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--color-primary);
}

.audio-player h4 {
    color: var(--color-primary);
    margin-bottom: 15px;
    font-size: 14px;
    text-transform: uppercase;
}

.audio-player audio {
    width: 100%;
    margin-top: 10px;
}

/* Blocked Alert & Password Modal */
.blocked-alert-modal,
.password-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.blocked-alert-modal.active,
.password-modal.active {
    display: flex;
}

.blocked-alert-content,
.password-content {
    background: linear-gradient(135deg, #1a1f2e 0%, #0e151f 100%);
    border: 2px solid var(--color-primary);
    border-radius: 15px;
    padding: 40px;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(157, 78, 221, 0.3);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.blocked-alert-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.blocked-alert-text {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    font-family: 'Montserrat', sans-serif;
}

.blocked-alert-close,
.password-btn {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 10px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: 0.3s ease;
    text-transform: uppercase;
}

.blocked-alert-close:hover,
.password-btn:hover {
    background: var(--color-secondary);
}

.password-title {
    color: var(--color-primary);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
}

.password-input-wrapper {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.password-digit {
    width: 50px;
    height: 50px;
    background: rgba(157, 78, 221, 0.1);
    border: 2px solid var(--color-primary);
    border-radius: 8px;
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    line-height: 46px;
}

.password-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.password-btn.cancel {
    background: #555;
}

.password-btn.cancel:hover {
    background: #777;
}

@media (max-width: 768px) {
    .characters-gallery {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 20px;
        padding: 0 20px 40px;
    }

    .page-title {
        font-size: 36px;
    }

    .modal-content {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }

    .modal-left {
        min-width: auto;
    }
}