/* Profile Redesign V2 - Sick Premium Aesthetic */

:root {
    --profile-glass-bg: rgba(255, 255, 255, 0.7);
    --profile-glass-border: rgba(255, 255, 255, 0.4);
    --profile-mesh-gradient: radial-gradient(at 0% 0%, hsla(36, 30%, 96%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(28, 20%, 94%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(36, 30%, 96%, 1) 0, transparent 50%);
}

.profile-hero-v2 {
    background: var(--profile-mesh-gradient);
    padding: 80px 24px 60px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    margin-top: 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.profile-hero-v2::before {
    content: "IDENTITY / DOSSIER";
    position: absolute;
    top: 100px;
    left: 40px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    color: var(--google-blue-600);
    opacity: 0.4;
    transform: rotate(-90deg);
    transform-origin: left top;
}

.profile-avatar-v2 {
    width: 120px;
    height: 120px;
    border-radius: 40px;
    /* Squircle */
    background: var(--color-prestige-dark);
    color: var(--color-prestige-gold);
    font-size: 3rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: 0 20px 40px rgba(17, 22, 34, 0.1);
    border: 4px solid var(--color-prestige-gold);
    font-family: 'Outfit', sans-serif;
    overflow: hidden; /* Clips image to squircle shape */
}

.profile-name-v2 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--google-grey-900);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.profile-email-v2 {
    font-size: 1rem;
    color: var(--google-grey-600);
    font-weight: 500;
}

/* Tabs Redesign */
.tabs-container-v2 {
    max-width: 900px;
    margin: -30px auto 40px;
    background: var(--profile-glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--profile-glass-border);
    padding: 8px;
    border-radius: 24px;
    display: flex;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    z-index: 10;
    position: relative;
}

.tab-pill-v2 {
    padding: 12px 32px;
    border-radius: 18px;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--google-grey-600);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-pill-v2:hover {
    background: rgba(26, 115, 232, 0.05);
    color: var(--google-blue-600);
}

.tab-pill-v2.active {
    background: var(--google-blue-600);
    color: white;
    box-shadow: 0 8px 16px rgba(26, 115, 232, 0.3);
}

/* Stats Cards */
.stats-grid-v2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto 48px;
}

.glass-stat-card {
    background: var(--profile-glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--profile-glass-border);
    border-radius: 32px;
    padding: 32px;
    display: flex;
    align-items: center;
    gap: 24px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.glass-stat-card:hover {
    transform: translateY(-8px);
    background: white;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border-color: var(--google-blue-100);
}

.stat-icon-v2 {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: var(--google-blue-50);
    color: var(--google-blue-600);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon-v2 span {
    font-size: 32px;
    font-variation-settings: 'FILL' 1;
}

.stat-label-v2 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--google-grey-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.stat-value-v2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--google-grey-900);
}

/* Settings Sections */
.dossier-card {
    background: white;
    border: 1px solid var(--google-grey-200);
    border-radius: 32px;
    padding: 40px;
    margin-bottom: 32px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.dossier-card h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.input-v2 {
    width: 100%;
    background: var(--google-grey-50);
    border: 1px solid var(--google-grey-200);
    border-radius: 16px;
    padding: 16px 20px;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s;
    margin-bottom: 12px;
}

.input-v2:focus {
    background: white;
    border-color: var(--google-blue-600);
    box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.1);
    outline: none;
}

.primary-btn-v2 {
    background: var(--google-blue-600);
    color: white;
    border: none;
    border-radius: 16px;
    padding: 16px 32px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 16px rgba(26, 115, 232, 0.2);
}

.primary-btn-v2:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(26, 115, 232, 0.3);
}

/* Profile Content Fade */
.profile-section {
    display: none;
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.profile-section.active {
    display: block;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .profile-hero-v2 {
        padding: 60px 20px 40px;
    }

    .profile-name-v2 {
        font-size: 2rem;
    }

    /* Scrollable pill tabs on mobile */
    .tabs-container-v2 {
        max-width: calc(100% - 32px);
        width: calc(100% - 32px);
        margin-bottom: 24px;
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding: 6px;
        border-radius: 18px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .tabs-container-v2::-webkit-scrollbar {
        display: none;
    }

    .tab-pill-v2 {
        padding: 10px 20px;
        font-size: 0.85rem;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .stats-grid-v2 {
        grid-template-columns: 1fr;
    }

    /* Session cards – icon + text row should stay row, only outer card can stack */
    .glass-stat-card {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 16px !important;
    }

    /* But session inner row should stay horizontal */
    .glass-stat-card > div:first-child {
        flex-direction: row !important;
        align-items: center !important;
    }

    .cert-actions {
        width: 100% !important;
        min-width: auto !important;
    }

    .dossier-card {
        padding: 24px 16px;
        border-radius: 20px;
    }

    /* QR reader responsive fix */
    #qr-reader {
        max-width: 100% !important;
    }

    #start-scan-btn {
        max-width: 100% !important;
    }
}