/* ---------------------------------------------------- */
/* ESTILOS DEL PERFIL DE PILOTO (PROFILE.PHP)           */
/* ---------------------------------------------------- */

body {
    background-color: #0f172e;
    color: #e2e8f0;
    font-family: 'Oswald', sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

/* ---------------------------------------------------- */
/* HEADER / HERO SECTION                                */
/* ---------------------------------------------------- */
.profile-header {
    position: relative;
    background: linear-gradient(180deg, rgba(15, 23, 46, 0.7) 0%, #0f172e 100%), 
                url('../images/bandits_19.webp');
    background-size: cover;
    background-position: center;
    padding: 160px 0 80px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.profile-avatar-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 30px;
}

.profile-avatar-large {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 4px solid #0f172e;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.3), 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    object-fit: cover;
    background-color: #0f172e;
    transition: all 0.3s ease;
}

.profile-avatar-wrapper:hover .profile-avatar-large {
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.6), 0 25px 30px -5px rgba(0, 0, 0, 0.6);
    transform: scale(1.02);
}

/* Badge de Rango */
.profile-rank-badge {
    position: absolute;
    bottom: 10px;
    right: 15px;
    background: #1e293b;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    border: 2px solid #60a5fa;
    color: #fff;
    font-size: 1.2rem;
    z-index: 10;
}

/* Nombres y Roles */
.profile-name {
    font-family: 'Horizon', sans-serif;
    font-size: 3.5em;
    font-weight: 700;
    text-transform: uppercase;
    margin: 0 0 15px;
    color: #fff;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #fff 0%, #e2e8f0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.profile-role {
    display: inline-block;
    background: rgba(30, 58, 138, 0.5);
    color: #93c5fd;
    padding: 8px 24px;
    border-radius: 99px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 1em;
    border: 1px solid rgba(96, 165, 250, 0.3);
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* ---------------------------------------------------- */
/* CONTENIDO PRINCIPAL (STATS Y MISIONES)               */
/* ---------------------------------------------------- */
.profile-content {
    background: linear-gradient(135deg, #0f172e 0%, #1a1f3a 50%, #0f172e 100%);
    position: relative;
    padding-bottom: 80px;
}

.profile-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 10% 20%, rgba(59,130,246,0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(139,92,246,0.05) 0%, transparent 40%);
    pointer-events: none;
    z-index: 1;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    margin-top: -50px; /* Overlap header */
    position: relative;
    z-index: 10;
    padding-bottom: 80px;
}

.stat-box {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 40px 30px;
    border-radius: 16px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column-reverse;
}

.stat-box:hover {
    transform: translateY(-8px);
    border-color: rgba(96, 165, 250, 0.4);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
    background: rgba(30, 41, 59, 0.9);
}

.stat-box .val {
    font-family: 'Horizon', sans-serif;
    font-size: 2.8em;
    font-weight: 700;
    color: #f1f5f9;
    display: block;
    line-height: 1;
    margin-bottom: 5px;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-box .label {
    font-family: 'Oswald', sans-serif;
    font-size: 0.85em;
    text-transform: uppercase;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: 2px;
    margin-bottom: 15px;
    display: block;
}

/* ---------------------------------------------------- */
/* TABLA DE MISIONES                                    */
/* ---------------------------------------------------- */
.mission-history {
    position: relative;
    z-index: 2;
}

.section-header-small {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.section-title-small {
    font-family: 'Horizon', sans-serif;
    font-size: 2em;
    color: #fff;
    margin: 0;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-badge {
    background: rgba(30, 58, 138, 0.3);
    color: #93c5fd;
    padding: 6px 14px;
    border-radius: 99px;
    margin-left: 20px;
    font-size: 0.9em;
    font-weight: 700;
    border: 1px solid rgba(96, 165, 250, 0.2);
}

.history-table-wrapper {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(8px);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th, .history-table td {
    padding: 24px 30px;
    text-align: left;
}

.history-table th {
    background: rgba(15, 23, 46, 0.6);
    color: #94a3b8;
    text-transform: uppercase;
    font-size: 0.8em;
    font-weight: 600;
    letter-spacing: 1.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.history-table tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background 0.2s;
}

.history-table tr:last-child {
    border-bottom: none;
}

.history-table tr:hover {
    background: rgba(59, 130, 246, 0.05); /* Very subtle blue tint */
}

.mission-title {
    font-family: 'Oswald', sans-serif;
    font-weight: 500;
    color: #e2e8f0;
    font-size: 1.25em;
    letter-spacing: 0.5px;
}

.mission-date {
    color: #64748b;
    font-size: 0.95em;
    font-family: 'Oswald', sans-serif;
}

.duration-pill {
    display: inline-block;
    background: rgba(16, 185, 129, 0.1);
    color: #34d399; /* Emerald-400 */
    padding: 6px 14px;
    border-radius: 6px;
    font-family: monospace;
    font-weight: 700;
    border: 1px solid rgba(16, 185, 129, 0.2);
    font-size: 0.9em;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px;
    color: #94a3b8;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .profile-name { font-size: 2.2em; }
    .stats-container { grid-template-columns: 1fr; margin-top: -30px; }
    .stat-box { padding: 30px; flex-direction: row; justify-content: space-between; align-items: center; text-align: left;}
    .stat-box .val { font-size: 2em; margin-bottom: 0; }
    .stat-box .label { margin-bottom: 0; margin-right: 15px; }
    .history-table th, .history-table td { padding: 15px; }
    .profile-header { padding-top: 120px; }
}
