/* ===================================
   AVATAR VIEW PAGE - AIBIMB
   Premium Design System v2 - Modernized
   =================================== */

/* ===== VARIABLES & UTILS ===== */
:root {
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
    --card-hover-transform: translateY(-4px);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-accent: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    --gradient-surface: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-600);
}

/* ===== FADE-IN ANIMATIONS ===== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== HERO SECTION ===== */
.avatar-detail-hero {
    background: radial-gradient(circle at 20% 80%, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(37, 99, 235, 0.15) 0%, transparent 50%),
        var(--gray-50);
    padding: 4rem 0 3rem;
    position: relative;
    overflow: hidden;
}

.avatar-detail-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(#6366f1 0.5px, transparent 0.5px), radial-gradient(#6366f1 0.5px, #f9fafb 0.5px);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    opacity: 0.03;
    pointer-events: none;
}

/* ===== PROFILE CARD ===== */
.avatar-profile-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.03);
    padding: 3rem;
    position: relative;
    z-index: 2;
    max-width: 1000px;
    margin: 0 auto;
    transition: transform 0.3s ease;
}

.avatar-header-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 4rem;
    align-items: start;
    margin-bottom: 3rem;
}

/* ===== AVATAR IMAGE ===== */
.avatar-image-container {
    position: relative;
    width: 220px;
    height: 220px;
    border-radius: 28px;
    padding: 8px;
    background: white;
    box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.15);
    transform: rotate(-2deg);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.avatar-image-container:hover {
    transform: rotate(0deg) scale(1.02);
}

.avatar-image-container img {
    width: 100%;
    height: 100%;
    border-radius: 22px;
    object-fit: cover;
    display: block;
}

/* ===== FALLBACK AVATAR ===== */
.avatar-fallback-gradient {
    width: 100%;
    height: 100%;
    border-radius: 22px;
    background: linear-gradient(135deg, #e0e7ff 0%, #f3e8ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--primary-500);
}

/* ===== STATUS BADGE ===== */
.avatar-status-badge {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 28px;
    height: 28px;
    background: #10b981;
    border: 4px solid white;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
    z-index: 2;
}

.avatar-status-badge::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 2px solid #10b981;
    opacity: 0;
    animation: ripple 2s infinite;
}

@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* ===== TYPOGRAPHY & INFO ===== */
.avatar-main-info {
    padding-top: 0.5rem;
}

.avatar-title {
    font-family: 'Inter', 'DM Sans', system-ui, -apple-system, sans-serif;
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-600) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ===== BADGES ===== */
.avatar-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
}

.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    letter-spacing: 0.01em;
}

.badge-category {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #dbeafe;
}

.badge-language {
    background: #fff7ed;
    color: #c2410c;
    border-color: #ffedd5;
}

.badge-experience {
    background: #f8fafc;
    color: #475569;
    border-color: #e2e8f0;
}

.badge-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* ===== DESCRIPTION ===== */
.avatar-description {
    color: var(--text-secondary);
    font-size: clamp(1rem, 2vw, 1.125rem);
    line-height: 1.6;
    margin-bottom: 2rem;
    max-width: 90%;
    font-weight: 400;
}

/* ===== RATING ===== */
.rating-display {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    background: #fffbeb;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    display: inline-flex;
    border: 1px solid #fef3c7;
}

.rating-stars {
    color: #f59e0b;
    font-size: 1.1rem;
    display: flex;
    gap: 0.2rem;
}

.rating-text {
    font-weight: 700;
    color: #92400e;
    font-size: 0.9rem;
}

/* ===== HERO CTA ===== */
.hero-cta-wrapper {
    margin-top: 2rem;
}

.btn-hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    font-size: 1.125rem;
    padding: 1rem 2.5rem;
    border-radius: 100px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 25px -5px rgba(102, 126, 234, 0.4);
}

.btn-hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 35px -10px rgba(102, 126, 234, 0.5);
    color: white;
}

.btn-hero-cta:active {
    transform: translateY(-1px);
}

/* ===== STATS GRID ===== */
.avatar-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    padding: 2.5rem 0 0;
    border-top: 1px solid var(--gray-100);
}

.stat-card {
    text-align: center;
    padding: 1.5rem;
    border-radius: 16px;
    background: white;
    transition: all 0.3s ease;
    border: 1px solid var(--gray-100);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-100);
}

.stat-number {
    display: block;
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
}

/* ===== CONTENT SECTIONS ===== */
.content-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    gap: 2.5rem;
}

.content-section {
    background: white;
    border-radius: 16px;
    padding: 3rem;
    border: 1px solid var(--gray-100);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
}

.content-section:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-100);
}

.section-header {
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.section-header .section-icon {
    width: 56px;
    height: 56px;
    min-width: 56px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    border: none;
    margin: 0;
    padding: 0;
}

.section-header .section-title {
    font-family: 'Inter', 'DM Sans', sans-serif;
    font-size: clamp(1.5rem, 3vw, 1.75rem);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    letter-spacing: -0.01em;
    line-height: 56px;
    display: block;
    height: 56px;
}

.bio-text {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.experience-highlight {
    margin-top: 1.5rem;
}

.experience-highlight-content {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: #f0f9ff;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    border: 1px solid #bae6fd;
    color: #0369a1;
    font-weight: 600;
    font-size: 0.95rem;
    margin: 0;
}

.experience-highlight-content i {
    color: #0284c7;
}

.education-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.education-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-100);
}

.education-item:last-child {
    border-bottom: none;
}

.education-text {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

.persona-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.persona-goals {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* ===== EXPERTISE GRID ===== */
.expertise-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.expertise-card {
    background: #eff6ff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid #dbeafe;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: visible;
    width: auto;
}

.expertise-card::before {
    display: none;
}

.expertise-card:hover {
    border-color: var(--primary-400);
    background: var(--primary-100);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.expertise-card-text {
    color: #1e40af;
    font-weight: 600;
    margin: 0;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.expertise-card:hover .expertise-card-text {
    color: var(--primary-700);
}

/* ===== PERSONAS ===== */
.personas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.persona-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--gray-100);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
    position: relative;
}

.persona-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-200);
}

.persona-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.persona-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    border: none;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.persona-goal {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
    border: 1px solid var(--gray-100);
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    transition: border-color 0.2s ease;
}

.persona-goal:hover {
    border-color: var(--primary-200);
}

.persona-goal::before {
    content: '✓';
    color: var(--success-500);
    font-weight: 800;
    margin-top: 2px;
}

/* ===== STICKY CTA ===== */
.sticky-cta-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
    z-index: 10000;
    display: none;
    /* JS toggles this */
    animation: slide-up 0.3s ease-out;
}

@keyframes slide-up {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.sticky-cta-btn {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    height: 56px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 1.1rem;
    color: white;
    text-decoration: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: all 0.2s ease;
}

.sticky-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    color: white;
}

body.has-sticky-cta {
    padding-bottom: 80px;
}

/* ===== RESPONSIVE ===== */
@media (min-width: 769px) {
    .sticky-cta-bar {
        display: none !important;
    }

    body.has-sticky-cta {
        padding-bottom: 0;
    }
}

@media (max-width: 968px) {
    .avatar-header-grid {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
        gap: 2.5rem;
    }

    .avatar-image-container {
        transform: rotate(0);
        width: 180px;
        height: 180px;
    }

    .avatar-badges {
        justify-content: center;
    }

    .avatar-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .avatar-profile-card {
        padding: 2.5rem 1.5rem;
    }
}

@media (max-width: 768px) {
    .avatar-detail-hero {
        padding: 3rem 0 2rem;
    }

    .avatar-profile-card {
        padding: 2rem 1.5rem;
    }

    .content-section {
        padding: 2rem 1.5rem;
    }

    .section-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 640px) {
    .avatar-detail-hero {
        padding: 2.5rem 0 1.5rem;
    }

    .avatar-title {
        font-size: clamp(2rem, 5vw, 2.5rem);
    }

    .content-section {
        padding: 1.5rem 1rem;
    }

    .avatar-stats-grid {
        gap: 1rem;
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-number {
        font-size: clamp(1.5rem, 4vw, 1.75rem);
    }

    .personas-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .avatar-stats-grid {
        grid-template-columns: 1fr;
    }

    .avatar-header-grid {
        gap: 1.5rem;
    }

    .avatar-image-container {
        width: 160px;
        height: 160px;
    }
}