/**
 * استایل‌های سفارشی سیستم حسابداری
 * RTL-Ready & Mobile-First
 * با فونت یکپارچه Vazir
 */

/* وارد کردن فونت Vazir */
/* @import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazir-font@v30.1.0/dist/font-face.css');*/

/* یا استفاده از فونت محلی */
@import url('../fonts/vazir.css'); 

:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --font-family: 'Vazir', 'Tahoma', sans-serif;
}

* {
    font-family: var(--font-family);
}

body {
    font-family: var(--font-family);
    background-color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    direction: rtl;
}

/* === Navbar === */
.navbar-brand {
    font-weight: bold;
    font-size: 1.3rem;
}

.navbar-nav .nav-link {
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
}

/* === Cards === */
.card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 10px;
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color), #0a58ca);
    color: white;
    font-weight: bold;
    border-radius: 10px 10px 0 0 !important;
}

/* === Dashboard Stats === */
.stat-card {
    text-align: center;
    padding: 20px;
    color: white;
    border-radius: 10px;
    margin-bottom: 20px;
}

.stat-card.success { background: linear-gradient(135deg, #28a745, #20c997); }
.stat-card.danger { background: linear-gradient(135deg, #dc3545, #c82333); }
.stat-card.info { background: linear-gradient(135deg, #17a2b8, #138496); }
.stat-card.warning { background: linear-gradient(135deg, #ffc107, #e0a800); }

.stat-card h3 {
    font-size: 2.5rem;
    margin: 10px 0;
    font-weight: bold;
}

.stat-card p {
    margin: 0;
    font-size: 1.1rem;
}

/* === Tables === */
.table {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
}

.table thead {
    background-color: var(--primary-color);
    color: white;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.table-responsive {
    border-radius: 10px;
}

/* === Forms === */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #ced4da;
    padding: 0.6rem 0.75rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.btn {
    border-radius: 8px;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #0a58ca);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.4);
}

/* === Badges === */
.badge {
    padding: 0.4em 0.8em;
    font-size: 0.875rem;
    font-weight: 500;
}

/* === Login Page === */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    width: 100%;
    max-width: 450px;
    padding: 40px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.login-card .logo {
    text-align: center;
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

/* === Responsive === */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1rem;
    }
    
    .stat-card h3 {
        font-size: 1.8rem;
    }
    
    .table {
        font-size: 0.85rem;
    }
    
    .btn {
        padding: 0.4rem 1rem;
        font-size: 0.9rem;
    }
}

/* === Footer === */
.footer {
    margin-top: auto;
    border-top: 1px solid #dee2e6;
}

/* === Dynamic Form Rows === */
.table-form tbody tr {
    transition: all 0.3s ease;
}

.table-form tbody tr:hover {
    background-color: #f8f9fa;
}

/* === Print Styles === */
@media print {
    .navbar, .footer, .btn, .no-print {
        display: none !important;
    }
    
    body {
        background-color: white;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}

/* === Loading Spinner === */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* === Animations === */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

/* === Loading Spinner Overlay === */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

/* === Toast Container === */
.toast-container {
    z-index: 9999 !important;
}

.toast {
    min-width: 300px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.toast-body {
    font-size: 0.95rem;
    display: flex;
    align-items: center;
}

/* === Animations === */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.showing {
    animation: slideInRight 0.3s ease-out;
}
