/* Reset و تنظیمات پایه */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #007bff;
    --primary-dark: #0056b3;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --white: #ffffff;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    
    --font-family: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --border-radius: 0.375rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-lg: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

/* تنظیمات پایه برای زبان فارسی */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--white);
    direction: rtl;
    text-align: right;
}

/* تایپوگرافی */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* هدر و نویگیشن */
.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar-brand img {
    margin-left: 0.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.navbar-nav .nav-link:hover {
    background-color: var(--gray-100);
    text-decoration: none;
}

.navbar-nav .nav-link.active {
    color: var(--primary-color);
    background-color: var(--gray-100);
}

/* سکشن هیرو */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../images/pattern.svg') repeat;
    opacity: 0.1;
}

.hero-section .btn {
    border-radius: 50px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: var(--transition);
}

.hero-section .btn-light:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-lg);
}

.hero-section .btn-outline-light:hover {
    background-color: var(--white);
    color: var(--primary-color);
}

/* کارت‌های دسته‌بندی */
.category-card .card {
    transition: var(--transition);
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
}

.category-card .card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-lg);
    border-color: var(--primary-color);
}

.category-card i {
    transition: var(--transition);
}

.category-card:hover i {
    transform: scale(1.1);
    color: var(--primary-dark) !important;
}

/* کارت‌های کسب‌وکار */
.business-card {
    transition: var(--transition);
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
}

.business-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-lg);
    border-color: var(--primary-color);
}

.business-card .card-header {
    background-color: var(--gray-100);
    border-bottom: 1px solid var(--gray-300);
    padding: 1rem;
    display: flex;
    align-items: center;
}

.business-logo {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--border-radius);
    margin-left: 0.75rem;
    border: 2px solid var(--gray-300);
}

.featured-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.business-info .info-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--gray-600);
}

.business-info .info-item i {
    margin-left: 0.5rem;
    width: 16px;
    text-align: center;
}

/* صفحه جزئیات کسب‌وکار */
.business-detail-logo {
    max-width: 200px;
    max-height: 200px;
    object-fit: contain;
    border-radius: var(--border-radius);
    border: 3px solid var(--gray-200);
    padding: 0.5rem;
    background: var(--white);
}

.no-logo-placeholder {
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--gray-100);
    border-radius: var(--border-radius);
    border: 2px dashed var(--gray-400);
    color: var(--gray-500);
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: var(--gray-100);
    border-radius: var(--border-radius);
    border-right: 3px solid var(--primary-color);
}

.contact-item i {
    margin-left: 0.75rem;
    width: 20px;
    text-align: center;
    color: var(--primary-color);
}

.contact-item strong {
    color: var(--gray-700);
    min-width: 60px;
}

.business-description {
    line-height: 1.8;
    text-align: justify;
}

/* گالری تصاویر */
.gallery-thumb {
    transition: var(--transition);
    cursor: pointer;
    border-radius: var(--border-radius);
    border: 2px solid var(--gray-300);
}

.gallery-thumb:hover {
    transform: scale(1.05);
    border-color: var(--primary-color);
}

/* کسب‌وکارهای مرتبط */
.related-business {
    transition: var(--transition);
    padding: 0.75rem;
    border-radius: var(--border-radius);
}

.related-business:hover {
    background-color: var(--gray-100);
}

.related-business h6 a {
    color: var(--gray-800);
    transition: var(--transition);
}

.related-business:hover h6 a {
    color: var(--primary-color);
}

/* فرم‌ها و فیلدهای ورودی */
.form-control, .form-select {
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-400);
    padding: 0.75rem 1rem;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}

/* دکمه‌ها */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-lg);
    background: linear-gradient(135deg, var(--primary-dark) 0%, #004085 100%);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #1e7e34 100%);
}

.btn-success:hover {
    background: linear-gradient(135deg, #1e7e34 0%, #155724 100%);
}

/* صفحه‌بندی */
.pagination {
    margin-bottom: 0;
}

.page-link {
    color: var(--gray-600);
    border: 1px solid var(--gray-300);
    padding: 0.5rem 0.75rem;
    transition: var(--transition);
}

.page-link:hover {
    color: var(--primary-color);
    background-color: var(--gray-100);
    border-color: var(--gray-400);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

/* Breadcrumb */
.breadcrumb {
    background-color: transparent;
    padding: 0.75rem 0;
    margin-bottom: 1rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "\\";
    float: left;
    padding: 0 0.5rem;
    color: var(--gray-600);
}

.breadcrumb-item a {
    color: var(--gray-600);
}

.breadcrumb-item.active {
    color: var(--gray-800);
}

/* آیکون‌ها */
.bi {
    line-height: 1;
}

/* بج‌ها */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 50rem;
}

.badge-sm {
    font-size: 0.75em;
    padding: 0.25em 0.5em;
}

/* کارت‌ها */
.card {
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.card-header {
    background-color: var(--gray-100);
    border-bottom: 1px solid var(--gray-300);
    padding: 1rem 1.25rem;
}

.card-footer {
    background-color: var(--gray-100);
    border-top: 1px solid var(--gray-300);
    padding: 0.75rem 1.25rem;
}

/* آمار و ارقام */
.stats .stat-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-200);
}

.stats .stat-item:last-child {
    border-bottom: none;
}

/* فوتر */
footer {
    margin-top: auto;
}

footer h5 {
    color: var(--white);
    margin-bottom: 1rem;
}

footer a.text-muted:hover {
    color: var(--white) !important;
    text-decoration: none;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--primary-color);
    transform: translateY(-2px);
    text-decoration: none;
}

/* آلرت‌ها */
.alert {
    border-radius: var(--border-radius);
    border: none;
    padding: 1rem 1.5rem;
}

.alert-info {
    background-color: #e7f3ff;
    color: #0c5460;
    border-right: 4px solid var(--info-color);
}

.alert-success {
    background-color: #e7f6e7;
    color: #155724;
    border-right: 4px solid var(--success-color);
}

.alert-warning {
    background-color: #fff8e1;
    color: #856404;
    border-right: 4px solid var(--warning-color);
}

.alert-danger {
    background-color: #ffeaea;
    color: #721c24;
    border-right: 4px solid var(--danger-color);
}

/* جداول */
.table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    margin-bottom: 1rem;
}

.table th {
    background-color: var(--gray-100);
    border-bottom: 2px solid var(--gray-300);
    font-weight: 600;
    padding: 0.75rem;
    text-align: right;
}

.table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: middle;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: var(--gray-50);
}

.table-hover tbody tr:hover {
    background-color: var(--gray-100);
}

/* مدال */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--box-shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--gray-300);
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--gray-300);
    padding: 1rem 1.5rem;
}

/* لودینگ و انیمیشن‌ها */
.loading-spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--gray-300);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Utilities */
.text-justify {
    text-align: justify;
}

.rounded {
    border-radius: var(--border-radius) !important;
}

.shadow-sm {
    box-shadow: var(--box-shadow) !important;
}

.shadow {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* رسپانسیو */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }
    h5 { font-size: 1.1rem; }
    
    .hero-section {
        text-align: center;
        padding: 3rem 1rem;
    }
    
    .hero-section .btn {
        display: block;
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .business-detail-logo,
    .no-logo-placeholder {
        width: 120px;
        height: 120px;
    }
    
    .contact-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .contact-item i {
        margin-bottom: 0.5rem;
        margin-left: 0;
    }
    
    .navbar-nav {
        text-align: center;
    }
    
    .dropdown-menu {
        text-align: right;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .pagination .page-link {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .hero-section,
    footer,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .container {
        width: 100%;
        max-width: none;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
    
    a {
        color: #000 !important;
        text-decoration: none !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --text-color: #ffffff;
        --card-bg: #2d2d2d;
        --border-color: #404040;
    }
    
    .dark-mode {
        background-color: var(--bg-color);
        color: var(--text-color);
    }
    
    .dark-mode .card {
        background-color: var(--card-bg);
        border-color: var(--border-color);
    }
    
    .dark-mode .card-header,
    .dark-mode .card-footer {
        background-color: rgba(255, 255, 255, 0.05);
        border-color: var(--border-color);
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for keyboard navigation */
a:focus,
button:focus,
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0000ff;
        --primary-dark: #0000cc;
    }
    
    .btn-primary {
        background: #0000ff;
        color: #ffffff;
    }
}