/* =========================================================
   MARZI HANDICRAFTS
   GLOBAL APP CSS
   ========================================================= */


/* =========================================================
   1. FONT - VAZIR
   ========================================================= */

@font-face {
    font-family: "Vazir";
    src: url("/fonts/Vazir.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Vazir";
    src: url("/fonts/Vazir-Medium.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Vazir";
    src: url("/fonts/Vazir-Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Vazir";
    src: url("/fonts/Vazir-Light.woff2") format("woff2");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}


/* =========================================================
   2. GLOBAL RESET
   ========================================================= */

html {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    box-sizing: border-box;
}

body {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    box-sizing: border-box;
    font-family: "Vazir", Tahoma, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.8;
    direction: rtl;
    color: var(--marzi-text, #382C25);
    background: var(--marzi-background, #F7F3EC);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}


/* =========================================================
   3. BLAZOR ROOT
   ========================================================= */

#app {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}


/* =========================================================
   4. MUD RTL / LAYOUT
   ========================================================= */

.mud-rtl-provider {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
}

.mud-layout {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
}




/* =========================================================
   5. BODY CHILDREN
   ========================================================= */

body > * {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}


/* =========================================================
   6. TYPOGRAPHY
   ========================================================= */

body,
button,
input,
textarea,
select {
    font-family: "Vazir", Tahoma, Arial, sans-serif;
}

.mud-typography,
.mud-button-root,
.mud-input,
.mud-input-label,
.mud-nav-link,
.mud-list-item,
.mud-table,
.mud-chip,
.mud-alert,
.mud-snackbar,
.mud-dialog,
.mud-menu,
.mud-popover {
    font-family: "Vazir", Tahoma, Arial, sans-serif !important;
}

.mud-typography-h1 {
    font-weight: 700;
}

.mud-typography-h2,
.mud-typography-h3,
.mud-typography-h4,
.mud-typography-h5,
.mud-typography-h6 {
    font-weight: 600;
}

.mud-typography-body1 {
    font-size: 1rem;
    line-height: 1.9;
}

.mud-typography-body2 {
    font-size: 0.925rem;
    line-height: 1.8;
}

.mud-button-label {
    font-weight: 500;
}


/* =========================================================
   7. LINKS / DEFAULT BLAZOR
   ========================================================= */

a,
.btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}


/* =========================================================
   8. FORM
   ========================================================= */

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}


/* =========================================================
   9. BLAZOR ERROR
   ========================================================= */

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }


/* =========================================================
   10. GLOBAL RESPONSIVE SAFETY
   ========================================================= */

img,
video,
canvas,
svg {
    max-width: 100%;
}

img,
video {
    display: block;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
    max-width: 100%;
    overflow-wrap: anywhere;
}

.mud-paper,
.mud-card,
.mud-container,
.mud-grid,
.mud-stack {
    min-width: 0;
    max-width: 100%;
}


/* =========================================================
   11. MAIN CONTENT
   ========================================================= */

.main-content {
    width: 100%;
    max-width: 1440px;
    min-width: 0;
    margin: 0 auto;
    padding: 32px 24px 48px;
    box-sizing: border-box;
    overflow-x: hidden;
}

.main-content-inner {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow-x: hidden;
}


/* =========================================================
   12. APP BAR
   ========================================================= */

.marzi-appbar {
    width: 100%;
    max-width: 100%;
    direction: rtl;
    box-sizing: border-box;
    box-shadow: 0 8px 24px rgba(56, 44, 37, .12);
}

.theme-picker-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.theme-picker-swatches {
    display: inline-flex;
    flex: 0 0 auto;
    direction: ltr;
}

.theme-picker-swatches span {
    width: 16px;
    height: 16px;
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 50%;
}

.theme-picker-swatches span + span {
    margin-left: -5px;
}

.theme-picker-check {
    margin-inline-start: auto;
    color: var(--marzi-primary, #925640);
}

.theme-picker-heading {
    opacity: .7;
    font-size: .85rem;
}

.mud-card {
    border: 1px solid rgba(115, 87, 61, .09);
    border-radius: 20px;
    box-shadow: 0 12px 30px rgba(76, 55, 39, .08);
}

.mud-button-root {
    letter-spacing: 0;
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.mud-button-filled:hover {
    box-shadow: 0 8px 18px rgba(74, 48, 35, .2);
    transform: translateY(-1px);
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 34px 0 18px;
}

.home-welcome {
    margin: 32px 0 40px;
}

.home-welcome > :last-child {
    margin-bottom: 0;
}

.section-heading {
    position: relative;
    padding-right: 14px;
    color: var(--marzi-text, #382C25);
    font-weight: 700;
}

.section-heading::before {
    position: absolute;
    top: 17%;
    right: 0;
    width: 4px;
    height: 66%;
    border-radius: 4px;
    background: var(--mud-palette-primary);
    content: "";
}

.site-update-notice {
    position: fixed;
    z-index: 1400;
    top: 84px;
    left: 50%;
    display: flex;
    align-items: center;
    gap: 12px;
    width: min(620px, calc(100vw - 32px));
    padding: 12px 14px;
    border: 1px solid rgba(115, 87, 61, .16);
    border-radius: 16px;
    color: var(--marzi-text, #382C25);
    background: #FFFDFA;
    box-shadow: 0 16px 44px rgba(56, 44, 37, .2);
    transform: translateX(-50%);
}

.site-update-message {
    flex: 1;
    min-width: 0;
    font-size: .95rem;
}

.site-update-button,
.site-update-close {
    border: 0;
    cursor: pointer;
    font: inherit;
}

.site-update-button {
    padding: 8px 14px;
    border-radius: 10px;
    color: #fff;
    background: var(--marzi-primary, #925640);
    font-size: .88rem;
    font-weight: 600;
}

.site-update-button:hover {
    background: #784431;
}

.site-update-close {
    padding: 0 5px;
    color: var(--marzi-text-secondary, #75675C);
    background: transparent;
    font-size: 1.35rem;
    line-height: 1;
}

.brand-title {
    white-space: nowrap;
    font-weight: 700;
}

.desktop-navigation {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.mobile-auth-action {
    display: none;
}


/* =========================================================
   13. MOBILE BOTTOM NAVIGATION
   ========================================================= */

.mobile-bottom-navigation {
    display: none;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

@media (max-width: 959.98px) {

    .mobile-bottom-navigation {
        display: block;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
}

@media (max-width: 600px) {
    .site-update-notice {
        top: auto;
        bottom: 88px;
        gap: 8px;
        padding: 10px;
    }

    .site-update-message {
        font-size: .82rem;
    }

    .site-update-button {
        padding: 7px 10px;
        white-space: nowrap;
    }
}

/* =========================================================
   14. MOBILE
   ========================================================= */

@media (max-width: 959.98px) {

    .desktop-navigation {
        display: none;
    }

    .mobile-auth-action {
        display: flex;
        align-items: center;
    }

    .main-content {
        width: 100%;
        max-width: 100%;
        padding: 20px 16px 100px;
    }

    .main-content-inner {
        width: 100%;
        max-width: 100%;
        padding: 0;
    }

    .mobile-bottom-navigation {
        display: block;
    }

    .brand-title {
        font-size: 1rem;
    }
}


/* =========================================================
   15. SMALL MOBILE
   ========================================================= */

@media (max-width: 600px) {

    html,
    body {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
    }

    #app {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
    }

    .main-content {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding: 12px 10px 96px;
        overflow-x: hidden;
    }

    .main-content-inner {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding: 0;
        overflow-x: hidden;
    }

    .marzi-appbar {
        width: 100%;
        max-width: 100%;
    }

    .brand-title {
        font-size: 0.95rem;
    }
}


/* =========================================================
   16. VERY SMALL PHONES
   ========================================================= */

@media (max-width: 380px) {

    .main-content {
        padding-left: 8px;
        padding-right: 8px;
        padding-bottom: 94px;
    }

    .brand-title {
        font-size: 0.85rem;
    }
}


/* =========================================================
   17. REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
/* =========================================================
   MARZI - COURSE MEDIA HARD RESPONSIVE FIX
   ========================================================= */

.course-hero,
.course-hero-image,
.course-cover {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

.course-hero {
    display: block !important;
    overflow: hidden !important;
}

.course-hero-image {
    position: relative !important;
    display: block !important;
    overflow: hidden !important;
}

.course-cover {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    display: block !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: cover !important;
}


/* =========================================================
   VIDEO
   ========================================================= */

.video-player-wrapper {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    width: min(100%, calc(min(70vh, 720px) * var(--video-ratio, 1.7778))) !important;
    aspect-ratio: var(--video-ratio, 1.7778) !important;
    max-height: min(70vh, 720px) !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

    .video-player-wrapper .video-player,
    video.video-player {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: 100% !important;
        width: min(100%, calc(min(70vh, 720px) * var(--video-ratio, 1.7778))) !important;
        aspect-ratio: var(--video-ratio, 1.7778) !important;
        max-height: min(70vh, 720px) !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        object-fit: contain !important;
    }


/* =========================================================
   COURSE DETAILS
   ========================================================= */

.course-details-page,
.course-info-section,
.course-video-section,
.lesson-list {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

.course-info-section,
.course-video-section {
    overflow: hidden !important;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {

    .course-hero-image {
        aspect-ratio: 4 / 3 !important;
    }

    .video-player-wrapper {
        max-width: 100% !important;
        max-height: min(70vh, 720px) !important;
    }

        .video-player-wrapper .video-player,
        video.video-player {
            max-width: 100% !important;
        }
}
/* ============================================================
   Admin Mobile Bottom Navigation
   ============================================================ */

.admin-mobile-bottom-navigation {
    display: none;
}


/* ============================================================
   Mobile
   ============================================================ */

@media (max-width: 959.98px) {

    .admin-mobile-bottom-navigation {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 1100;
        display: flex;
        align-items: stretch;
        justify-content: space-around;
        height: 64px;
        padding: 6px 8px env(safe-area-inset-bottom);
        background: var(--mud-palette-surface);
        border-top: 1px solid var(--mud-palette-lines-default);
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
    }


    .admin-mobile-nav-item {
        min-width: 0 !important;
        flex: 1 1 0;
        height: 52px;
        padding: 4px 2px !important;
        border-radius: 8px;
        font-size: 11px;
    }


        .admin-mobile-nav-item .mud-button-label {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 2px;
            line-height: 1.2;
        }


        .admin-mobile-nav-item .mud-button-start-icon {
            margin: 0 !important;
            font-size: 20px;
        }


        .admin-mobile-nav-item span {
            white-space: nowrap;
        }


    /* فضای پایین صفحه برای Bottom Navigation */

    .admin-mobile-bottom-navigation ~ * {
        padding-bottom: 0;
    }


    .main-content {
        padding-bottom: 76px;
    }
}


/* ============================================================
   Desktop
   ============================================================ */

@media (min-width: 960px) {

    .admin-mobile-bottom-navigation {
        display: none !important;
    }
}

/* ============================================================
   Admin Dashboard
   ============================================================ */

.admin-dashboard-container {
    padding-top: 24px;
    padding-bottom: 32px;
}


.admin-stat-card {
    height: 100%;
    border-radius: 14px;
}


.admin-order-row,
.admin-course-row {
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.025);
}


    .admin-order-row:hover,
    .admin-course-row:hover {
        background: rgba(0, 0, 0, 0.045);
    }


@media (max-width: 768px) {

    .admin-dashboard-container {
        padding-top: 16px;
        padding-bottom: 88px;
    }


    .admin-stat-card {
        min-height: 135px;
    }


    .admin-order-row,
    .admin-course-row {
        padding: 12px !important;
    }
}

/* ============================================================
   Admin RTL Sidebar
   ============================================================ */

.admin-sidebar {
    position: fixed;
    top: 64px;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    width: 248px;
    flex-direction: column;
    padding: 28px 16px 18px;
    box-sizing: border-box;
    background: #fbfaf7;
    border-left: 1px solid rgba(91, 108, 73, 0.14);
    box-shadow: -8px 0 24px rgba(44, 54, 36, 0.05);
    direction: rtl;
}

.admin-sidebar-heading {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 12px 24px;
    color: #26331f;
}

.admin-sidebar-kicker {
    color: #849b77;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.admin-sidebar-heading strong {
    font-size: 1.15rem;
}

.admin-sidebar-nav,
.admin-sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.admin-sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(91, 108, 73, 0.14);
}

.admin-sidebar-link,
.admin-sidebar-logout {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 46px;
    padding: 0 14px;
    box-sizing: border-box;
    border: 0;
    border-radius: 12px;
    color: #66765c;
    background: transparent;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 160ms ease, color 160ms ease;
}

.admin-sidebar-link:hover,
.admin-sidebar-logout:hover,
.admin-sidebar-link-active {
    color: #fff;
    background: #849b77;
}

.admin-sidebar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    direction: ltr;
    font-size: 20px;
}

@media (max-width: 959.98px) {
    .admin-sidebar {
        display: none;
    }
}

@media (min-width: 960px) {
    .main-content {
        max-width: calc(1440px - 248px);
        margin-right: 248px;
        margin-left: 0;
    }
}
