/**
 * سامانه مدیریت کاروان‌های زیارتی
 * استایل‌های جامع حالت روشن (Light Mode) و حالت تاریک (Dark Mode)
 * پشتیبانی کامل از وب‌سایت و پنل مدیریت وردپرسی
 */

/* =========================================================
   ۱. ترنزیشن‌های نرم برای تغییر روان تم در تمام عناصر
   ========================================================= */
body, 
.islami-bg, 
.rogh-card, 
header, 
footer, 
input, 
select, 
textarea, 
#themeToggleButton,
#adminThemeToggle,
#adminmenumain,
#wpadminbar,
#wpfooter {
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

/* =========================================================
   ۲. دکمه شناور تغییر حالت روز / شب در وب‌سایت (گوشه بالا چپ)
   ========================================================= */
#themeToggleButton {
    position: fixed;
    top: 5px;
    left: 12px;
    z-index: 99999;
    cursor: pointer;
    user-select: none;
    outline: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* در حالت روشن سایت */
html:not(.dark) #themeToggleButton {
    background-color: rgba(255, 255, 255, 0.95);
    color: #1e293b;
    border: 1px solid rgba(217, 119, 6, 0.4);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.05);
}
html:not(.dark) #themeToggleButton:hover {
    background-color: #ffffff;
    border-color: #d97706;
    color: #b45309;
    box-shadow: 0 6px 22px rgba(217, 119, 6, 0.2);
}

/* در حالت تاریک سایت */
html.dark #themeToggleButton {
    background-color: rgba(2, 20, 16, 0.94);
    color: #fef08a;
    border: 1px solid rgba(245, 158, 11, 0.45);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
}
html.dark #themeToggleButton:hover {
    background-color: #03241d;
    border-color: #f59e0b;
    color: #fde047;
    box-shadow: 0 6px 25px rgba(245, 158, 11, 0.25);
}

@media (max-width: 639px) {
    #themeToggleButton {
        top: 6px;
        left: 8px;
        padding: 4px 7px;
    }
}

/* =========================================================
   ۳. استایل‌های جامع حالت روشن (Light Mode) برای وب‌سایت
   وقتی کلاس dark روی تگ html وجود ندارد:
   ========================================================= */

/* پس‌زمینه و رنگ متن عمومی */
html:not(.dark) body {
    background-color: #f6f8f7 !important;
    color: #0f172a !important;
}

html:not(.dark) .islami-bg {
    background-color: #f6f8f7 !important;
    background-image: radial-gradient(rgba(5, 150, 105, 0.22) 1.2px, transparent 1.2px), radial-gradient(rgba(203, 213, 225, 0.85) 1.2px, #f6f8f7 1.2px) !important;
    background-size: 38px 38px !important;
    background-position: 0 0, 19px 19px !important;
}

/* کارت‌های کتیبه‌ای (Rogh Card) در حالت روشن */
html:not(.dark) .rogh-card {
    background: #ffffff !important;
    border: 1px solid rgba(217, 119, 6, 0.28) !important;
    box-shadow: 0 10px 30px -5px rgba(6, 78, 59, 0.07), 0 2px 8px -2px rgba(0, 0, 0, 0.04) !important;
    color: #0f172a !important;
}

/* متن‌ها و عناوین در حالت روشن */
html:not(.dark) .text-white {
    color: #0f172a !important;
}

html:not(.dark) .text-slate-100,
html:not(.dark) .text-slate-200,
html:not(.dark) .text-slate-300 {
    color: #334155 !important;
}

html:not(.dark) .text-slate-400 {
    color: #64748b !important;
}

html:not(.dark) .text-slate-500 {
    color: #475569 !important;
}

html:not(.dark) .text-amber-200,
html:not(.dark) .text-amber-200\/90,
html:not(.dark) .text-amber-200\/80 {
    color: #92400e !important;
}

html:not(.dark) .text-amber-300 {
    color: #b45309 !important;
}

html:not(.dark) .text-amber-400 {
    color: #d97706 !important;
}

html:not(.dark) .text-emerald-300,
html:not(.dark) .text-emerald-400 {
    color: #047857 !important;
}

html:not(.dark) .text-teal-300 {
    color: #0f766e !important;
}

/* گرادینت طلایی تیترها در حالت روشن */
html:not(.dark) .gold-gradient-text {
    background: linear-gradient(135deg, #b45309 0%, #d97706 45%, #047857 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

/* نوار متبرک بالای صفحه در حالت روشن */
html:not(.dark) .bg-gradient-to-r.from-\[\#021813\] {
    background: linear-gradient(to right, #064e3b, #047857, #064e3b) !important;
    border-bottom: 1px solid rgba(245, 158, 11, 0.4) !important;
}
html:not(.dark) .bg-gradient-to-r.from-\[\#021813\] span,
html:not(.dark) .bg-gradient-to-r.from-\[\#021813\] a {
    color: #fef3c7 !important;
}
html:not(.dark) .bg-gradient-to-r.from-\[\#021813\] a:hover {
    color: #ffffff !important;
}

/* هدر اصلی شیشه‌ای وب‌سایت در حالت روشن */
html:not(.dark) header.bg-\[\#051f19\]\/90,
html:not(.dark) header.bg-\[\#051f19\],
html:not(.dark) header:not(#wpadminbar) {
    background-color: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(12px) !important;
    border-bottom: 1px solid rgba(217, 119, 6, 0.22) !important;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05) !important;
}

html:not(.dark) header:not(#wpadminbar) a span.text-white {
    color: #064e3b !important;
}
html:not(.dark) header:not(#wpadminbar) a:hover span.text-white {
    color: #b45309 !important;
}
html:not(.dark) header:not(#wpadminbar) nav a {
    color: #334155 !important;
}
html:not(.dark) header:not(#wpadminbar) nav a:hover {
    color: #b45309 !important;
}

/* کادرهای فرعی، جعبه‌ها و پس‌زمینه‌های تیره در حالت روشن */
html:not(.dark) .bg-\[\#031712\],
html:not(.dark) .bg-\[\#031712\]\/80,
html:not(.dark) .bg-\[\#02100d\],
html:not(.dark) .bg-\[\#041c16\],
html:not(.dark) .bg-\[\#051c16\],
html:not(.dark) .bg-\[\#031914\],
html:not(.dark) .bg-black\/30,
html:not(.dark) .bg-black\/20 {
    background-color: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #1e293b !important;
}

/* کادرهای گرادینت تیره */
html:not(.dark) .from-\[\#02100d\] {
    --tw-gradient-from: #f8fafc var(--tw-gradient-from-position) !important;
    --tw-gradient-to: rgb(248 250 252 / 0) var(--tw-gradient-to-position) !important;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important;
}
html:not(.dark) .to-\[\#041a14\] {
    --tw-gradient-to: #f1f5f9 var(--tw-gradient-to-position) !important;
}

/* کادرهای برجسته با تم سبز زمرّدی ملایم */
html:not(.dark) .bg-\[\#0b3328\],
html:not(.dark) .bg-\[\#082921\] {
    background-color: #ecfdf5 !important;
    border-color: #a7f3d0 !important;
    color: #065f46 !important;
}

/* دکمه‌های ثانویه با کادر سبز در حالت روشن */
html:not(.dark) a.bg-\[\#082921\],
html:not(.dark) button.bg-\[\#082921\] {
    background-color: #f0fdf4 !important;
    color: #065f46 !important;
    border: 1px solid #10b981 !important;
}
html:not(.dark) a.bg-\[\#082921\]:hover,
html:not(.dark) button.bg-\[\#082921\]:hover {
    background-color: #dcfce7 !important;
    color: #047857 !important;
}

/* نشان‌ها و بج‌های وضعیت (Badges & Pills) */
html:not(.dark) .bg-emerald-500\/20 {
    background-color: #d1fae5 !important;
    border-color: #34d399 !important;
    color: #065f46 !important;
}
html:not(.dark) .bg-rose-500\/20 {
    background-color: #ffe4e6 !important;
    border-color: #fb7185 !important;
    color: #9f1239 !important;
}
html:not(.dark) .bg-amber-500\/20 {
    background-color: #fef3c7 !important;
    border-color: #fcd34d !important;
    color: #92400e !important;
}

/* پیام‌ها و هشدارهای سیستم در حالت روشن */
html:not(.dark) .bg-emerald-950\/70,
html:not(.dark) .bg-emerald-950\/80 {
    background-color: #ecfdf5 !important;
    border-color: #a7f3d0 !important;
    color: #065f46 !important;
}
html:not(.dark) .bg-rose-950\/70,
html:not(.dark) .bg-rose-950\/80 {
    background-color: #fff1f2 !important;
    border-color: #fecdd3 !important;
    color: #9f1239 !important;
}
html:not(.dark) .from-rose-950\/90 {
    background: linear-gradient(to right, #fff1f2, #ffe4e6) !important;
    border-color: #fb7185 !important;
    color: #881337 !important;
}
html:not(.dark) .from-rose-950\/90 .text-white {
    color: #881337 !important;
    background-color: #ffffff !important;
    border-color: #fecdd3 !important;
}
html:not(.dark) .from-emerald-950\/90 {
    background: linear-gradient(to right, #ecfdf5, #d1fae5) !important;
    border-color: #34d399 !important;
    color: #064e3b !important;
}
html:not(.dark) .from-emerald-950\/90 h3 {
    color: #064e3b !important;
}
html:not(.dark) .from-emerald-950\/90 p {
    color: #047857 !important;
}

/* فیلدهای ورودی فرم‌ها در حالت روشن */
html:not(.dark) input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]),
html:not(.dark) select,
html:not(.dark) textarea {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

html:not(.dark) input::placeholder,
html:not(.dark) textarea::placeholder {
    color: #94a3b8 !important;
}

html:not(.dark) input:focus,
html:not(.dark) select:focus,
html:not(.dark) textarea:focus {
    border-color: #d97706 !important;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.18) !important;
    outline: none !important;
}

html:not(.dark) label.text-slate-200,
html:not(.dark) label.text-white,
html:not(.dark) label {
    color: #1e293b !important;
}

/* فوتر سایت در حالت روشن */
html:not(.dark) footer.bg-\[\#020d0b\],
html:not(.dark) footer:not(#wpfooter) {
    background-color: #ffffff !important;
    border-top: 1px solid rgba(217, 119, 6, 0.22) !important;
    color: #475569 !important;
}

html:not(.dark) footer:not(#wpfooter) h4 {
    color: #0f172a !important;
    border-color: rgba(217, 119, 6, 0.2) !important;
}

html:not(.dark) footer:not(#wpfooter) p,
html:not(.dark) footer:not(#wpfooter) a,
html:not(.dark) footer:not(#wpfooter) span {
    color: #475569;
}

html:not(.dark) footer:not(#wpfooter) a:hover {
    color: #b45309 !important;
}

html:not(.dark) footer:not(#wpfooter) .bg-\[\#041c16\] {
    background-color: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #334155 !important;
}

html:not(.dark) footer:not(#wpfooter) .border-t.border-white\/5 {
    border-color: #e2e8f0 !important;
}

/* جزئیات آکاردئون پرسش و پاسخ (FAQ) */
html:not(.dark) details.rogh-card {
    background: #ffffff !important;
    border-color: rgba(217, 119, 6, 0.25) !important;
}

html:not(.dark) details summary {
    color: #0f172a !important;
}

html:not(.dark) details .text-slate-300 {
    color: #334155 !important;
    border-color: #f1f5f9 !important;
}

/* جدول‌ها و خطوط جداکننده */
html:not(.dark) .border-amber-500\/20,
html:not(.dark) .border-amber-500\/30,
html:not(.dark) .border-amber-500\/40 {
    border-color: rgba(217, 119, 6, 0.25) !important;
}

html:not(.dark) .border-white\/5,
html:not(.dark) .border-white\/10 {
    border-color: #e2e8f0 !important;
}

/* مقالات وبلاگ در single.php */
html:not(.dark) .article-content {
    color: #1e293b !important;
}
html:not(.dark) .article-content h2,
html:not(.dark) .article-content h3 {
    color: #064e3b !important;
}

/* =========================================================
   ۴. استایل‌های اختصاصی پنل مدیریت وردپرسی در حالت روشن
   ========================================================= */

/* نوار ابزار بالای وردپرس (#wpadminbar) در حالت روشن */
html:not(.dark) #wpadminbar {
    background-color: #ffffff !important;
    border-bottom: 1px solid rgba(217, 119, 6, 0.25) !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06) !important;
    color: #0f172a !important;
}

html:not(.dark) #wpadminbar a,
html:not(.dark) #wpadminbar button,
html:not(.dark) #wpadminbar span {
    color: #334155;
}

html:not(.dark) #wpadminbar strong {
    color: #b45309 !important;
}

html:not(.dark) #wpadminbar a:hover,
html:not(.dark) #wpadminbar button:hover {
    color: #b45309 !important;
}

html:not(.dark) #adminThemeToggle {
    background-color: #f8fafc !important;
    border-color: rgba(217, 119, 6, 0.3) !important;
    color: #b45309 !important;
}
html:not(.dark) #adminThemeToggle:hover {
    background-color: #fef3c7 !important;
    border-color: #d97706 !important;
    color: #92400e !important;
}

/* دراپ‌داون‌های نوار ادمین وردپرس */
html:not(.dark) #wpadminbar .group-hover\:block {
    background-color: #ffffff !important;
    border-color: rgba(217, 119, 6, 0.3) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12) !important;
}

html:not(.dark) #wpadminbar .group-hover\:block a {
    color: #334155 !important;
}

html:not(.dark) #wpadminbar .group-hover\:block a:hover {
    background-color: #fef3c7 !important;
    color: #92400e !important;
}

html:not(.dark) #wpadminbar .bg-\[\#020f0c\] {
    background-color: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

/* سایدبار راست وردپرس (#adminmenumain) در حالت روشن */
html:not(.dark) #adminmenumain {
    background-color: #ffffff !important;
    border-left: 1px solid rgba(217, 119, 6, 0.2) !important;
    box-shadow: -2px 0 12px rgba(0, 0, 0, 0.03) !important;
}

html:not(.dark) .wp-custom-scrollbar::-webkit-scrollbar-track {
    background: #ffffff !important;
}
html:not(.dark) .wp-custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(217, 119, 6, 0.25) !important;
}

html:not(.dark) .wp-menu-link {
    color: #334155 !important;
}
html:not(.dark) .wp-menu-link:hover {
    background-color: #f8fafc !important;
    color: #b45309 !important;
}
html:not(.dark) .wp-menu-link .wp-menu-icon {
    color: #d97706 !important;
}

/* آیتم فعال منوی وردپرس */
html:not(.dark) .wp-menu-item.active-menu-item > .wp-menu-link {
    background: #f59e0b !important;
    color: #020617 !important;
    font-weight: 800 !important;
}
html:not(.dark) .wp-menu-item.active-menu-item > .wp-menu-link .wp-menu-icon {
    color: #020617 !important;
}
html:not(.dark) .wp-menu-item.active-menu-item > .wp-menu-link::after {
    border-left-color: #f6f8f7 !important;
}

/* زیرمنوی درون‌خطی وردپرس */
html:not(.dark) .wp-submenu-inline {
    background-color: #f8fafc !important;
    border-right-color: #f59e0b !important;
}
html:not(.dark) .wp-submenu-inline a {
    color: #475569 !important;
}
html:not(.dark) .wp-submenu-inline a:hover {
    color: #b45309 !important;
    background-color: #f1f5f9 !important;
}

/* زیرمنوی معلق شناور (Flyout) */
html:not(.dark) .wp-flyout-menu {
    background-color: #ffffff !important;
    border-color: rgba(217, 119, 6, 0.35) !important;
    box-shadow: -8px 12px 30px rgba(0, 0, 0, 0.12) !important;
}
html:not(.dark) .wp-flyout-menu .bg-\[\#020f0c\] {
    background-color: #f8fafc !important;
    color: #b45309 !important;
    border-bottom-color: #e2e8f0 !important;
}
html:not(.dark) .wp-flyout-menu a {
    color: #334155 !important;
}
html:not(.dark) .wp-flyout-menu a:hover {
    background-color: #fef3c7 !important;
    color: #92400e !important;
}

/* دکمه جمع کردن منوی سایدبار در پایین */
html:not(.dark) #adminmenumain .border-t {
    background-color: #ffffff !important;
    border-top-color: #e2e8f0 !important;
}
html:not(.dark) #collapse-button {
    color: #64748b !important;
}
html:not(.dark) #collapse-button:hover {
    color: #b45309 !important;
    background-color: #f8fafc !important;
}

/* هدر سایدبار موبایل */
html:not(.dark) #adminmenumain .bg-\[\#031511\] {
    background-color: #f8fafc !important;
    border-bottom-color: #e2e8f0 !important;
}
html:not(.dark) #adminmenumain .bg-\[\#031511\] span.text-white {
    color: #064e3b !important;
}

/* فوتر پنل ادمین */
html:not(.dark) #wpfooter {
    background-color: #ffffff !important;
    border-top: 1px solid #e2e8f0 !important;
    color: #64748b !important;
}
html:not(.dark) #wpfooter span {
    color: #475569 !important;
}

/* جدول‌ها و سطرهای داده‌ها در پنل مدیریت */
html:not(.dark) table {
    color: #1e293b !important;
}
html:not(.dark) thead tr,
html:not(.dark) th {
    background-color: #f8fafc !important;
    color: #0f172a !important;
    border-color: #e2e8f0 !important;
}
html:not(.dark) tbody tr {
    border-color: #f1f5f9 !important;
}
html:not(.dark) tbody tr:hover {
    background-color: #f8fafc !important;
}
html:not(.dark) td {
    border-color: #e2e8f0 !important;
    color: #334155 !important;
}
html:not(.dark) td strong {
    color: #0f172a !important;
}

/* باکس‌های آماری و هشدارهای ادمین */
html:not(.dark) .bg-emerald-950\/60 {
    background-color: #ecfdf5 !important;
    border-color: #a7f3d0 !important;
    color: #065f46 !important;
}
html:not(.dark) .bg-rose-950\/60,
html:not(.dark) .bg-rose-950\/70 {
    background-color: #fff1f2 !important;
    border-color: #fecdd3 !important;
    color: #9f1239 !important;
}
html:not(.dark) .bg-amber-950\/60 {
    background-color: #fef3c7 !important;
    border-color: #fde68a !important;
    color: #92400e !important;
}

html:not(.dark) .text-amber-200\/70,
html:not(.dark) .text-amber-200\/80 {
    color: #92400e !important;
}

html:not(.dark) .bg-\[\#041c16\],
html:not(.dark) .bg-\[\#031712\],
html:not(.dark) .bg-\[\#051c16\],
html:not(.dark) .bg-\[\#031c16\],
html:not(.dark) .bg-\[\#04241d\],
html:not(.dark) .bg-\[\#02100d\],
html:not(.dark) .bg-\[\#031511\],
html:not(.dark) .bg-\[\#020f0c\],
html:not(.dark) .bg-\[\#031914\],
html:not(.dark) .bg-\[\#020b09\],
html:not(.dark) .bg-\[\#041411\] {
    background-color: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #1e293b !important;
}

html:not(.dark) .border-amber-500\/15,
html:not(.dark) .border-amber-500\/20,
html:not(.dark) .border-amber-500\/25,
html:not(.dark) .border-amber-500\/30,
html:not(.dark) .border-amber-500\/40,
html:not(.dark) .border-amber-500\/50 {
    border-color: rgba(217, 119, 6, 0.25) !important;
}

/* اصلاح تضاد رنگی لینک‌ها و آیکون‌های درون کارت‌ها در حالت روشن ادمین */
html:not(.dark) .text-slate-200,
html:not(.dark) .text-slate-300 {
    color: #334155 !important;
}

html:not(.dark) label.text-slate-200,
html:not(.dark) label.text-slate-300 {
    color: #1e293b !important;
    font-weight: 700 !important;
}

