﻿/* =========================
   Fonts
========================= */

@font-face {
    font-family: 'Vazirmatn';
    src: url('/fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('/fonts/Vazirmatn-Medium.woff2') format('woff2');
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('/fonts/Vazirmatn-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('/fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}


/* =========================
   Global
========================= */

html,
body {
    font-family: 'Vazirmatn', sans-serif;
    direction: rtl;
    background-color: #f4f6fb;
    color: #1f2937;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
}

.mud-layout {
    background-color: #f4f6fb;
}


/* =========================
   Typography
========================= */

.mud-typography,
.mud-button,
.mud-input,
.mud-select,
.mud-table,
.mud-text-field,
.mud-chip,
.mud-dialog,
.mud-paper,
.mud-nav-link,
.mud-tab,
.mud-alert,
.mud-snackbar {
    font-family: 'Vazirmatn', sans-serif !important;
}


/* =========================
   AppBar (TopBar)
========================= */

.mud-appbar {
    background-color: #ffffff !important;
    color: #111827 !important;
    border-bottom: 1px solid #e5e7eb;
}

    .mud-appbar .mud-icon-button {
        color: #374151;
    }


/* =========================
   Sidebar
========================= */

.mud-drawer {
    background-color: #ffffff !important;
    border-left: 1px solid #e5e7eb;
}

.navmenu-wrapper {
    height: 100%;
}

.navmenu-brand {
    padding: 20px 20px 12px 20px;
}

.navmenu-brand-title {
    font-weight: 700;
    font-size: 18px;
}

.navmenu-brand-subtitle {
    color: #6b7280;
    margin-top: 4px;
}

.navmenu-section-title {
    padding: 10px 14px;
    font-size: 11px;
    color: #9ca3af;
    letter-spacing: 0.05em;
}


/* =========================
   Sidebar Links
========================= */

.mud-navmenu {
    padding-top: 6px;
}

.mud-nav-link {
    margin: 4px 8px;
    border-radius: 12px;
    min-height: 44px;
    padding-inline: 12px;
    transition: all 0.15s ease;
}

    .mud-nav-link:hover {
        background-color: #f3f4f6;
    }

    .mud-nav-link.active {
        background-color: rgba(25,118,210,0.12);
        color: #1976d2 !important;
        font-weight: 600;
    }

    .mud-nav-link .mud-nav-link-icon {
        margin-left: 12px;
    }


/* =========================
   Main Content
========================= */

.mud-main-content {
    background-color: #f4f6fb;
    min-height: calc(100vh - 64px);
}


/* =========================
   Cards
========================= */

.mud-paper,
.mud-card {
    border-radius: 14px !important;
}

.mud-card {
    box-shadow: 0 3px 12px rgba(0,0,0,0.04);
}


/* =========================
   Tables
========================= */

.mud-table {
    background-color: #ffffff;
}

    .mud-table thead {
        background-color: #f9fafb;
    }

    .mud-table th {
        font-weight: 600;
    }

.mud-table-row:hover {
    background-color: #f9fafb;
}


/* =========================
   Buttons
========================= */

.mud-button {
    border-radius: 10px !important;
    text-transform: none !important;
}


/* =========================
   Forms
========================= */

.mud-input-root {
    border-radius: 10px !important;
}

.mud-input-control {
    margin-bottom: 10px;
}


/* =========================
   Dialog
========================= */

.mud-dialog {
    border-radius: 14px !important;
}


/* =========================
   Snackbar
========================= */

.mud-snackbar {
    border-radius: 10px !important;
}


/* =========================
   Mobile Optimization
========================= */

@media (max-width: 960px) {

    .mud-container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .mud-paper,
    .mud-card {
        border-radius: 10px !important;
    }

    .mud-nav-link {
        min-height: 42px;
    }
}


/* ================================================================
   Subscriber Portal - Login Page
   ================================================================ */

.login-wrapper {
    display: flex;
    min-height: 100vh;
    direction: rtl;
    background: #F0FDF9;
}

/* Side decorative panel */
.login-side-panel {
    display: none;
    width: 420px;
    min-width: 420px;
    background: linear-gradient(160deg, #0F766E 0%, #0D9488 40%, #14B8A6 100%);
    position: relative;
    overflow: hidden;
}

.login-side-panel::before {
    content: '';
    position: absolute;
    top: -80px;
    left: -80px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: rgba(255,255,255,0.07);
}

.login-side-panel::after {
    content: '';
    position: absolute;
    bottom: -100px;
    right: -60px;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
}

.login-side-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 48px 40px;
    text-align: center;
    color: white;
}

.login-logo-circle {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
    border: 2px solid rgba(255,255,255,0.2);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

.login-side-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 12px;
    color: white;
}

.login-side-subtitle {
    font-size: 1rem;
    opacity: 0.85;
    line-height: 1.8;
    margin: 0 0 40px;
}

.login-features {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.login-feature-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 14px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    border: 1px solid rgba(255,255,255,0.15);
}

.login-feature-icon {
    font-size: 1.4rem;
}

/* Form panel */
.login-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
    background: #F0FDF9;
}

.login-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 48px 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 4px 32px rgba(15, 118, 110, 0.08);
    border: 1px solid #CCFBF1;
}

/* Mobile logo */
.login-mobile-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.login-logo-circle-sm {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #0F766E, #14B8A6);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.login-mobile-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0F766E;
}

.login-card-header {
    margin-bottom: 32px;
}

.login-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #134E4A;
    margin: 0 0 8px;
}

.login-subtitle {
    font-size: 0.9rem;
    color: #6B7280;
    margin: 0;
}

/* Error alert */
.login-error-alert {
    display: flex;
    align-items: center;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #DC2626;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* Form fields */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

.login-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input-icon {
    position: absolute;
    right: 14px;
    color: #9CA3AF;
    display: flex;
    align-items: center;
    pointer-events: none;
    z-index: 1;
}

.login-input {
    width: 100%;
    padding: 13px 44px 13px 14px;
    border: 1.5px solid #E5E7EB;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    color: #1F2937;
    background: #FAFAFA;
    transition: all 0.2s;
    outline: none;
    box-sizing: border-box;
}

.login-input:focus {
    border-color: #0F766E;
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.login-input::placeholder {
    color: #9CA3AF;
    font-size: 0.875rem;
}

.login-input-password {
    padding-left: 44px;
}

.login-toggle-password {
    position: absolute;
    left: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: #9CA3AF;
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 6px;
    transition: color 0.2s;
}

.login-toggle-password:hover {
    color: #0F766E;
}

/* Submit button */
.login-submit-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #0F766E 0%, #0D9488 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(15, 118, 110, 0.35);
    margin-top: 8px;
}

.login-submit-btn:hover {
    background: linear-gradient(135deg, #0D6E66 0%, #0B8377 100%);
    box-shadow: 0 6px 20px rgba(15, 118, 110, 0.45);
    transform: translateY(-1px);
}

.login-submit-btn:active {
    transform: translateY(0);
}

.login-footer-text {
    text-align: center;
    font-size: 0.8rem;
    color: #9CA3AF;
    margin-top: 24px;
    border-top: 1px solid #F3F4F6;
    padding-top: 20px;
}

/* Responsive - show side panel on larger screens */
@media (min-width: 900px) {
    .login-side-panel {
        display: flex;
    }
    .login-mobile-logo {
        display: none;
    }
}

@media (max-width: 500px) {
    .login-card {
        padding: 32px 24px;
        border-radius: 16px;
    }
}


/* ================================================================
   Subscriber Portal - General
   ================================================================ */

.portal-page-header {
    margin-bottom: 24px;
}

.portal-kpi-card {
    border-radius: 16px !important;
    border: 1px solid #CCFBF1 !important;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.portal-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15, 118, 110, 0.12) !important;
}

.portal-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.portal-status-active {
    background: #D1FAE5;
    color: #065F46;
}

.portal-status-suspended {
    background: #FEF3C7;
    color: #92400E;
}

.portal-status-expired {
    background: #FEE2E2;
    color: #991B1B;
}

.portal-status-pending {
    background: #DBEAFE;
    color: #1E40AF;
}


/* ================================================================
   Subscriber Portal - Additional Styles
   ================================================================ */

/* Override MudBlazor default for teal theme */
.subscriber-layout .mud-nav-link.active,
.subscriber-layout .mud-nav-link:hover {
    color: inherit;
}

/* Portal content card */
.portal-content-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #CCFBF1;
    padding: 24px;
}

/* Portal section title */
.portal-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #134E4A;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Info rows in profile */
.portal-info-row {
    display: flex;
    align-items: start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #F0FDF9;
}

.portal-info-row:last-child {
    border-bottom: none;
}

/* Pulse animation for active services */
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.portal-active-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #16A34A;
    display: inline-block;
    animation: pulse-dot 2s ease-in-out infinite;
    margin-left: 6px;
}

/* Access denied page */
.portal-access-denied {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    gap: 16px;
    color: #6B7280;
}


/* =========================
   Admin Panel Layout
========================= */

.admin-layout {
    background: #F1F5F9;
}

/* AppBar */
.admin-appbar.mud-appbar {
    background: linear-gradient(135deg, #1E3A8A 0%, #1E40AF 100%) !important;
    box-shadow: 0 2px 12px rgba(30,58,138,.35) !important;
    border-bottom: none;
    height: 64px;
}

.admin-brand-text {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: .3px;
    color: #fff !important;
}

.admin-user-chip .mud-chip-content,
.admin-user-chip {
    color: rgba(255,255,255,.85) !important;
    font-size: .85rem;
}

.admin-role-chip {
    border-color: rgba(255,255,255,.45) !important;
    color: rgba(255,255,255,.9) !important;
    font-size: .78rem;
}

/* Drawer */
.admin-drawer.mud-drawer {
    background: #1E293B !important;
    border-left: 1px solid rgba(255,255,255,.08) !important;
}

.admin-drawer .mud-drawer-content {
    background: #1E293B !important;     /* slate-800 */
    display: flex;
    flex-direction: column;
    height: 100%;
}

.admin-profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px 16px;
    background: rgba(255,255,255,.05);
}

.admin-profile-name {
    color: #E2E8F0 !important;
    font-weight: 600;
    font-size: .95rem;
    margin-top: 8px;
    text-align: center;
}

/* Nav section title */
.admin-nav-section-title {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #64748B;
    padding: 16px 16px 4px;
}

/* Nav links */
.admin-nav .mud-nav-link {
    border-radius: 8px !important;
    margin: 2px 0;
    color: #CBD5E1 !important;
    font-size: .88rem;
    transition: background .15s, color .15s;
}

.admin-nav .mud-nav-link:hover {
    background: rgba(255,255,255,.08) !important;
    color: #fff !important;
}

.admin-nav .mud-nav-link.active,
.admin-nav .mud-nav-link[aria-current="page"] {
    background: rgba(59,130,246,.25) !important;
    color: #93C5FD !important;
    font-weight: 600;
}

.admin-nav .mud-nav-link .mud-icon-root {
    color: #93C5FD !important;
}

/* Drawer footer */
.admin-drawer-footer {
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,.1);
}

.admin-logout-btn {
    font-size: .85rem !important;
    color: #FCA5A5 !important;
}

/* Main content */
.admin-main-content {
    background: #F1F5F9;
    min-height: calc(100vh - 64px);
}

/* Page header cards in admin */
.admin-page-header {
    background: #fff;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 20px;
    border: 1px solid #E2E8F0;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

/* Stat cards */
.admin-stat-card {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    border: 1px solid #E2E8F0;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    transition: transform .15s, box-shadow .15s;
    cursor: default;
}

.admin-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
}

.admin-stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Content panels */
.admin-panel {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    overflow: hidden;
    padding: 20px;
}

.admin-panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid #F1F5F9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Stat card inner layout */
.admin-stat-card-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.admin-stat-label {
    font-size: .8rem;
    color: #64748B;
    margin-bottom: 4px;
}

.admin-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1E293B;
    line-height: 1.1;
}

/* Responsive */
@media (max-width: 960px) {
    .admin-appbar.mud-appbar {
        height: 56px;
    }
}

/* =========================
   Fix Admin Drawer Menu Layout
========================= */

.admin-drawer .mud-drawer-content{
    display:flex;
    flex-direction:column;
    justify-content:flex-start;
}

/* container menu */
.admin-nav{
    flex:1;
    display:flex;
    flex-direction:column;
    justify-content:flex-start;
}

/* section titles */
.admin-nav-section-title{
    text-align:right;
    padding:14px 16px 6px;
    font-size:.68rem;
    font-weight:700;
    letter-spacing:1px;
    color:#64748B;
}

/* nav links rtl alignment */
.admin-nav .mud-nav-link{
    direction:rtl;
    justify-content:flex-start;
    text-align:right;
}

/* icon spacing for rtl */
.admin-nav .mud-nav-link .mud-nav-link-icon{
    margin-left:10px;
    margin-right:0;
}

/* ensure footer stays bottom */
.admin-drawer-footer{
    margin-top:auto;
}
