/* Vazirmatn Font Face */
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/vazirmatn/Vazirmatn-Light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

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

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

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/vazirmatn/Vazirmatn-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

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

/* Base */
:root {
    --sidebar-width: 260px;
    --navbar-height: 60px;
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-active: #4f46e5;
    --body-bg: #f1f5f9;
}

* {
    font-family: 'Vazirmatn', sans-serif;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background-color: var(--body-bg);
    direction: rtl;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--sidebar-bg);
    z-index: 1040;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h5 {
    color: #fff;
    margin: 0;
    font-weight: 700;
}

.sidebar-nav {
    padding: 0.75rem 0;
}

.sidebar-nav .nav-label {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1.25rem 0.25rem;
}

.sidebar-nav .nav-link {
    color: rgba(255, 255, 255, 0.7);
    padding: 0.6rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.875rem;
    transition: all 0.2s;
    border-radius: 0;
}

.sidebar-nav .nav-link:hover {
    color: #fff;
    background-color: var(--sidebar-hover);
}

.sidebar-nav .nav-link.active {
    color: #fff;
    background-color: var(--sidebar-active);
}

.sidebar-nav .nav-link i {
    font-size: 1.1rem;
    width: 1.25rem;
    text-align: center;
}

/* Main Content */
.main-content {
    margin-right: var(--sidebar-width);
    min-height: 100vh;
    transition: margin 0.3s ease;
}

/* Navbar */
.top-navbar {
    height: var(--navbar-height);
    background-color: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.content-wrapper {
    padding: 1.5rem;
}

/* Stats Cards */
.stats-card {
    background: #fff;
    border-radius: 0.75rem;
    padding: 1.25rem;
    border: 1px solid #e2e8f0;
    transition: box-shadow 0.2s;
}

.stats-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stats-card .stats-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.stats-card .stats-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
}

.stats-card .stats-label {
    font-size: 0.8rem;
    color: #64748b;
}

/* Cards */
.panel-card {
    background: #fff;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.panel-card .card-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.panel-card .card-body {
    padding: 1.25rem;
}

/* Tables */
.table-panel {
    margin-bottom: 0;
}

.table-panel th {
    background-color: #f8fafc;
    font-weight: 600;
    font-size: 0.8rem;
    color: #64748b;
    white-space: nowrap;
    border-bottom: 2px solid #e2e8f0;
}

.table-panel td {
    vertical-align: middle;
    font-size: 0.875rem;
}

/* Badge Styles */
.badge-status {
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
    font-weight: 500;
}

/* Buttons */
.btn {
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 500;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* Forms */
.form-control,
.form-select {
    font-family: 'Vazirmatn', sans-serif;
    border-color: #e2e8f0;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.15);
}

/* Guest Pages (Login) */
.guest-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.guest-card {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}

.guest-card h4 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* Landing Page */
.landing-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 6rem 0 4rem;
}

.landing-hero h1 {
    font-weight: 800;
    font-size: 2.75rem;
}

.landing-section {
    padding: 4rem 0;
}

.plan-card {
    background: #fff;
    border-radius: 1rem;
    border: 2px solid #e2e8f0;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s;
}

.plan-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(79, 70, 229, 0.15);
}

.plan-card .plan-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
}

.plan-card .plan-unit {
    font-size: 0.875rem;
    color: #64748b;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #94a3b8;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Sidebar Toggle for Mobile */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #1e293b;
    cursor: pointer;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
}

/* Responsive */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-overlay.show {
        display: block;
    }

    .main-content {
        margin-right: 0;
    }

    .sidebar-toggle {
        display: block;
    }
}

/* Support Chat */
.chat-messages {
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
}

.chat-bubble {
    max-width: 75%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.chat-bubble.user {
    background-color: var(--primary-color);
    color: #fff;
    margin-left: auto;
    border-bottom-left-radius: 0.25rem;
}

.chat-bubble.admin {
    background-color: #f1f5f9;
    color: #1e293b;
    margin-right: auto;
    border-bottom-right-radius: 0.25rem;
}

/* Subscription Status */
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.active { background-color: #22c55e; }
.status-dot.expired { background-color: #ef4444; }
.status-dot.pending { background-color: #f59e0b; }
.status-dot.suspended { background-color: #f97316; }

/* Receipt Image */
.receipt-preview {
    max-width: 300px;
    border-radius: 0.5rem;
    border: 2px solid #e2e8f0;
    cursor: pointer;
    transition: transform 0.2s;
}

.receipt-preview:hover {
    transform: scale(1.02);
}

/* Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

/* Alert RTL fix */
.alert {
    text-align: right;
}

/* Footer */
.landing-footer {
    background-color: #1e293b;
    color: rgba(255, 255, 255, 0.7);
    padding: 2rem 0;
}
