/* =========================================================================
 * Dynamflow Store V2 - My Dashboard (account) styles
 * -------------------------------------------------------------------------
 * Loaded only by profile.html. It styles the signed-in dashboard: identity
 * card, the section navigation, order list, the confirmed-order chart,
 * the wishlist panel and the settings / danger-zone forms.
 *
 * The palette matches the template: --bs-primary is #0189FC and
 * --bs-secondary is #4928E6 (declared in css/style.css).
 * ========================================================================= */

.df-dash {
    --df-ink: #10203c;
    --df-soft: #f4f7fd;
    --df-line: rgba(16, 32, 60, .09);
    --df-muted: #6b7a90;
    --df-primary: #0189FC;
    --df-secondary: #4928E6;
}

/* ------------------------------------------------------------------ */
/* Section navigation + panel switching                                */
/* ------------------------------------------------------------------ */
.df-nav {
    background: #fff;
    border: 1px solid var(--df-line);
    box-shadow: 0 12px 28px rgba(16, 32, 60, .06);
    padding: .5rem;
    display: flex;
    flex-direction: column;
    gap: .25rem;
    position: sticky;
    top: 1rem;
}

.df-nav-item {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--df-ink, #10203c);
    font-weight: 600;
    font-size: .95rem;
    text-align: left;
    padding: .75rem .9rem;
    border-radius: .8rem;
    display: flex;
    align-items: center;
    gap: .7rem;
    width: 100%;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.df-nav-item i {
    width: 1.15rem;
    text-align: center;
}

.df-nav-item:hover {
    background: rgba(1, 137, 252, .08);
    color: var(--df-primary, #0189FC);
}

.df-nav-item.is-active {
    background: linear-gradient(135deg, #0189FC, #4928E6);
    color: #fff !important;
    box-shadow: 0 10px 22px rgba(1, 137, 252, .28);
}

.df-nav-item .df-nav-count {
    margin-left: auto;
    background: rgba(16, 32, 60, .08);
    color: inherit;
    font-size: .72rem;
    font-weight: 700;
    border-radius: 999px;
    padding: .1rem .5rem;
    line-height: 1.5;
}

.df-nav-item.is-active .df-nav-count {
    background: rgba(255, 255, 255, .28);
}

/* The panel wrapper */
.df-panel {
    animation: dfFade .25s ease both;
}

@keyframes dfFade {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------------ */
/* Identity card                                                       */
/* ------------------------------------------------------------------ */
.df-identity {
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--df-line);
    box-shadow: 0 12px 28px rgba(16, 32, 60, .06);
}

.df-identity-top {
    background: linear-gradient(135deg, #0189FC, #4928E6);
    color: #fff;
    text-align: center;
    padding: 1.9rem 1.25rem 1.6rem;
}

.df-identity-top .df-avatar {
    width: 74px;
    height: 74px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: .5px;
    background: rgba(255, 255, 255, .2);
    border: 2px solid rgba(255, 255, 255, .65);
    margin-bottom: .7rem;
}

.df-identity-top h5 {
    font-weight: 700;
}

.df-identity-top p {
    opacity: .9;
    font-size: .85rem;
    word-break: break-word;
}

.df-identity-top .df-since {
    opacity: .78;
    font-size: .76rem;
    margin-top: .35rem;
}

.df-identity-body {
    padding: 1.1rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.df-identity-row {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    font-size: .9rem;
    color: var(--df-ink, #10203c);
}

.df-identity-top + .df-identity .df-avatar { }

.df-identity-top .df-dot {
    display: inline-block;
    width: .5rem;
    height: .5rem;
    border-radius: 50%;
    background: #34d399;
    margin-right: .35rem;
    vertical-align: middle;
}

.df-identity-links {
    border-top: 1px solid var(--df-line);
    padding: .4rem;
    display: flex;
    flex-direction: column;
}

.df-identity-links a,
.df-identity-links button {
    appearance: none;
    border: 0;
    background: transparent;
    text-align: left;
    font-weight: 600;
    font-size: .92rem;
    color: var(--df-ink);
    padding: .6rem .7rem;
    border-radius: .65rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    cursor: pointer;
    text-decoration: none;
}

.df-identity-links a:hover,
.df-identity-links button:hover {
    background: var(--df-soft);
    color: var(--df-primary);
}

.df-identity-links .df-danger {
    color: #d64545;
}

/* ------------------------------------------------------------------ */
/* Cards                                                               */
/* ------------------------------------------------------------------ */
.df-card {
    background: #fff;
    border: 1px solid var(--df-line);
    border-radius: 1rem;
    box-shadow: 0 12px 28px rgba(16, 32, 60, .05);
    padding: 1.4rem 1.4rem 1.5rem;
}

.df-card + .df-card {
    margin-top: 1.25rem;
}

.df-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--df-ink);
    margin: 0 0 .25rem;
}

.df-card-sub {
    color: var(--df-muted, #6b7a90);
    font-size: .85rem;
    margin: 0 0 1rem;
}

.df-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: 1rem;
}

/* ------------------------------------------------------------------ */
/* Stat tiles                                                          */
/* ------------------------------------------------------------------ */
.df-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .9rem;
    margin-bottom: 1.25rem;
}

@media (min-width: 992px) {
    .df-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.df-stat {
    background: #fff;
    border: 1px solid var(--df-line);
    border-radius: 1rem;
    box-shadow: 0 10px 22px rgba(16, 32, 60, .05);
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.df-stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}

.df-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: .8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    color: #fff;
}

.df-icon-blue { background: linear-gradient(135deg, #0189FC, #2a6df5); }
.df-stat > .df-stat-arrow,
.df-stat.is-blue { border-color: transparent; }

.df-icon-violet { background: linear-gradient(135deg, #7c4dff, #4928E6); }
.df-icon-green { background: linear-gradient(135deg, #20c997, #0aa06e); }
.df-icon-red { background: linear-gradient(135deg, #ff6b6b, #d64545); }
.df-icon-amber { background: linear-gradient(135deg, #f6b73c, #e08b00); }

.df-stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--df-ink);
}

.df-stat-label {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--df-muted, #6b7a90);
    font-weight: 600;
}

/* ------------------------------------------------------------------ */
/* Bar chart (orders confirmed / by month)                             */
/* ------------------------------------------------------------------ */
.df-chart {
    display: flex;
    align-items: flex-end;
    gap: .6rem;
    height: 180px;
    padding-top: .5rem;
}

.df-chart-col {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .4rem;
    height: 100%;
    justify-content: flex-end;
}

.df-chart-track {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    flex: 1;
}

.df-chart-bar {
    width: min(70%, 46px);
    border-radius: .5rem .5rem .25rem .25rem;
    background: linear-gradient(180deg, #4aa8ff, #0189FC);
    min-height: 6px;
    transition: height .5s ease;
    position: relative;
}

.df-chart-col.is-empty .df-chart-bar {
    background: rgba(16, 32, 60, .12);
    box-shadow: none;
}

.df-chart-bar span {
    position: absolute;
    top: -1.35rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: .72rem;
    font-weight: 700;
    color: var(--df-ink);
}

.df-chart-label {
    font-size: .72rem;
    color: var(--df-muted, #6b7a90);
    font-weight: 600;
    white-space: nowrap;
}

/* The current month is always the first bar and is highlighted. */
.df-chart-col.is-current .df-chart-label {
    color: var(--df-ink, #16203c);
    font-weight: 700;
}

.df-chart-col.is-current:not(.is-empty) .df-chart-bar {
    background: linear-gradient(180deg, #0189FC, #4928E6);
    box-shadow: 0 6px 16px rgba(1, 137, 252, .32);
}

/* ------------------------------------------------------------------ */
/* Order cards                                                         */
/* ------------------------------------------------------------------ */
.df-order {
    background: #fff;
    border: 1px solid var(--df-line);
    border-radius: 1rem;
    box-shadow: 0 8px 20px rgba(16, 32, 60, .05);
    margin-bottom: 1rem;
    overflow: hidden;
}

.df-order-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    padding: .95rem 1.1rem;
    background: var(--df-soft, #f4f7fd);
    border-bottom: 1px solid var(--df-line);
}

.df-order-num {
    font-weight: 800;
    color: var(--df-ink);
    font-size: 1rem;
}

/* Status / payment pills on an order card. Bootstrap 5.0 has no `text-bg-*`
 * helper, so these use `bg-*` + an explicit text colour and a hairline
 * border to keep every badge visible on the pale header. */
.df-order-head .badge {
    font-weight: 700;
    letter-spacing: .01em;
    border: 1px solid rgba(0, 0, 0, .12);
}

.df-order-date {
    color: var(--df-muted, #6b7a90);
    font-size: .8rem;
}

.df-order-body {
    padding: 1.05rem 1.1rem 1.15rem;
}

.df-order-items {
    border-top: 1px solid var(--df-line);
    margin-top: .85rem;
    padding-top: .6rem;
}

.df-order-line {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .35rem 0;
    font-size: .92rem;
}

.df-order-total {
    display: flex;
    justify-content: space-between;
    font-weight: 800;
    color: var(--df-ink);
    border-top: 1px solid var(--df-line);
    margin-top: .5rem;
    padding-top: .6rem;
}

/* ------------------------------------------------------------------ */
/* Order progress tracker (top of the Orders panel)                    */
/* ------------------------------------------------------------------ */
.df-tracker {
    background: #fff;
    border: 1px solid var(--df-line);
    border-radius: 1rem;
    box-shadow: 0 8px 20px rgba(16, 32, 60, .05);
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
}

.df-tracker-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    margin-bottom: .35rem;
}

.df-tracker-head .badge {
    font-weight: 700;
    border: 1px solid rgba(0, 0, 0, .12);
}

.df-tracker-items {
    border-top: 1px solid var(--df-line);
    margin-top: .7rem;
    padding-top: .5rem;
}

/* ------------------------------------------------------------------ */
/* Status timeline - a real visual progress bar                        */
/* ------------------------------------------------------------------ */
.df-track {
    --df-track-line: rgba(16, 32, 60, .16);
    --df-track-primary: var(--df-primary, #0189FC);
    --df-track-end: var(--df-secondary, #4928E6);
    position: relative;
    margin: .9rem 0 .4rem;
}

/* The unfilled connecting line runs behind the milestone circles, from the
 * centre of the first circle to the centre of the last one. With six equal
 * steps that is 1/12 in from each edge. */
.df-track-rail {
    position: absolute;
    top: 12px;
    left: calc(100% / 12);
    right: calc(100% / 12);
    height: 4px;
    border-radius: 999px;
    background: var(--df-track-line);
    overflow: hidden;
}

.df-track-rail-fill {
    display: block;
    height: 100%;
    width: var(--df-fill, 0%);
    border-radius: 999px;
    background: linear-gradient(90deg, var(--df-track-primary), var(--df-track-end));
    transition: width .55s cubic-bezier(.4, 0, .2, 1);
}

.df-track-steps {
    position: relative;
    z-index: 1;
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
}

.df-track-step {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: .4rem;
}

.df-track-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--df-track-line);
    color: #8695ab;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1;
    transition: background .35s ease, border-color .35s ease, color .35s ease,
        box-shadow .35s ease, transform .35s ease;
}

.df-track-label {
    font-size: .72rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--df-muted, #6b7a90);
    transition: color .35s ease;
}

/* Milestones the order has reached: filled with the brand colour + a check */
.df-track-step.is-done .df-track-dot,
.df-track-step.is-active .df-track-dot {
    background: var(--df-track-primary);
    border-color: var(--df-track-primary);
    color: #fff;
}

.df-track-step.is-done .df-track-label,
.df-track-step.is-active .df-track-label {
    color: var(--df-ink, #10203c);
}

/* The stage the order is sitting at right now */
.df-track-step.is-active .df-track-dot {
    box-shadow: 0 0 0 5px rgba(1, 137, 252, .18);
    transform: scale(1.06);
}

.df-track-step.is-active .df-track-label {
    color: var(--df-track-primary);
    font-weight: 700;
}

/* Cancelled orders */
.df-track.is-cancelled {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem 1rem;
}

.df-track-cancel {
    display: flex;
    align-items: center;
    gap: .65rem;
}

.df-track.is-cancelled .df-track-dot {
    background: #d64545;
    border-color: #d64545;
    color: #fff;
}

.df-track.is-cancelled .df-track-label {
    color: #d64545;
    font-weight: 700;
    font-size: .85rem;
}

.df-track-note {
    font-size: .8rem;
    color: var(--df-muted, #6b7a90);
}

/* Vertical timeline on small screens, with the connecting line kept visible */
@media (max-width: 767.98px) {
    .df-track-steps {
        flex-direction: column;
    }

    .df-track-step {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        text-align: left;
        gap: .9rem;
        min-height: 46px;
    }

    .df-track-rail {
        top: 21px;
        bottom: 21px;
        left: 13px;
        right: auto;
        width: 4px;
        height: auto;
    }

    .df-track-rail-fill {
        width: 100%;
        height: var(--df-fill, 0%);
        background: linear-gradient(180deg, var(--df-track-primary), var(--df-track-end));
        transition: height .55s cubic-bezier(.4, 0, .2, 1);
    }

    .df-track-step.is-active .df-track-dot {
        transform: none;
    }
}

/*** Billing/checkout progress bar ***/
.dynamflow-billing-bar {
    position: relative;
    height: 8px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}
.dynamflow-billing-bar__fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--bs-primary), #4f46e5);
    width: 0;
    transition: width 0.4s ease;
}
.dynamflow-billing-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
}
.dynamflow-billing-step__dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 6px;
    transition: all 0.3s ease;
}
.dynamflow-billing-step.is-active .dynamflow-billing-step__dot {
    background: var(--bs-primary);
    color: #fff;
}
.dynamflow-billing-step.is-done .dynamflow-billing-step__dot {
    background: #10b981;
    color: #fff;
}
.dynamflow-billing-step__label {
    font-size: 12px;
    color: #6b7280;
}
.dynamflow-billing-step.is-active .dynamflow-billing-step__label,
.dynamflow-billing-step.is-done .dynamflow-billing-step__label {
    color: #111827;
    font-weight: 600;
}

/* ------------------------------------------------------------------ */
/* Filters + search                                                    */
/* ------------------------------------------------------------------ */
.df-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    align-items: center;
}

.df-pill {
    appearance: none;
    border: 1px solid var(--df-line);
    background: #fff;
    color: var(--df-ink);
    font-weight: 600;
    font-size: .82rem;
    padding: .4rem .85rem;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.df-pill:hover { border-color: var(--df-primary); color: var(--df-primary); }

.df-pill.is-active {
    background: linear-gradient(135deg, #0189FC, #4928E6);
    border-color: transparent;
    color: #fff;
}

.df-pill .badge {
    background: rgba(255, 255, 255, .28);
}

.df-search {
    position: relative;
    flex: 1 1 200px;
    min-width: 180px;
}

.df-search input {
    width: 100%;
    border: 1px solid var(--df-line);
    border-radius: 999px;
    padding: .5rem .9rem .5rem 2.2rem;
    font-size: .88rem;
    outline: none;
}

.df-search input:focus { border-color: var(--df-primary); }

.df-search i {
    position: absolute;
    left: .85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--df-muted);
    font-size: .85rem;
}

.df-empty {
    text-align: center;
    padding: 2.4rem 1rem;
    color: var(--df-muted, #6b7a90);
}

.df-empty i {
    font-size: 2rem;
    color: rgba(1, 137, 252, .5);
    display: block;
    margin-bottom: .6rem;
}

/* ------------------------------------------------------------------ */
/* Forms                                                               */
/* ------------------------------------------------------------------ */
.df-form .form-control,
.df-form .form-select {
    border-radius: .7rem;
    border-color: rgba(16, 32, 60, .16);
}

.df-label {
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--df-muted, #6b7a90);
    margin-bottom: .3rem;
}

.df-save {
    background: linear-gradient(135deg, #0189FC, #4928E6);
    border: 0;
    color: #fff;
    font-weight: 700;
    border-radius: 999px;
    padding: .8rem 1.6rem;
}

.df-save:hover { color: #fff; filter: brightness(1.05); }

.df-danger {
    border: 1px solid rgba(214, 69, 69, .35);
    background: rgba(214, 69, 69, .05);
    border-radius: 1rem;
    padding: 1.1rem 1.2rem;
}

.df-danger h5 { color: #b83b3b; font-weight: 700; }

.btn-df-danger {
    background: #d64545;
    border: 0;
    color: #fff;
    font-weight: 700;
    border-radius: 999px;
    padding: .7rem 1.4rem;
}

.btn-df-danger:hover { color: #fff; background: #c03a3a; }

/* ------------------------------------------------------------------ */
/* Guest state                                                        */
/* ------------------------------------------------------------------ */
.df-guest-note {
    background: linear-gradient(135deg, #eef5ff, #f2eeff);
    border: 1px solid rgba(1, 137, 252, .2);
    border-radius: 1rem;
    padding: 1rem 1.1rem;
    display: flex;
    gap: .85rem;
    align-items: flex-start;
}

.df-guest-note i { font-size: 1.4rem; color: var(--df-primary, #0189FC); }

/* ------------------------------------------------------------------ */
/* Header avatar chip (used on every page)                             */
/* ------------------------------------------------------------------ */
.df-user-chip {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}

.df-user-chip .df-chip-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0189FC, #4928E6);
    color: #fff;
    font-weight: 700;
    font-size: .8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.df-user-chip .df-chip-text {
    line-height: 1.1;
    font-size: .8rem;
    font-weight: 600;
}

.df-user-chip .df-chip-text small {
    display: block;
    font-weight: 500;
    color: var(--df-muted, #6b7a90);
    font-size: .72rem;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */
@media (max-width: 991.98px) {
    .df-nav {
        flex-direction: row;
        flex-wrap: wrap;
        overflow-x: visible;
        position: static;
        gap: .4rem;
        padding: .4rem;
        max-width: 100%;
        -webkit-overflow-scrolling: touch;
    }

    .df-nav::-webkit-scrollbar { display: none; }

    .df-nav-item {
        white-space: nowrap;
        flex: 0 1 auto;
        width: auto;
        padding: .6rem .85rem;
        font-size: .88rem;
    }

    .df-nav-item .df-nav-count { margin-left: .3rem; }
}

@media (max-width: 575.98px) {
    .df-chart { height: 150px; gap: .35rem; }
    .df-chart-bar { width: min(85%, 34px); }
    .df-stat-value { font-size: 1.3rem; }
    .df-card { padding: 1.1rem 1rem 1.2rem; }
}

@media (min-width: 992px) {
    .df-panel-inner {
        max-width: 100%;
    }
}
