/* =========================================================
   SAFFRON MINI APP
   Pink / Purple / Gold Theme
   ========================================================= */

@font-face {
    font-family: "Vazir";
    src: url("../assets/fonts/Vazir-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Vazir";
    src: url("../assets/fonts/Vazir-Medium.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Vazir";
    src: url("../assets/fonts/Vazir-Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}


/* =========================================================
   VARIABLES
   ========================================================= */

:root {
    /* Main palette */
    --purple-950: #2a1238;
    --purple-900: #38154d;
    --purple-800: #4b1d68;
    --purple-700: #612582;
    --purple-600: #762f99;
    --purple-500: #8e3eae;
    --purple-400: #a65bc1;

    /* Pink */
    --pink-50: #fff7fc;
    --pink-100: #fcecf8;
    --pink-200: #f8d9ef;
    --pink-300: #f1b9df;
    --pink-400: #e894cb;

    /* Gold */
    --gold-300: #f2d47b;
    --gold-400: #dfb94f;
    --gold-500: #c99b2e;
    --gold-600: #ad7e1e;
    --gold-700: #8b6418;
    --gold-custom: #ffd700;


    /* Neutral */
    --white: #ffffff;
    --gray-50: #faf9fb;
    --gray-100: #f3f1f5;
    --gray-200: #e7e3ea;
    --gray-300: #d7d1dc;
    --gray-500: #756d7c;
    --gray-600: #5c5364;
    --gray-700: #453c4d;
    --gray-900: #211a27;

    /* Semantic */
    --success: #218a68;
    --success-bg: #eaf8f2;

    --warning: #a87516;
    --warning-bg: #fff7df;

    --danger: #b63c55;
    --danger-bg: #fff0f3;

    /* Layout */
    --app-width: 480px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;

    /* Shadows */
    --shadow-sm:
        0 2px 8px rgba(55, 25, 70, 0.05);

    --shadow-md:
        0 6px 20px rgba(55, 25, 70, 0.08);

    --shadow-lg:
        0 12px 35px rgba(55, 25, 70, 0.12);
}


/* =========================================================
   RESET
   ========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Vazir", sans-serif;
}

html {
    direction: rtl;
    background: #eee9f0;
}

body {
    height: 100%;
    overflow: hidden;
    /* prevents browser scroll */

    margin: 0;
    min-height: 100vh;

    background:
        linear-gradient(180deg,
            #fdf7fc 0%,
            #f7f1f8 45%,
            #f3edf5 100%);

    color: var(--gray-900);

    font-family: "Vazir", sans-serif;
    font-size: 15px;
    line-height: 1.7;

    direction: rtl;

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}


/* =========================================================
   APP CONTAINER
   ========================================================= */

#app {
    height: 100vh;
    overflow-y: auto;
    /* app scrolls internally if needed */

    width: 100%;
    max-width: var(--app-width);

    margin: 0 auto;

    box-shadow:
        0 0 35px rgba(55, 25, 70, 0.08);

    background:
        linear-gradient(180deg,
            var(--purple-600),
            var(--pink-400));
}


/* =========================================================
   PAGE CONTAINER
   ========================================================= */

#page-container {
    padding:
        8px 18px 30px;
}


/* =========================================================
   COMMON
   ========================================================= */

.section-title {
    position: relative;

    text-align: center;

    margin-bottom: 16px;

    color: var(--gold-400);

    font-size: 32px;
    font-weight: 700;
    line-height: 1.5;
}

.section-title::before {
    content: "";

    position: absolute;
    right: 0;
    top: 4px;

    width: 4px;
    height: 24px;

    border-radius: 5px;


}

.name-title {
    position: relative;

    text-align: right;

    color: var(--white);

    font-size: 24px;
    font-weight: 700;
    line-height: 1.5;
}

/* =========================================================
   CARDS
   ========================================================= */

.card {
    margin-bottom: 14px;
    padding: 15px 16px;

    background: rgba(255, 255, 255, 0.10);

    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-md);

    box-shadow: var(--shadow-sm);

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        border-color 0.15s ease;
}

.card:active {
    transform: scale(0.99);

    box-shadow: none;
}


/* =========================================================
   BUTTONS
   ========================================================= */

.btn {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    width: 100%;

    min-height: 46px;

    margin: 5px 0;

    padding: 10px 18px;

    border: 1px solid transparent;
    border-radius: var(--radius-md);

    font-family: "Vazir", sans-serif;
    font-size: 15px;
    font-weight: 500;

    cursor: pointer;

    text-align: center;

    transition:
        transform 0.12s ease,
        background 0.12s ease,
        box-shadow 0.12s ease,
        border-color 0.12s ease;
}

.btn:active {
    transform: scale(0.98);
}


/* Primary */

.btn-primary {
    color: var(--white);

    background:
        linear-gradient(135deg,
            var(--purple-700),
            var(--purple-500));

    border-color: var(--purple-700);

    box-shadow:
        0 5px 14px rgba(118, 47, 153, 0.22);
}


/* Gold */

.btn-gold {
    color: #3d2a08;

    background:
        linear-gradient(135deg,
            #e9c866,
            #c99b2e);

    border-color: var(--gold-500);

    box-shadow:
        0 5px 14px rgba(201, 155, 46, 0.18);
}


/* Danger */

.btn-danger {
    color: var(--white);

    background: var(--danger);
    border-color: var(--danger);
}


/* Success */

.btn-success {
    color: var(--white);

    background: var(--success);
    border-color: var(--success);
}


/* Outline */

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;

    background: rgba(255, 255, 255, 0.10) !important;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: var(--white);

}

.btn-outline:hover {
    border-color: var(--gold-400);
}


/* =========================================================
   FORMS
   ========================================================= */

label {
    display: block;

    margin:
        12px 0 6px;

    color: var(--purple-900);

    font-size: 14px;
    font-weight: 500;
}

input,
select,
textarea {
    width: 100%;

    margin:
        0 0 12px;

    padding:
        11px 13px;

    color: var(--gray-900);

    background: var(--white);

    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);

    font-family: "Vazir", sans-serif;
    font-size: 15px;

    direction: rtl;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
}

input::placeholder,
textarea::placeholder {
    color: #aaa1ad;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;

    background: var(--pink-50);

    border-color: var(--purple-500);

    box-shadow:
        0 0 0 3px rgba(142, 62, 174, 0.10);
}

textarea {
    min-height: 100px;
    resize: vertical;
}


/* =========================================================
   GRID
   ========================================================= */

.grid-2 {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 10px;
}


/* =========================================================
   SPLASH
   ========================================================= */

.splash {
    position: relative;

    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    min-height: 80vh;

    padding: 30px;

    overflow: hidden;

    text-align: center;

    background:
        radial-gradient(circle at 50% 40%,
            rgba(232, 148, 203, 0.20),
            transparent 45%);
}

.splash::before {
    content: "";

    position: absolute;

    width: 220px;
    height: 220px;

    top: 50%;
    left: 50%;

    transform: translate(-50%, -55%);

    border-radius: 50%;

    background:
        radial-gradient(circle,
            rgba(142, 62, 174, 0.10),
            transparent 70%);

    pointer-events: none;
}

.splash h1 {
    position: relative;

    margin-bottom: 8px;

    color: var(--gold-custom);

    font-size: 32px;
    font-weight: 700;
}

.splash p {
    position: relative;

    color: var(--white);

    font-size: 26px;
}

.splash .loader {
    position: relative;

    width: 34px;
    height: 34px;

    margin-top: 28px;

    border:
        3px solid var(--pink-200);

    border-top-color:
        var(--purple-600);

    border-left-color:
        var(--gold-500);

    border-radius: 50%;

    animation:
        spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


/* =========================================================
   MAIN DASHBOARD
   ========================================================= */

.main-grid {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 10px;
}

.main-grid .btn {
    min-height: 58px;

    margin: 0;

    padding:
        10px 13px;

    justify-content: flex-start;

    text-align: right;

    background:
        linear-gradient(145deg,
            #ffffff,
            #fff8fd);
}


/* =========================================================
   SUMMARY
   ========================================================= */

.summary-row {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 10px;

    margin-bottom: 24px;
}

.summary-item {
    position: relative;

    min-height: 102px;

    padding: 15px 12px;

    overflow: hidden;

    background: rgba(255, 255, 255, 0.10);

    border: 1px solid rgba(255, 255, 255, 0.18);

    border-radius:
        var(--radius-lg);

    text-align: center;

    box-shadow: var(--shadow-sm);
}

.summary-item::after {
    content: "";

    position: absolute;

    width: 55px;
    height: 55px;

    left: -18px;
    bottom: -20px;

    border-radius: 50%;

    background:
        rgba(142, 62, 174, 0.06);
}

.summary-item .num {
    position: relative;

    color: var(--gold-custom);

    font-size: 26px;
    font-weight: 700;

    line-height: 1.3;

    direction: rtl;
}

.summary-item .label {
    position: relative;

    margin-top: 5px;

    color: var(--white);

    font-size: 12px;
}


/* =========================================================
   NUMBERS / MONEY
   ========================================================= */

.num,
.amount,
.price,
.money {
    color: var(--gold-500);

    font-weight: 700;
}

.amount,
.price,
.money {
    direction: rtl;
}


/* =========================================================
   LIST ITEMS
   ========================================================= */

.list-item {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 12px;

    padding:
        14px 2px;

    border-bottom:
        1px solid var(--gray-100);
}

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

.list-item .primary {
    color: var(--gray-900);

    font-weight: 500;
}

.list-item .secondary {
    margin-top: 2px;

    color: var(--gray-500);

    font-size: 13px;
}


/* =========================================================
   BADGES
   ========================================================= */

.badge {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-height: 25px;

    padding:
        3px 10px;

    border-radius: 30px;

    background: var(--gray-100);

    color: var(--gray-600);

    font-size: 11px;
    font-weight: 500;

    white-space: nowrap;
}

.badge-success {
    color: #17654d;
    background: var(--success-bg);
}

.badge-warning {
    color: #805d0d;
    background: var(--warning-bg);
}

.badge-danger {
    color: #8f293e;
    background: var(--danger-bg);
}


/* =========================================================
   ORDER STEPS
   ========================================================= */

.step-indicator {
    display: flex;

    gap: 6px;

    margin-bottom: 22px;
}

.step-dot {
    flex: 1;

    height: 5px;

    background: var(--gray-200);

    border-radius: 10px;

    transition:
        background 0.2s ease;
}

.step-dot.active {
    background:
        linear-gradient(90deg,
            var(--purple-600),
            var(--pink-400));
}


/* =========================================================
   DIVIDERS
   ========================================================= */

.divider {
    height: 1px;

    margin:
        18px 0;

    background:
        linear-gradient(90deg,
            transparent,
            var(--pink-200),
            transparent);
}


/* =========================================================
   EMPTY STATE
   ========================================================= */

.empty-state {
    padding: 40px 20px;

    color: var(--gray-500);

    text-align: center;
}

.empty-state .icon {
    margin-bottom: 10px;

    color: var(--purple-400);

    font-size: 32px;
}


/* =========================================================
   HEADER / TOP BAR
   ========================================================= */

.page-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 10px;

    margin-bottom: 20px;
}

.page-header .title {
    color: var(--purple-900);

    font-size: 20px;
    font-weight: 700;
}

.page-header .subtitle {
    margin-top: 2px;

    color: var(--gray-500);

    font-size: 12px;
}


/* =========================================================
   TABLE-LIKE DATA
   ========================================================= */

.data-row {
    display: grid;

    grid-template-columns:
        1.2fr 1fr auto;

    align-items: center;

    gap: 8px;

    padding:
        11px 4px;

    border-bottom:
        1px solid var(--gray-100);

    font-size: 13px;
}

.data-row:last-child {
    border-bottom: none;
}


/* =========================================================
   FILTER / SEARCH
   ========================================================= */

.search-box {
    position: relative;

    margin-bottom: 14px;
}

.search-box input {
    margin-bottom: 0;

    padding-right: 14px;
}


/* =========================================================
   ACTION GROUP
   ========================================================= */

.action-group {
    display: flex;

    gap: 8px;

    margin-top: 16px;
}

.action-group .btn {
    margin: 0;
}


/* =========================================================
   FOOTER / BOTTOM SPACE
   ========================================================= */

.bottom-space {
    height: 30px;
}


/* =========================================================
   HELPERS
   ========================================================= */

.mt-4 {
    margin-top: 4px;
}

.mt-8 {
    margin-top: 8px;
}

.mt-12 {
    margin-top: 12px;
}

.mt-16 {
    margin-top: 16px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-4 {
    margin-bottom: 4px;
}

.mb-8 {
    margin-bottom: 8px;
}

.mb-12 {
    margin-bottom: 12px;
}

.mb-16 {
    margin-bottom: 16px;
}

.mb-20 {
    margin-bottom: 20px;
}

.p-12 {
    padding: 12px;
}

.p-16 {
    padding: 16px;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--gray-200);
    font-size: 13px;
}

.text-info {
    color: var(--gray-200);
    font-size: 16px;
}

.payment {
    display: flex;
    flex-direction: column;
    /* stack children vertically */
    justify-content: center;
    /* vertical centering */
    align-items: center;
    /* horizontal centering */
    height: 100vh;
    /* full viewport height – adjust as needed */
    width: 100%;
    text-align: center;
    /* fallback for inline elements */
    color: var(--gold-custom);
    font-size: 26px;
}

.text-purple {
    color: var(--purple-700);
}

.text-gold {
    color: var(--gold-500);
}

.text-danger {
    color: var(--danger);
}

.text-success {
    color: var(--success);
}

.hidden {
    display: none !important;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 360px) {
    #page-container {
        padding:
            16px 14px 80px;
    }

    .summary-row {
        gap: 8px;
    }

    .summary-item {
        min-height: 94px;

        padding:
            12px 8px;
    }

    .summary-item .num {
        font-size: 23px;
    }

    .main-grid {
        gap: 8px;
    }

    .main-grid .btn {
        min-height: 54px;

        font-size: 13px;
    }
}


/* =========================================================
   REDUCE MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ================================
   TODAY'S STATISTICS
================================ */

.today-statistics {
    margin-top: 8px;
    margin-bottom: 24px;
}

.statistics-title {
    text-align: center;

    color: var(--white);

    font-size: 17px;
    font-weight: 700;

    margin-bottom: 12px;
}

.today-statistics-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);

    gap: 8px;
}

.today-statistic {
    background: rgba(255, 255, 255, 0.10);

    border: 1px solid rgba(255, 255, 255, 0.18);

    border-radius: 12px;

    padding: 13px 6px;

    text-align: center;
}

.today-statistic .num {
    color: var(--gold-custom);

    font-size: 19px;
    font-weight: 800;

    line-height: 1.3;

    margin-bottom: 4px;
}

.today-statistic .label {
    color: var(--white);

    font-size: 11px;
    font-weight: 500;

    white-space: nowrap;
}

#sellerSearch {
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    /* Keep existing padding/margin or adjust */
    padding: 11px 13px;
    margin-bottom: 12px;
    color: var(--white);
    /* or gold, but white is safe on dark bg */
}

#sellerSearch::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

#sellerSearch:focus {
    background: rgba(255, 255, 255, 0.18);
    /* slightly lighter on focus */
    border-color: var(--gold-400);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.15);
}

/* =========================================================
   GLASS / TRANSPARENT INPUT
========================================================= */
.input-glass {
    width: 100%;
    padding: 11px 13px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-md);
    /* reuse existing */
    color: var(--white);
    font-family: "Vazir", sans-serif;
    font-size: 15px;
    direction: rtl;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.input-glass::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.input-glass:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.18);
    border-color: var(--gold-400);
}

.error-message {
    color: var(--gold-custom);
    font-size: 0.85rem;
    margin-top: 4px;
    display: block;
    /* ensures it appears on its own line */
    min-height: 1.2em;
    /* avoids layout shift when empty */
}

.payment-title {
    width: 100%;
    display: flex;
    justify-content: center;
    text-align: center;
    margin-bottom: 24px;
}

.payment-title h1 {
    font-size: 32px;
    font-weight: 700;
    margin: 0;
}

.payment-action {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.payment-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 220px;
    min-height: 64px;
    padding: 0 36px;

    font-size: 24px;
    font-weight: 700;
    text-decoration: none;
    text-align: center;

    border-radius: 14px;
}

.payment-title {
    width: 100%;
    color: var(--gold-custom);
    display: flex;
    justify-content: center;
    text-align: center;
    margin-bottom: 24px;
}

.payment-title h1 {
    font-size: 32px;
    font-weight: 700;
    margin: 0;
}

.payment-action {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.payment-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    color: var(--gold-custom);

    min-width: 220px;
    min-height: 64px;
    padding: 0 36px;

    font-size: 28px;
    font-weight: 700;
    text-decoration: none;
    text-align: center;

    border-radius: 14px;
}