/* ==========================================================================
   PERFIL PREMIUM - SHARED LAYOUT (Dark Gold)
   Consolidated styles for profile, orders, favorites, addresses, settings
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400..900;1,400..900&family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
    --ck-gold: #ffc107;
    --ck-gold2: #ff9800;
    --ck-gold3: #ff6f00;
    --ck-gold-glow: rgba(255, 193, 7, 0.15);
    --ck-d1: #0a0a0a;
    --ck-d2: #141414;
    --ck-d3: #1a1a1a;
    --ck-border: rgba(255, 193, 7, 0.12);
    --ck-border2: rgba(255, 193, 7, 0.25);
    --ck-t1: #ffffff;
    --ck-t2: #e0e0e0;
    --ck-t3: #888888;
    --ck-green: #00e676;
    --ck-radius: 20px;
    --ck-bounce: cubic-bezier(.34,1.56,.64,1);
    --ck-ease: cubic-bezier(.25,.8,.25,1);
}

/* Ambient glow */
.perfil-ambient {
    position: fixed;
    top: -20%;
    left: -10%;
    width: 60vw;
    height: 60vh;
    background: radial-gradient(circle, rgba(255,193,7,0.06) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

.perfil-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 24px;
    font-family: 'Poppins', sans-serif;
    color: var(--ck-t1);
}

/* ====== HEADER PREMIUM ====== */
.perfil-header {
    background: var(--ck-d2);
    border: 1px solid var(--ck-border);
    border-radius: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
}

.perfil-banner {
    height: 180px;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15) 0%, rgba(26, 26, 26, 0.8) 100%),
                url('https://images.unsplash.com/photo-1414235077428-338989a2e8c0?q=80&w=2000&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    position: relative;
}

.perfil-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--ck-d2) 0%, rgba(10,10,10,0.3) 100%);
}

.perfil-header-bg-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 1;
}

.perfil-header-bg-particles .bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,193,7,0.06) 0%, transparent 70%);
    filter: blur(8px);
    pointer-events: none;
}

.perfil-header-bg-particles .bubble-1 {
    width: 200px; height: 200px;
    top: -40px; left: 10%;
    animation: floatSlow 15s ease-in-out infinite alternate;
}

.perfil-header-bg-particles .bubble-2 {
    width: 150px; height: 150px;
    bottom: 20px; right: 15%;
    animation: floatSlow 20s ease-in-out infinite alternate-reverse;
}

.perfil-header-bg-particles .bubble-3 {
    width: 100px; height: 100px;
    top: 20%; right: 40%;
    animation: floatSlow 12s ease-in-out infinite alternate;
}

@keyframes floatSlow {
    0% { transform: translateY(0) translateX(0) scale(1); }
    100% { transform: translateY(-20px) translateX(15px) scale(1.1); }
}

.perfil-info-bar {
    padding: 0 35px 30px 35px;
    display: flex;
    align-items: flex-end;
    gap: 30px;
    position: relative;
    margin-top: -55px; /* Superposición de avatar */
    z-index: 2;
}

/* Avatar interactive styling */
.perfil-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
    padding: 6px;
    display: inline-flex;
    z-index: 3;
}

.avatar-ring-outer {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent, var(--ck-gold), transparent, var(--ck-gold2), transparent);
    animation: rotateGlowRing 8s linear infinite;
    pointer-events: none;
    opacity: 0.7;
    filter: blur(1px);
}

.avatar-ring-inner {
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: var(--ck-d2);
    border: 2px solid rgba(255, 193, 7, 0.25);
    pointer-events: none;
    z-index: 1;
}

.perfil-avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ck-gold) 0%, var(--ck-gold3) 100%);
    color: #000;
    font-size: 2.2rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border: 4px solid var(--ck-d2);
    position: relative;
    cursor: pointer;
    overflow: hidden;
    z-index: 2;
    transition: all 0.4s var(--ck-bounce);
}

.perfil-avatar-wrapper:hover .perfil-avatar {
    transform: scale(1.05);
    box-shadow: 0 12px 30px rgba(255, 193, 7, 0.35);
}

.perfil-avatar-wrapper:hover .avatar-ring-outer {
    animation-duration: 4s;
    opacity: 1;
}

@keyframes rotateGlowRing {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Botón Flotante para Editar Avatar */
.avatar-edit-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--ck-gold);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--ck-d2);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    cursor: pointer;
    z-index: 4;
    transition: all 0.3s var(--ck-bounce);
}

.avatar-edit-badge:hover {
    transform: scale(1.15);
    background: #fff;
    box-shadow: 0 6px 15px rgba(255,193,7,0.5);
}

.avatar-edit-badge i {
    font-size: 0.9rem;
}

.avatar-initials {
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* User Details styling */
.perfil-user-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 5px;
    flex-grow: 1;
}

.perfil-user-details h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.5px;
    text-shadow: 0 4px 15px rgba(0,0,0,0.6);
}

.shine-text {
    background: linear-gradient(90deg, #fff 0%, #ffd700 25%, #ffb700 50%, #ffd700 75%, #fff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textShine 6s linear infinite;
}

@keyframes textShine {
    0% { background-position: 200% center; }
    100% { background-position: -200% center; }
}

.header-badges {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.role-badge {
    background: rgba(255,193,7,0.12);
    border: 1px solid rgba(255,193,7,0.25);
    color: var(--ck-gold);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.crown-animated {
    animation: crownFloat 2s ease-in-out infinite;
}

@keyframes crownFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-3px) rotate(5deg); }
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--ck-t2);
    background: rgba(0, 230, 118, 0.08);
    border: 1px solid rgba(0, 230, 118, 0.2);
    padding: 6px 16px;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.dot-online {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--ck-green);
    box-shadow: 0 0 10px var(--ck-green);
    animation: statusPulse 1.8s infinite;
}

@keyframes statusPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.6; }
}

.page-badge-header {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* ====== TWO COLUMN LAYOUT ====== */
.perfil-content {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 30px;
}

/* ====== SIDEBAR STYLING ====== */
.perfil-sidebar {
    background: linear-gradient(180deg, var(--ck-d2) 0%, rgba(10,10,10,0.9) 100%);
    border: 1px solid var(--ck-border);
    border-radius: 24px;
    padding: 24px 16px;
    height: fit-content;
    position: sticky;
    top: 100px;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.perfil-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.perfil-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 12px;
    color: var(--ck-t3);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    transition: all 0.3s var(--ck-ease);
}

.perfil-nav-item i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    transition: transform 0.3s var(--ck-ease);
}

.perfil-nav-item:hover {
    color: var(--ck-gold);
    background: var(--ck-gold-glow);
    transform: translateX(3px);
}

.perfil-nav-item:hover i {
    transform: scale(1.1);
}

.perfil-nav-item.active {
    color: #000;
    background: linear-gradient(135deg, var(--ck-gold) 0%, var(--ck-gold2) 100%);
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.2);
}

/* ====== MAIN CONTENT LAYOUT ====== */
.perfil-main {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Glass Card */
.glass-card {
    background: linear-gradient(145deg, rgba(20,20,20,0.8) 0%, rgba(10,10,10,0.9) 100%);
    border: 1px solid var(--ck-border);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    transition: border-color 0.3s ease;
}

.glass-card:hover { 
    border-color: rgba(255, 193, 7, 0.25); 
}

/* Section Title */
.section-title-premium {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    color: var(--ck-gold);
    margin: 0 0 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed var(--ck-border2);
    padding-bottom: 15px;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 991px) {
    .perfil-content { 
        grid-template-columns: 1fr; 
    }
    .perfil-sidebar { 
        position: relative; 
        top: 0; 
    }
}

@media (max-width: 768px) {
    .perfil-info-bar {
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-top: -65px;
        padding: 0 20px 25px 20px;
        gap: 15px;
    }
    .perfil-user-details {
        align-items: center;
    }
    .header-badges {
        justify-content: center;
    }
    .perfil-user-details h1 {
        font-size: 1.8rem;
    }
}
