/* فونت و تنظیمات پایه */
@import url('https://cdn.fontcdn.ir/Font/Persian/Vazir/Vazir.css');

/* 🔹 غیرفعال کردن کامل حالت تاریک */
:root {
    color-scheme: light only !important;
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --accent-color: #e74c3c;
    --light-bg: #f8f9fa;
    --border-color: #dee2e6;
    --table-header-bg: #f1f5f9;
}

/* فورس کردن حالت روشن برای همه المنت‌ها */
html, body, * {
    color-scheme: light !important;
}

/* جلوگیری از تغییر رنگ در Dark Mode */
@media (prefers-color-scheme: dark) {
    html, body {
        background-color: #f5f5f5 !important;
        color: #333 !important;
    }

    * {
        color-scheme: light !important;
    }
}

body.price-data-table-template {
    font-family: 'Vazir', Tahoma, sans-serif;
    background-color: #f5f5f5 !important;
    color: #333 !important;
    line-height: 1.6;
    padding: 0;
    margin: 0;
}

.price-data-table-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.table-header h1 {
    font-size: 24px;
    color: var(--secondary-color);
    margin: 0;
}

.table-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.tax-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.table-search {
    position: relative;
    display: flex;
    align-items: center;
}

.table-search i {
    position: absolute;
    right: 10px;
    color: #777;
}

.table-search input {
    padding: 8px 35px 8px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Vazir';
    width: 250px;
    background-color: white !important;
    color: #333 !important;
}

.factory-table-section {
    background: white !important;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    overflow: hidden;
}

.factory-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background-color: var(--secondary-color) !important;
    color: white !important;
}

.factory-logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
    border-radius: 4px;
    background: white !important;
    padding: 2px;
}

.factory-header h2 {
    font-size: 18px;
    margin: 0;
    color: white !important;
}

.price-data-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white !important;
    border-radius: 0 !important;
}

.price-data-table th {
    background-color: var(--table-header-bg) !important;
    padding: 12px 15px;
    text-align: center;
    font-weight: bold;
    color: var(--secondary-color) !important;
    border-bottom: 2px solid var(--border-color);
}

.price-data-table thead th:first-child {
    border-top-left-radius: 0 !important;
}

.price-data-table thead th:last-child {
    border-top-right-radius: 0 !important;
}

.price-data-table td {
    padding: 10px 15px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    background-color: white !important;
    color: #333 !important;
}

.price-data-table tbody tr {
    background-color: white !important;
}

.price-data-table tbody tr:nth-child(even) {
    background-color: #f9fafb !important;
}

.price-data-table tr:hover,
.price-data-table tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.05) !important;
}

/* فورس کردن حالت روشن برای سطرهای جدول در Dark Mode */
@media (prefers-color-scheme: dark) {
    .price-data-table tbody tr {
        background-color: white !important;
    }

    .price-data-table tbody tr:nth-child(even) {
        background-color: #f9fafb !important;
    }

    .price-data-table tbody td {
        color: #333 !important;
    }

    .price-data-table tbody tr:hover {
        background-color: #f3f4f6 !important;
    }
}

.product-price {
    font-weight: bold;
    color: var(--accent-color) !important;
}

.price-change {
    font-weight: bold;
}

.price-up {
    color: #e74c3c !important;
}

.price-down {
    color: #2ecc71 !important;
}

.view-btn {
    background-color: var(--primary-color) !important;
    color: white !important;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.3s;
    font-family: 'Vazir';
}

.view-btn:hover {
    background-color: #2980b9 !important;
}

/* تنظیمات برای دیتاتیبل */
.dataTables_wrapper {
    padding: 15px;
    background-color: white !important;
}

.dataTables_length, .dataTables_filter {
    margin-bottom: 15px;
}

.dataTables_filter input {
    background-color: white !important;
    color: #333 !important;
}

.dataTables_paginate .paginate_button {
    padding: 5px 10px;
    margin: 0 2px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white !important;
    color: #333 !important;
}

.dataTables_paginate .paginate_button.current {
    background: var(--primary-color) !important;
    color: white !important;
    border-color: var(--primary-color);
}

.dataTables_paginate .paginate_button:hover {
    background-color: #e9ecef !important;
    color: #333 !important;
}

@media (max-width: 768px) {
    .table-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .table-controls {
        width: 100%;
        justify-content: space-between;
    }

    .table-search input {
        width: 200px;
    }

    .price-data-table {
        display: block;
        overflow-x: auto;
    }
}

<style>
     /* 🔹 غیرفعال کردن کامل حالت تاریک - فقط برای سطرهای جدول */
 :root, html {
     color-scheme: light only !important;
 }

/* فورس کردن حالت روشن فقط برای tbody (بدنه جدول) */
tbody tr {
    background-color: white !important;
}

tbody tr.bg-white {
    background-color: #ffffff !important;
}

tbody tr.bg-gray-50 {
    background-color: #f9fafb !important;
}

tbody tr:hover {
    background-color: #f3f4f6 !important;
}

/* فورس کردن رنگ متن سطرهای جدول */
tbody td {
    color: #1f2937 !important;
}

/* اجبار به حالت روشن در Dark Mode سیستم - فقط برای سطرهای جدول */
@media (prefers-color-scheme: dark) {
    tbody tr {
        background-color: white !important;
    }

    tbody tr.bg-white {
        background-color: #ffffff !important;
    }

    tbody tr.bg-gray-50 {
        background-color: #f9fafb !important;
    }

    tbody td {
        color: #1f2937 !important;
    }

    tbody tr:hover {
        background-color: #f3f4f6 !important;
    }
}
/**
 * استایل برای کارخانه‌های محبوب
 * این کد رو به فایل CSS اصلی یا در <style> تگ اضافه کن
 */

/* کارت کارخانه محبوب */
.factory-card.popular-factory {
    border: 2px solid #fbbf24 !important;
    box-shadow: 0 4px 6px -1px rgba(251, 191, 36, 0.1),
    0 2px 4px -1px rgba(251, 191, 36, 0.06) !important;
}

/* انیمیشن لمسی برای کارت‌های محبوب */
.factory-card.popular-factory:hover {
    box-shadow: 0 10px 15px -3px rgba(251, 191, 36, 0.2),
    0 4px 6px -2px rgba(251, 191, 36, 0.1) !important;
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

/* بج کارخانه محبوب */
.factory-card.popular-factory h2 span {
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* آیکون ستاره */
.factory-card.popular-factory h2 svg {
    animation: rotate-star 3s linear infinite;
}

@keyframes rotate-star {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* هدر زرد رنگ برای کارخانه‌های محبوب */
.factory-card.popular-factory .bg-yellow-50 {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .factory-card.popular-factory h2 span {
        font-size: 0.65rem;
        padding: 0.25rem 0.5rem;
    }

    .factory-card.popular-factory h2 svg {
        width: 0.65rem;
        height: 0.65rem;
    }
}