/* ─────────────────────────────────────────────
     Dashboard General Layout
     ───────────────────────────────────────────── */
.dashboard-wrapper {
    padding: 100px 0;
    position: relative;
    z-index: 2;
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.welcome-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 40px;
}

.welcome-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 3px solid var(--accent-green);
    object-fit: cover;
}

.welcome-title {
    font-size: 1.8rem;
    font-weight: 900;
    margin-bottom: 6px;
}

.welcome-quote {
    color: var(--text-secondary);
    font-style: italic;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.dashboard-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.card-icon {
    font-size: 1.4rem;
}

.icon-yellow { color: var(--accent-yellow); }
.icon-blue { color: var(--accent-blue); }
.icon-green { color: var(--accent-green); }
.icon-orange { color: var(--accent-orange); }

.card-title {
    font-size: 1.2rem;
    font-weight: 800;
}

.card-divider {
    border: 0;
    height: 1px;
    background: var(--border-stroke);
    margin: 20px 0;
}

/* ─────────────────────────────────────────────
     Card 1: Gamification UI
     ───────────────────────────────────────────── */
.level-badge-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.level-indicator {
    font-size: 1.1rem;
    font-weight: 600;
}

.level-indicator strong {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--accent-green);
}

.rank-badge {
    padding: 6px 12px;
    border-radius: 12px;
    color: #ffffff;
    font-weight: 800;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Progress bar styled like Duolingo */
.duo-progress-container {
    width: 100%;
    height: 20px;
    background: rgba(0,0,0,0.08);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
    position: relative;
}

body.dark-theme .duo-progress-container {
    background: rgba(255,255,255,0.08);
}

.duo-progress-bar {
    height: 100%;
    background-color: var(--accent-green);
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.progress-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: rgba(255, 255, 255, 0.2);
}

.xp-numerical-summary {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 600;
}

.streak-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.streak-item {
    background: rgba(0,0,0,0.03);
    border: 1px solid var(--border-stroke);
    border-radius: 16px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.2s ease;
}

body.dark-theme .streak-item {
    background: rgba(255,255,255,0.03);
}

.streak-item:hover {
    transform: scale(1.02);
}

.streak-icon {
    font-size: 1.8rem;
}

.streak-details h4 {
    font-size: 1.4rem;
    font-weight: 900;
}

.streak-details p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ─────────────────────────────────────────────
     Card 2: Subscription & ID
     ───────────────────────────────────────────── */
.member-id-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.04);
    padding: 12px 18px;
    border-radius: 16px;
    border-left: 4px solid var(--accent-blue);
    margin-bottom: 16px;
    font-weight: 700;
}

body.dark-theme .member-id-banner {
    background: rgba(255,255,255,0.04);
}

.member-id-banner .code {
    font-family: monospace;
    font-size: 1.1rem;
    color: var(--accent-blue);
    letter-spacing: 1px;
}

.subscription-tier-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.tier-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 900;
    font-size: 1.1rem;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.free-tier {
    background: linear-gradient(135deg, var(--text-subtle) 0%, var(--text-muted) 100%);
}

.premium-tier {
    background: linear-gradient(135deg, var(--accent-yellow) 0%, var(--accent-orange) 100%);
    animation: goldGlow 3s infinite alternate;
}

@keyframes goldGlow {
    0% { box-shadow: 0 0 5px rgba(255,200,0,0.4); }
    100% { box-shadow: 0 0 20px rgba(255,150,0,0.8); }
}

.expiry-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    justify-content: center;
}

.activity-metric-flex {
    display: flex;
    justify-content: space-around;
}

.metric-block {
    text-align: center;
}

.metric-block .value {
    display: block;
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--accent-blue);
}

.metric-block .label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ─────────────────────────────────────────────
     Card 3: Target Nutrition & Macros
     ───────────────────────────────────────────── */
.calories-indicator-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.calories-circle {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 6px solid var(--accent-green);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1), 0 4px 15px rgba(197, 160, 89,0.2);
}

body.dark-theme .calories-circle {
    box-shadow: inset 0 0 10px rgba(255,255,255,0.05), 0 4px 15px rgba(52,211,153,0.2);
}

.calories-value {
    font-size: 1.8rem;
    font-weight: 900;
}

.calories-lbl {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.macro-bars-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.macro-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.macro-progress-track {
    width: 100%;
    height: 10px;
    background: rgba(0,0,0,0.05);
    border-radius: 5px;
    overflow: hidden;
}

body.dark-theme .macro-progress-track {
    background: rgba(255,255,255,0.05);
}

.macro-progress-fill {
    height: 100%;
    border-radius: 5px;
}

.p-fill { background-color: var(--accent-red); }
.c-fill { background-color: var(--accent-yellow); }
.f-fill { background-color: var(--accent-blue); }

/* ─────────────────────────────────────────────
     Card 4: Leaderboard
     ───────────────────────────────────────────── */
.leaderboard-table-container {
    width: 100%;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th {
    text-align: left;
    padding: 10px;
    color: var(--text-muted);
    font-weight: 800;
    border-bottom: 2px solid var(--border-stroke);
}

body.rtl-layout .leaderboard-table th {
    text-align: right;
}

.leaderboard-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border-stroke);
}

.athlete-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.athlete-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.highlighted-row {
    background-color: rgba(197, 160, 89,0.08);
}

/* Dashboard card hover lift */
.dashboard-card.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

/* Streak badge fire animation */
.streak-badge {
    position: relative;
}

.streak-badge .badge-icon {
    display: inline-block;
    animation: fireFlicker 1.5s infinite alternate;
}

@keyframes fireFlicker {
    0% { transform: scale(1) rotate(-2deg); }
    50% { transform: scale(1.15) rotate(2deg); }
    100% { transform: scale(1.05) rotate(-1deg); }
}

/* XP badge star spin on hover */
.xp-badge:hover .badge-icon {
    animation: starSpin 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes starSpin {
    from { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.3); }
    to { transform: rotate(360deg) scale(1); }
}

/* Avatar ring pulse */
.nav-avatar-circle {
    transition: all 0.3s ease;
}

.nav-avatar-circle:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(197, 160, 89, 0.3);
}

/* Footer glass enhancement — premium rainbow gradient line */
/* Testimonial table row hover */
.leaderboard-table tbody tr {
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.leaderboard-table tbody tr:hover {
    background-color: rgba(197, 160, 89, 0.06);
}

/* transition animations between funnel and dashboard views */
#guest-funnel-view, #client-dashboard-view {
    transition: opacity 0.5s ease, transform 0.5s ease;
}

