@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/vazir/Vazirmatn-Light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/vazir/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/vazir/Vazirmatn-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/vazir/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary: #6f4e37;
    --primary-dark: #5a3d2b;
    --primary-light: #a67c52;
    --accent: #d4a574;
    --accent-light: #f5e6d3;
    --bg: #faf8f5;
    --bg-card: #ffffff;
    --text: #2c2416;
    --text-muted: #7a6f63;
    --border: #e8e0d5;
    --success: #2d8a4e;
    --danger: #c0392b;
    --warning: #d68910;
    --info: #2980b9;
    --shadow: 0 4px 24px rgba(44, 36, 22, 0.08);
    --shadow-lg: 0 12px 40px rgba(44, 36, 22, 0.12);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    direction: rtl;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 14px rgba(111, 78, 55, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(111, 78, 55, 0.45);
    color: #fff;
}

.btn-secondary {
    background: var(--accent-light);
    color: var(--primary);
}

.btn-secondary:hover {
    background: var(--accent);
    color: #fff;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #a93226;
    color: #fff;
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.05rem;
}

.btn-block {
    width: 100%;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text);
    font-size: 0.9rem;
}

.form-label .required {
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--bg-card);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(111, 78, 55, 0.1);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-check input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 1.1rem;
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

/* Alerts */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error, .alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-success { background: #d4edda; color: #155724; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-info { background: #d1ecf1; color: #0c5460; }
.badge-primary { background: var(--accent-light); color: var(--primary); }
.badge-secondary { background: #e9ecef; color: #495057; }

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 14px 16px;
    text-align: right;
    border-bottom: 1px solid var(--border);
}

.table th {
    background: var(--bg);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.table tbody tr:hover {
    background: rgba(111, 78, 55, 0.03);
}

/* Utilities */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Maintenance */
.maintenance-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
    text-align: center;
    padding: 40px;
}

.maintenance-page h1 {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

/* Developer credit */
.dev-credit {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 24px auto 0;
    text-align: center;
    direction: ltr;
}

.dev-credit__link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid transparent;
    background:
        linear-gradient(rgba(14, 14, 32, 0.92), rgba(20, 20, 40, 0.92)) padding-box,
        linear-gradient(120deg, rgba(255, 215, 0, 0.6), rgba(255, 215, 0, 0.06) 40%, rgba(255, 184, 0, 0.55)) border-box;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.dev-credit__link::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 20%, rgba(255, 215, 0, 0.16) 45%, transparent 70%);
    transform: translateX(-120%);
    transition: transform 0.7s ease;
    pointer-events: none;
}

.dev-credit__link:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.38), 0 0 22px rgba(255, 215, 0, 0.16);
}

.dev-credit__link:hover::after {
    transform: translateX(120%);
}

.dev-credit__spark {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border-radius: 50%;
    color: #ffd700;
    background: radial-gradient(circle at 50% 40%, rgba(255, 215, 0, 0.28), rgba(255, 215, 0, 0.06));
    box-shadow: inset 0 0 0 1px rgba(255, 215, 0, 0.25);
    animation: devCreditPulse 3.2s ease-in-out infinite;
}

.dev-credit__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.25;
}

.dev-credit__label {
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(226, 232, 240, 0.45);
}

.dev-credit__brand {
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    background: linear-gradient(100deg, #ffb800 0%, #ffd700 30%, #fff6c9 50%, #ffd700 70%, #ffb800 100%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: devCreditShine 5s linear infinite;
}

.dev-credit__arrow {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    color: rgba(255, 215, 0, 0.55);
    transition: transform 0.28s ease, color 0.28s ease;
}

.dev-credit__link:hover .dev-credit__arrow {
    color: #ffd700;
    transform: translate(2px, -2px);
}

@keyframes devCreditShine {
    from { background-position: 220% 0; }
    to { background-position: -20% 0; }
}

@keyframes devCreditPulse {
    0%, 100% { box-shadow: inset 0 0 0 1px rgba(255, 215, 0, 0.25); }
    50% { box-shadow: inset 0 0 0 1px rgba(255, 215, 0, 0.45), 0 0 12px rgba(255, 215, 0, 0.22); }
}

@media (prefers-reduced-motion: reduce) {
    .dev-credit__brand,
    .dev-credit__spark {
        animation: none;
    }
}

.dev-credit--auth {
    margin-top: 20px;
}

@media (max-width: 480px) {
    .dev-credit__link {
        gap: 8px;
        padding: 8px 14px;
    }

    .dev-credit__brand {
        font-size: 0.78rem;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
}
