/* =========================================
   VARIABLES Y RESET (NUEVA PALETA ASTRAL BORZ)
   ========================================= */
:root {
    --bg-main: #0b0f19;
    --bg-card: #151b2b;
    --bg-card-hover: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    /* COLORES ASTRAL BORZ */
    --accent: #a855f7;         /* Morado Espacial (Principal) */
    --accent-hover: #9333ea;   
    --astral-blue: #6366f1;    /* Azul Índigo (Botones) */
    --astral-blue-hover: #4f46e5;
    
    /* Colores Roles ZvZ (Se mantienen por estándar) */
    --heal: #10b981;
    --tank: #3b82f6;
    --dps:  #ef4444;
    --supp: #eab308;
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
}

/* =========================================
   CABECERA Y NAVEGACIÓN
   ========================================= */
.main-header {
    background-color: var(--bg-card);
    border-bottom: 1px solid #334155;
    padding: 15px 0;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: 1px;
}

/* =========================================
   BUSCADOR (Brillo Morado)
   ========================================= */
.header-search {
    flex: 1; 
    display: flex;
    justify-content: center;
    padding: 0 20px;
}

.inline-search-form {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #0f121b;
    border: 1px solid #334155;
    border-radius: 30px; 
    padding: 4px 15px;
    width: 100%;
    max-width: 350px; 
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.inline-search-form:focus-within {
    border-color: var(--accent); 
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.3); /* Resplandor Morado */
}

.header-search-input {
    flex-grow: 1;
    width: 100%;
    background: transparent !important;
    border: none !important; 
    color: var(--text-main);
    font-size: 0.95rem;
    padding: 8px 10px 8px 5px;
    outline: none !important; 
    box-shadow: none !important;
    text-align: left;
}

.header-search-input::placeholder {
    color: #64748b;
}

.header-search-btn {
    background: transparent !important;
    width: auto !important;
    border: none !important;
    cursor: pointer;
    font-size: 1.1rem !important;
    padding: 0 10px !important;
    margin: 0 !important;
    color: var(--text-muted) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    border-radius: 0 !important;
}

.header-search-btn:hover {
    transform: scale(1.1); 
    background: transparent !important;
    color: var(--accent) !important;
}

/* =========================================
   BOTONES DE USUARIO
   ========================================= */
.header-auth { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
}

.btn-vip-header {
    background-color: var(--astral-blue);
    color: white;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

.auth-buttons-group { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
}

.btn-text { 
    color: var(--text-main); 
    text-decoration: none; 
    font-size: 0.9rem; 
    font-weight: 600; 
}

.btn-text:hover { 
    color: var(--accent); 
}

.auth-separator { 
    color: #334155; 
}

/* =========================================
   BARRA DE MENÚ SECUNDARIO (Línea Morada)
   ========================================= */
.main-nav {
    background-color: #0f131f;
    border-bottom: 2px solid var(--accent); /* Borde morado */
}

.main-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 12px 20px;
    overflow-x: auto;
}

.main-nav ul li a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
}

.main-nav ul li a:hover, .main-nav ul li a.active {
    color: #fff;
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.6); /* Destello morado en letras */
}

/* =========================================
   HERO (Destello Morado en el título principal)
   ========================================= */
.hero {
    position: relative;
    background: linear-gradient(to bottom, rgba(11, 15, 25, 0.7), var(--bg-main)), 
                url('https://assets.albiononline.com/uploads/media/default/media/ea75ba62854930263152a513511eb9ab69b9101b.jpeg') center/cover no-repeat;
    padding: 80px 20px 60px;
    text-align: center;
    border-bottom: 1px solid #334155;
}

.hero h1 {
    font-size: 3rem;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 15px;
    text-shadow: 0 0 20px rgba(168, 85, 247, 0.8), 0 0 10px #000; /* Glow espacial */
}

.hero p { 
    color: #cbd5e1; 
    font-size: 1.2rem; 
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.admin-header { 
    margin-bottom: 30px; 
    text-align: center; 
}

/* =========================================
   TARJETAS DE ROLES (Massing)
   ========================================= */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.card {
    background-color: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.4);
    border-top: 4px solid #334155;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card.role-heal { border-top-color: var(--heal); box-shadow: 0 -2px 10px rgba(16, 185, 129, 0.1); }
.card.role-tank { border-top-color: var(--tank); box-shadow: 0 -2px 10px rgba(59, 130, 246, 0.1); }
.card.role-dps  { border-top-color: var(--dps);  box-shadow: 0 -2px 10px rgba(239, 68, 68, 0.1);  }
.card.role-supp { border-top-color: var(--supp); box-shadow: 0 -2px 10px rgba(234, 179, 8, 0.1);  }

.card-header { 
    display: flex; 
    justify-content: space-between; 
    margin-bottom: 15px; 
}

.role-badge { 
    font-size: 0.75rem; 
    font-weight: 800; 
    text-transform: uppercase; 
    padding: 4px 10px; 
    border-radius: 20px; 
    background: rgba(255,255,255,0.1); 
}

.weapon-name { 
    font-size: 1.2rem; 
    font-weight: 600; 
    margin-bottom: 15px; 
}

.input-group { 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
    margin-top: auto; 
}

input[type="text"] {
    width: 100%; 
    padding: 10px; 
    border-radius: 6px; 
    border: 1px solid #334155;
    background-color: #0f121b; 
    color: #fff; 
    outline: none;
}

input[type="text"]:focus { 
    border-color: var(--accent); 
}

button {
    width: 100%; 
    padding: 10px; 
    background-color: var(--astral-blue); /* Botón azul índigo */
    color: #fff; /* Letras blancas para el azul */
    border: none; 
    border-radius: 6px; 
    font-weight: 800; 
    cursor: pointer; 
    text-transform: uppercase;
    transition: background-color 0.2s;
}

button:hover { 
    background-color: var(--astral-blue-hover); 
}

button.btn-danger { 
    background-color: var(--dps); 
    color: white; 
}

button.btn-danger:hover { 
    background-color: #dc2626; 
}

.player-filled { 
    background-color: #1e293b; 
    padding: 10px; 
    border-radius: 6px; 
    text-align: center; 
    font-weight: bold; 
    color: var(--accent); 
    border: 1px solid #334155; 
}

.empty-state { 
    grid-column: 1 / -1; 
    text-align: center; 
    color: var(--text-muted); 
    padding: 50px; 
    font-size: 1.2rem; 
}

/* =========================================
   PANEL ADMIN & TABLAS
   ========================================= */
.admin-panel { 
    background: var(--bg-card); 
    padding: 20px; 
    border-radius: 12px; 
    margin-bottom: 30px; 
    border: 1px solid #334155; 
    text-align: center; 
}

.admin-panel h3 { 
    margin-bottom: 15px; 
    color: var(--text-main); 
}

.btn-group { 
    display: flex; 
    gap: 15px; 
    justify-content: center; 
    flex-wrap: wrap; 
}

.admin-panel button { 
    width: auto; 
    min-width: 200px; 
}

.table-container { 
    overflow-x: auto; 
    background: var(--bg-card); 
    border-radius: 12px; 
    border: 1px solid #334155; 
}

table { 
    width: 100%; 
    border-collapse: collapse; 
    text-align: left; 
}

th, td { 
    padding: 15px; 
    border-bottom: 1px solid #334155; 
}

th { 
    background: #1e293b; 
    color: var(--accent); 
    text-transform: uppercase; 
    font-size: 0.9rem; 
}

tbody tr:hover { 
    background-color: var(--bg-card-hover); 
}

/* =========================================
   ANIMACIONES Y ESTADOS MEJORADOS
   ========================================= */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    animation: fadeInUp 0.4s ease-out forwards;
}

.empty-state { 
    grid-column: 1 / -1; 
    background: rgba(255, 255, 255, 0.02);
    border: 2px dashed #334155;
    border-radius: 12px;
    text-align: center; 
    color: var(--text-muted); 
    padding: 60px 20px; 
    font-size: 1.2rem; 
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* =========================================
   ESTILOS LOGIN Y REGISTRO (Astral Borz Theme)
   ========================================= */
.login-page-main {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 40px 20px;
}

.login-box {
    width: 100%;
    max-width: 450px;
    text-align: center;
    background-color: var(--bg-card);
    padding: 40px;
    border-radius: 12px;
    border: 1px solid #334155;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}

.login-title {
    color: var(--accent); /* Morado Astral */
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-row {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.input-row label {
    color: var(--text-main);
    width: 100px; 
    text-align: right;
    margin-right: 15px;
    font-size: 16px;
    font-weight: bold;
}

.input-row input, .input-row select {
    flex: 1;
    padding: 12px;
    border: 1px solid #334155;
    border-radius: 6px;
    background-color: #0f121b; 
    color: white;
    font-size: 14px;
}

.input-row input:focus, .input-row select:focus {
    outline: none;
    border-color: var(--accent); 
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.3); /* Resplandor Morado */
}

.btn-login-submit {
    width: calc(100% - 115px);
    margin-left: 115px;
    padding: 12px;
    background-color: var(--astral-blue); /* Botón Azul Índigo */
    color: #fff;
    border: none;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.3s;
    text-transform: uppercase;
}

.btn-login-submit:hover {
    background-color: var(--astral-blue-hover);
}

.login-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 25px 0 25px 115px;
    color: var(--text-muted);
}

.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid #334155;
}

.login-divider span {
    padding: 0 10px;
}

.btn-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    color: #555;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    margin-left: 115px; 
    width: calc(100% - 115px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: background-color 0.2s;
}

.btn-google img {
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

.btn-google:hover {
    background-color: #f1f1f1;
}

.login-footer-text {
    margin-top: 30px;
    color: var(--text-muted);
    font-size: 14px;
}

.login-footer-text a {
    color: var(--accent);
    text-decoration: none;
    font-weight: bold;
}

.login-footer-text a:hover {
    text-decoration: underline;
}

@media (max-width: 600px) {
    .input-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .input-row label {
        width: 100%;
        text-align: left;
        margin-bottom: 8px;
    }
    .btn-login-submit, .btn-google, .login-divider {
        width: 100%;
        margin-left: 0;
    }
}

/* =========================================
   ESTILOS PARA EL PERFIL 
   ========================================= */
.perfil-wrapper {
    max-width: 600px;
    margin: 60px auto;
    background-color: var(--bg-card);
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.perfil-avatar {
    font-size: 5rem;
    margin-bottom: 10px;
}

.perfil-nick {
    color: var(--accent);
    font-size: 2.5rem;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.perfil-rango {
    display: inline-block;
    background-color: #334155;
    color: white;
    padding: 6px 20px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: 30px;
    text-transform: uppercase;
}

.perfil-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.stat-box {
    background-color: #0f121b;
    border: 1px solid #334155;
    padding: 20px;
    border-radius: 8px;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 8px;
    text-transform: uppercase;
    font-weight: bold;
}

.stat-value {
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
}

.stat-box-full {
    grid-column: 1 / -1; 
}


/* =========================================
   ESTILOS DE MERCADO (NORMAL Y NEGRO)
   ========================================= */

/* Fondos principales para diferenciar ambas páginas */
.market-main {
    background-color: #05040a;
    background-image: radial-gradient(circle at top center, #1a0b2e 0%, #05040a 100%);
    min-height: 100vh;
    padding: 50px 20px;
}

.black-market-main {
    background-color: #0a0404;
    background-image: radial-gradient(circle at top center, #2e0b0b 0%, #0a0404 100%);
    min-height: 100vh;
    padding: 50px 20px;
}

/* Base Mercado Normal (Morado/Dorado) */
.market-container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(13, 8, 25, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(142, 68, 173, 0.4);
    border-radius: 16px;
    box-shadow: 0 0 40px rgba(74, 20, 140, 0.5), inset 0 0 20px rgba(0, 0, 0, 0.8);
    padding: 50px;
    color: #fff;
    position: relative;
}

.btn-mercado-negro {
    position: absolute;
    top: 30px;
    right: 30px;
    background: linear-gradient(45deg, #b71c1c, #d32f2f);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 800;
    text-transform: uppercase;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(183, 28, 28, 0.5);
    transition: all 0.3s ease;
    border: 1px solid #ff5252;
    display: none;
    z-index: 10;
}

.btn-mercado-negro:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(183, 28, 28, 0.8);
    color: #fff;
}

.market-header { text-align: center; margin-bottom: 40px; }
.market-logo { width: 140px; height: auto; margin: 0 auto 20px auto; display: block; filter: drop-shadow(0 0 15px rgba(142, 68, 173, 0.8)); }
.market-header h1 { font-size: 2.8rem; color: #fff; text-transform: uppercase; letter-spacing: 4px; margin-bottom: 5px; text-shadow: 0 0 10px rgba(255, 255, 255, 0.3); }
.market-header h2 { font-size: 1.2rem; color: #b388ff; text-transform: uppercase; letter-spacing: 3px; margin-bottom: 20px; }

.market-banner { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; margin-bottom: 40px; }
.market-banner div { background: rgba(74, 20, 140, 0.3); padding: 10px 20px; border-radius: 8px; border-left: 3px solid #daa520; font-size: 0.95rem; color: #d1c4e9; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5); }

.market-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 25px; margin-bottom: 40px; }

.item-card {
    background: linear-gradient(145deg, rgba(20, 15, 35, 0.95), rgba(10, 5, 20, 0.95));
    border: 1px solid #33204d;
    border-radius: 12px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    position: relative;
}
.item-card:hover { transform: translateY(-5px); border-color: #daa520; box-shadow: 0 10px 25px rgba(218, 165, 32, 0.3); }

.tag { position: absolute; top: -12px; right: 20px; padding: 5px 15px; border-radius: 20px; font-size: 0.8rem; font-weight: bold; text-transform: uppercase; letter-spacing: 1px; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5); }
.tag-sell { background: #1b5e20; color: #a5d6a7; border: 1px solid #4caf50; }
.tag-service { background: #4a148c; color: #ce93d8; border: 1px solid #9c27b0; }
.tag-buy { background: #b71c1c; color: #ef9a9a; border: 1px solid #f44336; }

.item-icon-wrapper { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; border-bottom: 1px solid rgba(142, 68, 173, 0.3); padding-bottom: 15px; }
.item-icon { width: 60px; height: 60px; border-radius: 10px; background: #222; display: flex; align-items: center; justify-content: center; font-size: 2rem; border: 1px solid #5a2e85; box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8); overflow: hidden; }

.item-title { flex-grow: 1; }
.item-title h3 { margin: 0; font-size: 1.3rem; color: #fff; text-transform: uppercase; }
.item-tier { font-size: 0.9rem; color: #daa520; font-weight: bold; }

.item-details { margin-bottom: 20px; flex-grow: 1; }
.detail-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 0.95rem; color: #bbb; }
.detail-row span:last-child { color: #fff; font-weight: bold; }
.price-highlight { color: #ffd700 !important; font-size: 1.1rem; text-shadow: 0 0 5px rgba(255, 215, 0, 0.5); }

.discord-btn { background-color: #5865F2; color: #fff; text-decoration: none; padding: 12px; border-radius: 8px; font-weight: bold; font-size: 0.95rem; display: flex; align-items: center; justify-content: center; gap: 8px; transition: background-color 0.2s; width: 100%; box-sizing: border-box; border: none; cursor: pointer; }
.discord-btn:hover { background-color: #4752C4; }


/* =========================================
   SOBREESCRITURA PARA EL MERCADO NEGRO (TEMA ROJO)
   ========================================= */
.black-market-main .market-container {
    background: rgba(25, 8, 8, 0.8);
    border-color: rgba(220, 38, 38, 0.5);
    box-shadow: 0 0 40px rgba(153, 27, 27, 0.5), inset 0 0 20px rgba(0, 0, 0, 0.9);
}

.black-market-main .market-logo { filter: drop-shadow(0 0 15px rgba(220, 38, 38, 0.8)); }
.black-market-main .market-header h1 { color: #ff4d4d; text-shadow: 0 0 15px rgba(220, 38, 38, 0.6); }
.black-market-main .market-header h2 { color: #fca5a5; }

.black-market-main .market-banner div {
    background: rgba(153, 27, 27, 0.3);
    border-left-color: #ff0000;
    color: #fecaca;
}

.black-market-main .item-card {
    background: linear-gradient(145deg, rgba(35, 15, 15, 0.95), rgba(20, 5, 5, 0.95));
    border-color: #4d2020;
}

.black-market-main .item-card:hover {
    border-color: #ef4444;
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.4);
}

.black-market-main .tag-sell { background: #b71c1c; color: #ffcdd2; border-color: #f44336; }
.black-market-main .item-icon-wrapper { border-bottom-color: rgba(220, 38, 38, 0.3); }
.black-market-main .item-icon { background: #111; border-color: #7f1d1d; }
.black-market-main .item-tier { color: #f87171; }
.black-market-main .price-highlight { color: #fbbf24 !important; text-shadow: 0 0 5px rgba(251, 191, 36, 0.5); }
.black-market-main .discord-btn { background-color: #7f1d1d; border: 1px solid #991b1b; }
.black-market-main .discord-btn:hover { background-color: #b91c1c; }

@media (max-width: 768px) {
    .market-container { padding: 30px 20px; }
    .btn-mercado-negro { top: 15px; right: 15px; font-size: 0.8rem; padding: 8px 12px; }
}