/**
 * Dashboard (Tableau de bord) styles.
 *
 * Kept in a dedicated file to load only on the dashboard page.
 *
 * @package light
 */

.na-dashboard-page .na-site-header,
.na-dashboard-page .na-sidebar-menu,
.na-dashboard-page .na-site-footer {
    display: none !important;
}

.na-dashboard {
    padding: 0;
}

.na-db-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 300px 1fr;
    background:
        radial-gradient(
            1200px 700px at 20% 0%,
            rgba(67, 200, 72, 0.1),
            transparent 60%
        ),
        radial-gradient(
            1000px 600px at 90% 20%,
            rgba(56, 189, 248, 0.1),
            transparent 55%
        ),
        #0b1220;
}

.na-db-sidebar {
    border-right: 1px solid rgba(148, 163, 184, 0.15);
    background: rgba(2, 6, 23, 0.35);
    backdrop-filter: blur(10px);
    padding: 22px 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 22px;
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    position: sticky;
    top: 0;
    align-self: start;
}

.na-db-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #e2e8f0;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.na-db-brand-logo {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: block;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.na-db-brand-text {
    font-family:
        "Plus Jakarta Sans",
        "Inter",
        system-ui,
        -apple-system,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;
    font-size: 16px;
}

.na-db-nav {
    margin-top: 18px;
}

.na-db-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
}

.na-db-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px;
    border-radius: 12px;
    text-decoration: none;
    color: #cbd5e1;
    transition:
        background-color 160ms ease,
        color 160ms ease;
}

.na-db-nav-link:hover {
    color: #43c848;
    background: rgba(67, 200, 72, 0.1);
}

.na-db-nav-link.is-active {
    color: #e2e8f0;
    background: rgba(148, 163, 184, 0.12);
}

.na-db-nav-link.is-disabled {
    opacity: 0.5;
    color: #6b7280;
    cursor: not-allowed;
    pointer-events: none;
}

.na-db-nav-link.is-disabled:hover {
    color: #6b7280;
    background: transparent;
}

.na-db-nav-icon {
    color: currentColor;
    opacity: 0.95;
    flex: 0 0 auto;
}

.na-db-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 12px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.na-db-avatar {
    text-decoration: none;
    display: block;
    flex: 0 0 auto;
}

.na-db-avatar img {
    border-radius: 999px;
    display: block;
    transition: opacity 160ms ease;
}

.na-db-avatar:hover img {
    opacity: 0.85;
}

.na-db-profile-name {
    color: #e2e8f0;
    font-weight: 700;
    font-size: 14px;
    line-height: 1.1;
    text-decoration: none;
    display: block;
    transition: color 160ms ease;
}

.na-db-profile-name:hover {
    color: #43c848;
}

.na-db-profile-link {
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #cbd5e1;
    font-size: 13px;
}

.na-db-profile-link:hover {
    color: #43c848;
}

.na-db-upgrade {
    margin-top: 12px;
    width: 100%;
}

.na-dashboard-page .na-db-upgrade.na-btn-primary:hover {
    transform: scale(1.02) !important;
}

.na-db-main {
    padding: 26px 26px;
}

.na-db-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
    gap: 18px;
    align-items: start;
}

.na-db-card {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
}

.na-db-welcome {
    padding: 6px 4px 2px;
}

.na-db-welcome-title {
    margin: 0 0 10px;
    color: #e2e8f0;
    font-size: 34px;
    line-height: 1.05;
    letter-spacing: -0.03em;
    font-family:
        "Plus Jakarta Sans",
        "Inter",
        system-ui,
        -apple-system,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;
}

.na-db-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.na-db-h2 {
    margin: 0;
    color: #e2e8f0;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.na-db-paragraph {
    margin: 0;
    color: rgba(226, 232, 240, 0.85);
    font-size: 13px;
    line-height: 1.45;
}

.na-db-experts-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.na-db-expert-card {
    position: relative;
    display: grid;
    grid-template-rows: 1fr auto;
    text-decoration: none;
    border-radius: 18px;
    overflow: hidden;
    min-height: 225px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(2, 6, 23, 0.25);
}

.na-db-expert-card:hover {
    border-color: rgba(67, 200, 72, 0.3);
}

.na-db-expert-media {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.12),
        rgba(255, 255, 255, 0.02)
    );
}

.na-db-expert-card.is-green .na-db-expert-media {
    background: radial-gradient(
        700px 350px at 20% 20%,
        rgba(67, 200, 72, 0.55),
        rgba(2, 6, 23, 0.1) 60%
    );
}

.na-db-expert-card.is-orange .na-db-expert-media {
    background: radial-gradient(
        700px 350px at 20% 20%,
        rgba(251, 146, 60, 0.55),
        rgba(2, 6, 23, 0.1) 60%
    );
}

.na-db-expert-card.is-purple .na-db-expert-media {
    background: radial-gradient(
        700px 350px at 20% 20%,
        rgba(167, 139, 250, 0.55),
        rgba(2, 6, 23, 0.1) 60%
    );
}

.na-db-expert-label {
    padding: 12px 14px;
    color: #e2e8f0;
    font-weight: 800;
    font-size: 13px;
}

.na-db-shortcuts {
    display: grid;
    gap: 14px;
}

.na-db-shortcut {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 18px;
    border-radius: 18px;
    text-decoration: none;
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(2, 6, 23, 0.25);
}

.na-db-shortcut:hover {
    border-color: rgba(67, 200, 72, 0.25);
}

.na-db-shortcut-ico {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(67, 200, 72, 0.12);
    border: 1px solid rgba(67, 200, 72, 0.2);
}

.na-db-shortcut-svg {
    width: 22px;
    height: 22px;
    color: #43c848;
}

.na-db-shortcut-text {
    font-weight: 800;
    font-size: 14px;
}

.na-db-today {
    display: grid;
    gap: 10px;
}

.na-db-today-title {
    color: #e2e8f0;
    font-weight: 800;
    font-size: 13px;
}

.na-db-today-desc {
    color: rgba(203, 213, 225, 0.78);
    font-size: 13px;
    line-height: 1.4;
}

.na-db-today-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.na-db-today-suggestion {
    background: rgba(67, 200, 72, 0.12);
    color: #43C848;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(67, 200, 72, 0.25);
}

.na-db-chips {
    display: grid;
    gap: 10px;
}

.na-db-chip.na-btn {
    width: 100%;
    min-height: 42px;
    padding: 12px 18px;
    border-radius: 14px !important;
    justify-content: center;
}

.na-db-stocks {
    display: grid;
    gap: 10px;
}

.na-db-stock {
    display: block;
    text-decoration: none;
    padding: 14px 14px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(2, 6, 23, 0.25);
    color: #e2e8f0;
}

.na-db-stock:hover {
    border-color: rgba(67, 200, 72, 0.25);
}

.na-db-stock-title {
    font-weight: 800;
    font-size: 13px;
    margin-bottom: 4px;
}

.na-db-stock-desc {
    color: rgba(203, 213, 225, 0.8);
    font-size: 13px;
    line-height: 1.35;
}

/* Legacy styles kept for backward compatibility (no longer used in template) */
.na-db-timeline {
    display: grid;
    gap: 10px;
}

.na-db-meal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(2, 6, 23, 0.25);
}

.na-db-meal-past {
    opacity: 0.7;
    filter: saturate(0.9);
}

.na-db-meal-now {
    background: rgba(67, 200, 72, 0.1);
    border-color: rgba(67, 200, 72, 0.22);
    display: grid;
    grid-template-columns: 90px 1fr;
    align-items: stretch;
}

.na-db-meal-media {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.15);
    background: rgba(15, 23, 42, 0.55);
}

.na-db-meal-img {
    width: 100%;
    height: 100%;
    min-height: 72px;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.12),
        rgba(255, 255, 255, 0.02)
    );
}

.na-db-meal-body {
    display: grid;
    gap: 6px;
}

.na-db-meal-title {
    color: #e2e8f0;
    font-weight: 800;
    font-size: 14px;
}

.na-db-meal-meta {
    color: rgba(203, 213, 225, 0.75);
    font-size: 13px;
}

.na-db-meal-desc {
    color: rgba(226, 232, 240, 0.92);
    font-size: 13px;
}

.na-db-badge {
    color: rgba(226, 232, 240, 0.85);
    font-size: 12px;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.na-db-badge-muted {
    opacity: 0.85;
}

.na-db-meal-future {
    background: rgba(2, 6, 23, 0.18);
    border-style: dashed;
    opacity: 0.9;
}

.na-db-macros {
    display: grid;
    margin-bottom: 12px;
}

.na-db-macro-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.na-db-macro-label {
    color: #e2e8f0;
    font-weight: 700;
    font-size: 13px;
}

.na-db-macro-value {
    color: rgba(203, 213, 225, 0.75);
    font-size: 12px;
}

.na-db-progress {
    margin-top: 8px;
    height: 8px;
    background: rgba(148, 163, 184, 0.12);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.14);
}

.na-db-progress-bar {
    display: block;
    height: 100%;
    border-radius: 999px;
}

.na-db-progress-bar.is-green {
    background: #43c848;
}
.na-db-progress-bar.is-blue {
    background: #60a5fa;
}
.na-db-progress-bar.is-orange {
    background: #fb923c;
}
.na-db-progress-bar.is-yellow {
    background: #facc15;
}
.na-db-progress-bar.is-cyan {
    background: #22d3ee;
}

.na-db-muted {
    margin: 12px 0 0;
    color: rgba(203, 213, 225, 0.78);
    font-size: 13px;
}

.na-db-chat {
    display: grid;
    gap: 12px;
}

.na-db-chat-bubble {
    background: rgba(2, 6, 23, 0.3);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 16px;
    padding: 12px 12px;
    position: relative;
}

.na-db-chat-bubble::after {
    content: "";
    position: absolute;
    left: 16px;
    bottom: -6px;
    width: 12px;
    height: 12px;
    transform: rotate(45deg);
    background: rgba(2, 6, 23, 0.3);
    border-right: 1px solid rgba(148, 163, 184, 0.14);
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.na-db-chat-text {
    margin: 0;
    color: rgba(226, 232, 240, 0.92);
    font-size: 13px;
    line-height: 1.4;
}

.na-db-input {
    width: 100%;
    padding: 12px 12px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(2, 6, 23, 0.3);
    color: #e2e8f0;
    outline: none;
}

.na-db-input::placeholder {
    color: rgba(203, 213, 225, 0.6);
}

.na-db-input:focus {
    border-color: rgba(67, 200, 72, 0.45);
    box-shadow: 0 0 0 4px rgba(67, 200, 72, 0.12);
}

.na-db-quick {
    display: grid;
    gap: 10px;
}

.na-db-quick-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: rgba(226, 232, 240, 0.92);
    font-size: 13px;
    font-weight: 700;
}

.na-db-quick-row-alert .na-db-quick-right {
    color: #fbbf24;
}

.na-db-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================================================
 * Profile Completion Widget - Animated Circular Progress with Gradient
 * ============================================================================ */
.na-profile-completion {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: linear-gradient(
        135deg,
        rgba(67, 200, 72, 0.08),
        rgba(56, 189, 248, 0.06)
    );
    border: 1px solid rgba(67, 200, 72, 0.18);
    border-radius: 16px;
}

.na-profile-completion-ring {
    position: relative;
    flex-shrink: 0;
    width: 64px;
    height: 64px;
}

.na-profile-completion-ring svg {
    width: 100%;
    border-radius: 100%;
    height: 100%;
    transform: rotate(-90deg);
    filter: drop-shadow(0 4px 12px rgba(67, 200, 72, 0.25));
}

.na-profile-completion-ring circle {
    fill: none;
    stroke-width: 5;
    stroke-linecap: round;
}

.na-profile-completion-ring .ring-bg {
    stroke: rgba(148, 163, 184, 0.15);
}

.na-profile-completion-ring .ring-progress {
    stroke: url(#profile-gradient);
    stroke-dasharray: 157;
    stroke-dashoffset: 157;
    animation:
        ring-fill 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards,
        ring-pulse 2s ease-in-out 1.5s infinite;
}

/* Animation to fill the ring based on CSS custom property */
@keyframes ring-fill {
    from {
        stroke-dashoffset: 157;
    }
    to {
        stroke-dashoffset: var(--ring-offset, 157);
    }
}

@keyframes ring-pulse {
    0%,
    100% {
        filter: drop-shadow(0 0 4px rgba(67, 200, 72, 0.4));
    }
    50% {
        filter: drop-shadow(0 0 10px rgba(67, 200, 72, 0.7));
    }
}

.na-profile-completion-percent {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    color: #e2e8f0;
    letter-spacing: -0.02em;
}

.na-profile-completion-content {
    flex: 1;
    min-width: 0;
}

.na-profile-completion-title {
    margin: 0 0 4px;
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
}

.na-profile-completion-desc {
    margin: 0;
    color: rgba(203, 213, 225, 0.75);
    font-size: 12px;
    line-height: 1.4;
}

.na-profile-completion-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    color: #43c848;
    background: rgba(67, 200, 72, 0.12);
    border: 1px solid rgba(67, 200, 72, 0.22);
    border-radius: 8px;
    text-decoration: none;
    transition: all 180ms ease;
}

.na-profile-completion-link:hover {
    background: rgba(67, 200, 72, 0.18);
    border-color: rgba(67, 200, 72, 0.35);
    transform: translateY(-1px);
}

.na-profile-completion-link svg {
    width: 12px;
    height: 12px;
}

/* Variant: Compact (for preferences page alert) */
.na-profile-completion--compact {
    padding: 14px;
    margin-bottom: 18px;
}

.na-profile-completion--compact .na-profile-completion-ring {
    width: 52px;
    height: 52px;
}

.na-profile-completion--compact .na-profile-completion-percent {
    font-size: 12px;
}

/* Variant: Complete state */
.na-profile-completion--complete {
    background: linear-gradient(
        135deg,
        rgba(67, 200, 72, 0.12),
        rgba(67, 200, 72, 0.05)
    );
    border-color: rgba(67, 200, 72, 0.25);
}

.na-profile-completion--complete .ring-progress {
    animation: ring-complete-glow 3s ease-in-out infinite;
}

@keyframes ring-complete-glow {
    0%,
    100% {
        filter: drop-shadow(0 0 6px rgba(67, 200, 72, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 14px rgba(67, 200, 72, 0.85));
    }
}

/* Animation for the percentage counter entrance */
.na-profile-completion[data-animate] .na-profile-completion-percent {
    animation: percent-entrance 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.4s forwards;
    opacity: 0;
}

@keyframes percent-entrance {
    from {
        opacity: 0;
        transform: scale(0.6);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Percentage text glow effect when animated */
.na-profile-completion[data-animate] .na-profile-completion-percent::after {
    content: "";
    position: absolute;
    inset: -4px;
    background: radial-gradient(
        circle,
        rgba(67, 200, 72, 0.3) 0%,
        transparent 70%
    );
    border-radius: 50%;
    z-index: -1;
    animation: percent-glow 2s ease-in-out 1.5s infinite;
    opacity: 0;
}

@keyframes percent-glow {
    0%,
    100% {
        opacity: 0;
        transform: scale(0.9);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* Shimmer effect on ring */
.na-profile-completion-ring::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        rgba(255, 255, 255, 0.08) 45deg,
        transparent 90deg
    );
    animation: ring-shimmer 3s linear infinite;
    pointer-events: none;
}

@keyframes ring-shimmer {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Mobile toggle and overlay - hidden by default on desktop, removed from document flow */
.na-db-mobile-toggle,
.na-db-sidebar-overlay {
    display: none;
    position: fixed;
}

@media (max-width: 1100px) {
    .na-db-shell {
        grid-template-columns: 260px 1fr;
    }
}

@media (max-width: 980px) {
    .na-db-shell {
        grid-template-columns: 1fr;
    }

    .na-db-sidebar {
        position: fixed;
        left: -300px;
        top: 0;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        border-right: 1px solid rgba(148, 163, 184, 0.15);
        border-bottom: none;
    }

    .na-db-sidebar.is-open {
        left: 0;
    }

    /* Mobile toggle button */
    .na-db-mobile-toggle {
        display: block !important;
        position: fixed;
        top: 20px;
        left: 20px;
        z-index: 1001;
        background: rgba(15, 23, 42, 0.9);
        border: 1px solid rgba(148, 163, 184, 0.2);
        border-radius: 12px;
        padding: 12px;
        color: #e2e8f0;
        cursor: pointer;
        transition: all 0.2s ease;
        backdrop-filter: blur(10px);
    }

    .na-db-mobile-toggle:hover {
        background: rgba(67, 200, 72, 0.1);
        border-color: rgba(67, 200, 72, 0.3);
        color: #43c848;
    }

    .na-db-mobile-toggle svg {
        width: 20px;
        height: 20px;
        display: block;
    }

    /* Overlay when sidebar is open on mobile */
    .na-db-sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        backdrop-filter: blur(2px);
    }

    .na-db-sidebar-overlay.is-active {
        display: block;
    }

    .na-db-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1440px) {
    .na-db-expert-card {
        min-height: 300px;
    }
}

/* ============================================================================
 * Expert Cards - Image/Video Hover Effect
 * ============================================================================ */
.na-db-expert-media {
    position: relative;
    overflow: hidden;
    display: block;
}

.na-expert-image,
.na-expert-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.4s ease;
}

.na-expert-image {
    opacity: 1;
    z-index: 1;
}

.na-expert-video {
    opacity: 0;
    z-index: 2;
}

.na-db-expert-card:hover .na-expert-image {
    opacity: 0;
}

.na-db-expert-card:hover .na-expert-video {
    opacity: 1;
}

/* Remove gradient backgrounds when using real images */
.na-db-expert-card.is-green .na-db-expert-media:has(img),
.na-db-expert-card.is-orange .na-db-expert-media:has(img),
.na-db-expert-card.is-purple .na-db-expert-media:has(img) {
    background: transparent;
}
