/* === KEKAGAMER UNIFIED THEME v13.0 - CORRECIÓN LOGIN MÓVIL === */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800&family=Rajdhani:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #9D4EDD;
    --primary-hover-color: #B565F7;
    --primary-neon-color: #C77DFF;
    --dark-color: #121212;
    --secondary-dark-color: #1E1E1E;
    --card-color: #2A2A2A;
    --text-color: #E0E0E0;
    --text-muted-color: #A0A0A0;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --border-color: #444444;
    --font-family: 'Poppins', sans-serif;
    --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    --neon-shadow: 0 0 5px var(--primary-neon-color), 0 0 10px var(--primary-neon-color), 0 0 15px var(--primary-neon-color), 0 0 20px var(--primary-neon-color);
}

body { 
    background-color: var(--dark-color); 
    color: var(--text-color); 
    font-family: var(--font-family); 
    margin: 0; 
    padding: 0; 
}

.main-container, .admin-container { 
    display: flex; 
    width: 100%; 
}

/* === BARRA LATERAL (Unificada para Admin y Usuario) === */
.main-sidebar, .admin-sidebar { 
    width: 260px; 
    background-color: var(--secondary-dark-color); 
    padding: 20px 10px; 
    height: 100vh; 
    position: fixed; 
    top: 0; 
    left: 0; 
    display: flex; 
    flex-direction: column; 
    z-index: 1000; 
    border-right: 1px solid var(--border-color); 
    box-shadow: 0 0 10px rgba(157, 78, 221, 0.3); 
}
.main-sidebar .logo, .admin-sidebar .logo { 
    text-align: center; 
    padding: 20px 0; 
    margin-bottom: 20px; 
    border-bottom: 1px solid rgba(157, 78, 221, 0.3); 
}
.main-sidebar .logo img, .admin-sidebar .logo img { 
    max-width: 120px; 
    transition: transform 0.3s ease; 
    filter: drop-shadow(0 0 5px var(--primary-neon-color)); 
}
.main-sidebar .menu, .admin-sidebar .menu { 
    flex-grow: 1; 
    overflow-y: auto; 
    /* Borde para separar el perfil (que ahora está arriba) */
    padding-top: 15px;
    margin-top: 15px;
    border-top: 1px solid var(--border-color);
}
.main-sidebar .menu a, .admin-sidebar .menu a { 
    display: flex; 
    align-items: center; 
    color: var(--text-muted-color); 
    text-decoration: none; 
    padding: 15px 20px; 
    margin: 8px 10px; 
    border-radius: 8px; 
    transition: all 0.3s ease; 
    font-weight: 500; 
}
.main-sidebar .menu a i, .admin-sidebar .menu a i { 
    margin-right: 15px; 
    font-size: 1.2em; 
    width: 25px; 
    text-align: center; 
}
.main-sidebar .menu a:hover, .admin-sidebar .menu a:hover { 
    background-color: rgba(157, 78, 221, 0.1); 
    color: white; 
    transform: translateX(5px); 
    box-shadow: 0 0 15px rgba(157, 78, 221, 0.3); 
}
.main-sidebar .menu a.active, .admin-sidebar .menu a.active { 
    background-color: var(--primary-color); 
    color: white; 
    box-shadow: 0 0 10px var(--primary-color);
    transform: translateX(5px); 
}

/* === ESTILOS DE PERFIL (Ahora en el header derecho) === */
.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 0;
}
.user-info {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: var(--card-color);
    border-radius: 8px;
    margin: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}
.user-info:hover {
    background-color: var(--secondary-dark-color);
}
.user-avatar i {
    font-size: 1.5em;
    color: var(--primary-color);
}
.user-details {
    margin-left: 10px;
    min-width: 0;
}
.user-details .username {
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-details .user-role {
    font-size: 0.8em;
    color: var(--text-muted-color);
    margin: 0;
}
.logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    text-decoration: none;
    color: var(--text-muted-color);
    background: var(--dark-color);
    margin: 0;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 1rem;
}
.logout-btn:hover { 
    background: var(--danger-color); 
    color: white; 
}

/* === CONTENIDO PRINCIPAL (Unificado) === */
.main-content, .admin-main-content { 
    margin-left: 260px; 
    width: calc(100% - 260px); 
    padding: 40px; 
}

/* === HEADER PARA CONTENIDO DE USUARIO (Perfil a la derecha) === */
.main-content-header {
    display: flex;
    justify-content: flex-end; /* Alinea el perfil a la derecha */
    align-items: center;
    padding-bottom: 40px;
    margin-bottom: -10px; /* Compensa el margen del page-header */
}

.admin-header, .page-header { 
    border-bottom: 1px solid var(--border-color); 
    padding-bottom: 20px; 
    margin-bottom: 40px; 
}
.admin-header h1, .page-header h1 { 
    font-size: 2.2em; 
    margin: 0; 
    font-weight: 700; 
    color: white; 
}
.page-header p { 
    color: var(--text-muted-color); 
}
.content-container, .card { 
    background: var(--card-color); 
    padding: 25px; 
    border-radius: 12px; 
    box-shadow: var(--card-shadow); 
}
.stats-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); 
    gap: 25px; 
    margin-bottom: 30px; 
}
.stat-card { 
    background: var(--secondary-dark-color); 
    padding: 20px; 
    border-radius: 12px; 
    border-left: 4px solid var(--primary-color); 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    transition: transform 0.3s ease, box-shadow 0.3s ease; 
}
.stat-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3); 
}
.stat-card .info h3 { margin: 0; font-size: 2em; font-weight: 700; }
.stat-card .info p { margin: 5px 0 0; color: var(--text-muted-color); }
.stat-card .icon { font-size: 2.5em; color: var(--primary-color); opacity: 0.6; }
.table-responsive { overflow-x: auto; }
.content-table { width: 100%; border-collapse: collapse; }
.content-table thead tr { background-color: var(--secondary-dark-color); }
.content-table th, .content-table td { padding: 15px 20px; vertical-align: middle; }
.content-table tbody tr { border-bottom: 1px solid var(--border-color); transition: background-color 0.2s ease; }
.content-table tbody tr:hover { background-color: var(--secondary-dark-color); }

/* === COMPONENTES (Formularios, Botones, Tabs, etc.) === */
.form-control, .form-input-modern, .form-input {
    width: 100%; 
    padding: 12px; 
    background-color: var(--dark-color); 
    border: 1px solid var(--border-color); 
    border-radius: 8px; 
    color: var(--text-color); 
    box-sizing: border-box; 
    transition: all 0.3s ease; 
    font-size: 1rem;
}
.form-control:focus, .form-input-modern:focus, .form-input:focus {
    outline: none; 
    border-color: var(--primary-color); 
    box-shadow: 0 0 0 3px rgba(157, 78, 221, 0.3); 
}
.btn { 
    padding: 12px 24px; 
    border: none; 
    border-radius: 8px; 
    cursor: pointer; 
    font-weight: 600; 
    font-size: 1rem;
    text-decoration: none; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    gap: 8px; 
    transition: all 0.2s ease; 
}
.btn-primary { 
    background-color: var(--primary-color); 
    color: white; 
}
.btn-primary:hover { 
    background-color: var(--primary-hover-color); 
    transform: translateY(-2px);
}
.tabs-nav { 
    display: flex; 
    border-bottom: 2px solid var(--border-color); 
    margin-bottom: 1.5rem; 
}
.tab-link { 
    padding: 1rem 1.5rem; 
    cursor: pointer; 
    font-weight: 600; 
    color: var(--text-muted-color); 
    background: none; 
    border: none; 
    border-bottom: 3px solid transparent; 
    transition: all 0.3s ease; 
}
.tab-link:hover { 
    color: white; 
}
.tab-link.active { 
    color: var(--primary-color); 
    border-bottom-color: var(--primary-color); 
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* === RESPONSIVE === */
.mobile-menu-toggle { display: none; }
@media (max-width: 992px) {
    .main-sidebar, .admin-sidebar { 
        transform: translateX(-100%); 
        transition: transform 0.3s ease; 
        position: fixed;
    }
    .main-sidebar.open, .admin-sidebar.open { 
        transform: translateX(0); 
    }
    .main-content, .admin-main-content { 
        margin-left: 0; 
        width: 100%; 
        padding: 20px; 
    }
    /* Mueve el perfil de usuario al menú hamburguesa en móvil */
    .main-content-header {
        display: none;
    }
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .admin-header .sidebar-footer {
        display: none; /* Oculta el perfil del header admin en móvil */
    }
    
    .mobile-menu-toggle { 
        display: block; 
        position: fixed; 
        top: 15px; 
        left: 15px; 
        z-index: 1100; 
        background: var(--secondary-dark-color); 
        color: white; 
        border: 1px solid var(--border-color);
        border-radius: 5px; 
        padding: 10px; 
        cursor: pointer; 
    }
}

/* === ESTILOS PARA TARJETAS DE PLANES === */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}
.plan-card {
    background: var(--card-color);
    border-radius: 12px;
    padding: 2rem;
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 25px rgba(157, 78, 221, 0.4);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}
.plan-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.plan-badge {
    position: absolute;
    top: 15px;
    right: -35px;
    background-color: var(--primary-color);
    color: white;
    padding: 5px 40px;
    font-size: 0.9rem;
    font-weight: 600;
    transform: rotate(45deg);
}
.plan-title { font-size: 1.8rem; font-weight: 600; margin-top: 0; }
.plan-price { font-size: 2.5rem; font-weight: 700; color: var(--primary-color); margin: 0.5rem 0; }
.plan-period { font-size: 1rem; color: var(--text-muted-color); }
.plan-offer { font-weight: 600; color: var(--warning-color); margin-bottom: 1.5rem; }
.plan-features {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
    flex-grow: 1;
}
.plan-features li { margin-bottom: 0.8rem; color: var(--text-color); }
.plan-features li i { margin-right: 10px; }
.plan-features li .fa-check { color: var(--success-color); }
.plan-features li .fa-times { color: var(--danger-color); }
.plan-payment-logo { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 1.5rem; color: var(--text-muted-color); }
.plan-payment-logo img { width: 32px; height: 32px; }

/* === CONTENEDOR BOTÓN MERCADO PAGO === */
.wallet-container {
    margin-top: auto;
    padding-top: 1.5rem;
    text-align: center;
    width: 100%;
}
.wallet-container > div {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50px;
    background-color: var(--secondary-dark-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s ease;
    padding: 5px;
}
.wallet-container > div:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(157, 78, 221, 0.3);
}

/* === TARJETA DE SUSCRIPCIÓN EN PERFIL.PHP === */
.subscription-status-card {
    background: var(--secondary-dark-color);
    border-radius: 12px;
    padding: 2.5rem;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    height: 100%;
}
.subscription-status-card .icon { font-size: 3.5rem; margin-bottom: 0.5rem; }
.subscription-status-card .status-title { font-size: 1.6rem; font-weight: 700; margin: 0; text-transform: uppercase; letter-spacing: 1px; }
.subscription-status-card .status-text { color: var(--text-muted-color); margin: 0; font-size: 1rem; }
.subscription-status-card.active {
    border-color: var(--success-color);
    color: var(--success-color);
    box-shadow: 0 0 15px rgba(40, 167, 69, 0.5), 0 0 5px rgba(40, 167, 69, 0.8) inset;
}
.subscription-status-card.active .status-title { color: #fff; }
.subscription-status-card.pending {
    border-color: var(--warning-color);
    color: var(--warning-color);
    box-shadow: 0 0 15px rgba(255, 193, 7, 0.5), 0 0 5px rgba(255, 193, 7, 0.8) inset;
}
.subscription-status-card.pending .status-title { color: #fff; }
.subscription-status-card.inactive {
    border-color: var(--danger-color);
    color: var(--danger-color);
    box-shadow: 0 0 15px rgba(220, 53, 69, 0.5), 0 0 5px rgba(220, 53, 69, 0.8) inset;
}
.subscription-status-card.inactive .status-title { color: #fff; }

/* === LAYOUT PARA PÁGINA DE PERFIL === */
.profile-layout-container { display: flex; flex-direction: column; gap: 2rem; }
.profile-form-section { width: 100%; }
.profile-status-section { width: 100%; }
@media (min-width: 992px) {
    .profile-layout-container { flex-direction: row; align-items: flex-start; }
    .profile-form-section { flex: 3; min-width: 0; }
    .profile-status-section { flex: 2; min-width: 0; }
}
/* === ESTILOS PARA EL BOTÓN DE ADJUNTAR ARCHIVO (ticket.php) === */
.custom-file-input-container {
    position: relative;
    display: flex;
    align-items: center;
}
.custom-file-input-container input[type="file"] { display: none; }
.custom-file-input-label {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.custom-file-input-label:hover {
    background-color: var(--primary-hover-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.file-name-display {
    margin-left: 15px;
    color: var(--text-muted-color);
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* === ESTILOS PARA AVISOS EN PLANES.PHP === */
.notice-card {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    margin-bottom: 3rem;
    padding: 1.5rem;
    border-width: 2px;
    border-style: solid;
    border-radius: 12px;
}
.notice-card p {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}
.notice-card.error {
    border-color: var(--danger-color);
    background-color: rgba(220, 53, 69, 0.1);
    color: #f87171;
}
.notice-card.success {
    border-color: var(--success-color);
    background-color: rgba(40, 167, 69, 0.1);
}
.notice-card.success h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4ade80;
    margin: 0;
}
.notice-card.success p {
    font-size: 1.125rem;
    margin-top: 0.5rem;
    color: var(--text-color);
}
.notice-card.success a {
    margin-top: 1rem;
}

/* === INICIO DE CORRECCIÓN LOGIN/REGISTRO MÓVIL === */
.auth-wrapper {
    display: grid;
    grid-template-columns: 1fr; /* Una columna por defecto para móvil */
    min-height: 100vh;
    width: 100%;
    position: relative; /* Para el video de fondo */
    overflow: hidden; /* Para el video de fondo */
}
.auth-branding-panel {
    display: none; /* Oculto en móvil por defecto */
    position: relative;
    color: white;
    padding: 3rem;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}
#auth-video-background {
    position: absolute; top: 50%; left: 50%;
    min-width: 100%; min-height: 100%;
    width: auto; height: auto; z-index: -2;
    transform: translateX(-50%) translateY(-50%);
    object-fit: cover;
}
.auth-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    min-height: 100vh;
    z-index: 1; /* Pone el formulario delante del video */
    background: rgba(10, 10, 30, 0.7); /* Fondo oscuro semi-transparente */
}
.auth-box {
    width: 100%;
    max-width: 450px;
    background: var(--secondary-dark-color);
    padding: 2.5rem;
    border-radius: 15px;
    border: 1px solid var(--border-color);
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}
.auth-box h2 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-family: 'Orbitron', sans-serif;
    color: white;
}
.auth-box .subtitle {
    color: var(--text-muted-color); 
    margin-bottom: 2rem;
}
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.form-group {
    /* El gap se encarga del espaciado */
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
/* === CORRECCIÓN CONTRASEÑA PEGADA === */
.password-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Permite que el enlace baje en móvil */
    gap: 5px; /* Pequeño espacio si se envuelve */
}
.forgot-password {
    font-size: 0.9rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}
.forgot-password:hover {
    color: var(--primary-hover-color);
    text-decoration: underline;
}
.auth-footer {
    text-align: center;
    margin-top: 2rem;
    color: var(--text-muted-color);
}
.auth-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}
.auth-link:hover {
    color: var(--primary-hover-color);
}

/* Media Query para PC (cuando SÍ se ven las dos columnas) */
@media (min-width: 992px) {
    .auth-wrapper {
        grid-template-columns: 1fr 1fr; /* Dos columnas */
    }
    .auth-branding-panel {
        display: flex; /* Se muestra el panel de la izquierda */
    }
    .auth-form-panel {
        background: var(--dark-color); /* Fondo sólido para PC */
    }
}
/* Media Query para móvil (cuando el formulario se rompe) */
@media (max-width: 480px) {
    .auth-box {
        padding: 1.5rem;
    }
    .form-row {
        grid-template-columns: 1fr; /* Una columna en móvil */
        gap: 1.5rem; /* Mismo gap que el auth-form */
    }
    .auth-box h2 {
        font-size: 1.8rem;
    }
}
/* === FIN DE CORRECCIÓN LOGIN/REGISTRO MÓVIL === */

/* === ESTILOS BANDEJA DE ENTRADA (bandeja.php) === */
.notification-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.notification-item {
    border-bottom: 1px solid var(--border-color);
}
.notification-item:last-child {
    border-bottom: none;
}
.notification-link {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text-color);
    transition: background-color 0.2s ease;
}
.notification-link:hover {
    background-color: var(--secondary-dark-color);
}
.notification-icon {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
    color: var(--primary-color);
}
.notification-content {
    flex-grow: 1;
}
.notification-content p {
    margin: 0;
    line-height: 1.5;
}
.notification-content .timestamp {
    font-size: 0.8em;
    color: var(--text-muted-color);
    margin-top: 5px;
    display: block;
}
.notification-chevron {
    font-size: 1.2rem;
    color: var(--text-muted-color);
    transition: transform 0.2s ease;
}
.notification-link:hover .notification-chevron {
    transform: translateX(5px);
    color: var(--primary-color);
}
/* Estilo para notificaciones no leídas */
.notification-item.unread .notification-link {
    background-color: rgba(157, 78, 221, 0.05); /* Tono morado muy sutil */
}
.notification-item.unread .notification-content p {
    font-weight: 600; /* Texto en negrita */
    color: #fff;
}