/* assets/css/theme.css */

/* به مرورگر می‌گوید هر دو تم را پشتیبانی می‌کنیم */
:root {
    color-scheme: light dark;
}

/* تم ولنتاین: Ruby Ganache */
body.theme-valentine,
body[data-theme="valentine_ruby"] {
    background-image:
        var(--valentine-heart-small, url("../images/patterns/valentine-hearts-small.svg")),
        var(--valentine-heart-large, url("../images/patterns/valentine-hearts-large.svg")),
        radial-gradient(circle at top, #fff0f4 0, #f9d6e2 45%, #f2b7c9 100%);
    background-repeat: repeat, repeat, no-repeat;
    background-size: 300px 300px, 420px 420px, auto;
    background-position: 28px 36px, 92px 78px, center;
    color: #3c2a21;
}

.theme-valentine .bg-cream,
body[data-theme="valentine_ruby"] .bg-cream { background-color: #fff6f8 !important; }
.theme-valentine .bg-creamDeep,
body[data-theme="valentine_ruby"] .bg-creamDeep { background-color: #f7d6e1 !important; }
.theme-valentine .bg-creamDeep\/70,
body[data-theme="valentine_ruby"] .bg-creamDeep\/70 { background-color: rgba(247, 214, 225, 0.7) !important; }
.theme-valentine .bg-creamDeep\/60,
body[data-theme="valentine_ruby"] .bg-creamDeep\/60 { background-color: rgba(247, 214, 225, 0.6) !important; }
.theme-valentine .bg-cream\/90,
body[data-theme="valentine_ruby"] .bg-cream\/90 { background-color: rgba(255, 246, 248, 0.9) !important; }
.theme-valentine .bg-white,
body[data-theme="valentine_ruby"] .bg-white { background-color: #ffffff !important; }

.theme-valentine .text-brownDark,
body[data-theme="valentine_ruby"] .text-brownDark { color: #3c2a21 !important; }
.theme-valentine .text-brownLight,
body[data-theme="valentine_ruby"] .text-brownLight { color: #b1124a !important; }
.theme-valentine .text-brownLight\/70,
body[data-theme="valentine_ruby"] .text-brownLight\/70 { color: rgba(177, 18, 74, 0.7) !important; }

.theme-valentine .text-brownDark\/70,
body[data-theme="valentine_ruby"] .text-brownDark\/70 { color: rgba(60, 42, 33, 0.7) !important; }
.theme-valentine .text-brownDark\/80,
body[data-theme="valentine_ruby"] .text-brownDark\/80 { color: rgba(60, 42, 33, 0.8) !important; }
.theme-valentine .text-brownDark\/60,
body[data-theme="valentine_ruby"] .text-brownDark\/60 { color: rgba(60, 42, 33, 0.6) !important; }

.theme-valentine .border-brownLight,
body[data-theme="valentine_ruby"] .border-brownLight { border-color: rgba(177, 18, 74, 0.25) !important; }
.theme-valentine .border-brownLight\/20,
body[data-theme="valentine_ruby"] .border-brownLight\/20 { border-color: rgba(177, 18, 74, 0.2) !important; }
.theme-valentine .border-brownLight\/30,
body[data-theme="valentine_ruby"] .border-brownLight\/30 { border-color: rgba(177, 18, 74, 0.3) !important; }

.theme-valentine .bg-brownDark,
body[data-theme="valentine_ruby"] .bg-brownDark { background-color: #b1124a !important; }
.theme-valentine .bg-brownDark\/10,
body[data-theme="valentine_ruby"] .bg-brownDark\/10 { background-color: rgba(177, 18, 74, 0.1) !important; }
.theme-valentine .border-brownDark,
body[data-theme="valentine_ruby"] .border-brownDark { border-color: #8b0d38 !important; }
.theme-valentine .hover\:bg-brownLight:hover,
body[data-theme="valentine_ruby"] .hover\:bg-brownLight:hover { background-color: #c31a5a !important; }

/* حالت پیش‌فرض (لایت) – چیزی شبیه تم فعلی تو */
body {
    background: radial-gradient(circle at top, #fdf5ee 0, #f4e8da 45%, #e3d0b8 100%);
    color: #3c2a21;
}

/* دارک‌مود براساس تنظیمات سیستم */
@media (prefers-color-scheme: dark) {

    :root {
        color-scheme: dark;
    }

    body {
        background: radial-gradient(circle at top, #1a1310 0, #0f0a07 45%, #070504 100%);
        color: #ffffff;
    }

    /* پس‌زمینه‌های روشن را به کارت‌های تیره تبدیل کن */
    .bg-cream {
        background-color: #1b140f !important;
    }

    .bg-white {
        background-color: #140e0a !important;
    }

    .bg-creamDeep {
        background-color: #201710 !important;
    }

    .bg-cream\/30 { background-color: rgba(32, 23, 16, 0.3) !important; }
    .bg-cream\/40 { background-color: rgba(32, 23, 16, 0.4) !important; }
    .bg-cream\/50 { background-color: rgba(32, 23, 16, 0.5) !important; }
    .bg-cream\/60 { background-color: rgba(32, 23, 16, 0.6) !important; }
    .bg-cream\/70 { background-color: rgba(32, 23, 16, 0.7) !important; }
    .bg-cream\/80 { background-color: rgba(32, 23, 16, 0.8) !important; }
    .bg-cream\/90 { background-color: rgba(32, 23, 16, 0.9) !important; }
    .bg-cream\/95 { background-color: rgba(32, 23, 16, 0.95) !important; }
    .bg-creamDeep\/50 { background-color: rgba(32, 23, 16, 0.5) !important; }
    .bg-creamDeep\/60 { background-color: rgba(32, 23, 16, 0.6) !important; }
    .bg-creamDeep\/70 { background-color: rgba(32, 23, 16, 0.7) !important; }
    .bg-white\/40 { background-color: rgba(20, 14, 10, 0.4) !important; }
    .bg-white\/50 { background-color: rgba(20, 14, 10, 0.5) !important; }
    .bg-white\/60 { background-color: rgba(20, 14, 10, 0.6) !important; }
    .bg-white\/70 { background-color: rgba(20, 14, 10, 0.7) !important; }

    /* رنگ متن قهوه‌ای تیره در دارک باید روشن بشود */
    .text-brownDark {
        color: #ffffff !important;
    }
    .text-brownDark\/90 { color: #ffffff !important; }
    .text-brownDark\/80 { color: #ffffff !important; }
    .text-brownDark\/75 { color: #ffffff !important; }
    .text-brownDark\/70 { color: #ffffff !important; }
    .text-brownDark\/60 { color: #ffffff !important; }
    .text-brownDark\/50 { color: #ffffff !important; }
    .text-brownDark\/30 { color: #ffffff !important; }

    .text-brownLight { color: #ffffff !important; }
    .text-brownLight\/70 { color: #ffffff !important; }

    /* بُردرهای قهوه‌ای روشن، کمی روشن‌تر و ظریف‌تر در دارک‌مود */
    .border-brownLight {
        border-color: rgba(238, 210, 183, 0.45) !important;
    }
    .border-brownLight\/10 { border-color: rgba(238, 210, 183, 0.18) !important; }
    .border-brownLight\/15 { border-color: rgba(238, 210, 183, 0.22) !important; }
    .border-brownLight\/20 { border-color: rgba(238, 210, 183, 0.28) !important; }
    .border-brownLight\/25 { border-color: rgba(238, 210, 183, 0.32) !important; }
    .border-brownLight\/30 { border-color: rgba(238, 210, 183, 0.36) !important; }
    .border-brownLight\/35 { border-color: rgba(238, 210, 183, 0.40) !important; }
    .border-brownLight\/40 { border-color: rgba(238, 210, 183, 0.44) !important; }
    .border-brownLight\/50 { border-color: rgba(238, 210, 183, 0.52) !important; }
    .border-brownLight\/70 { border-color: rgba(238, 210, 183, 0.68) !important; }

    /* سایه‌ها در دارک‌مود عمیق‌تر شوند */
    .shadow-sm,
    .shadow,
    .shadow-md,
    .shadow-lg {
        box-shadow: 0 18px 45px rgba(0, 0, 0, 0.7) !important;
    }

    /* هدرهای اصلی سایت (ناوبری) */
    header,
    .site-header {
        background-color: rgba(10, 7, 5, 0.96) !important;
        border-bottom-color: rgba(238, 210, 183, 0.35) !important;
        backdrop-filter: blur(12px);
    }

    /* فوترها */
    footer,
    .site-footer {
        background-color: #080504 !important;
        color: #e9dfd4 !important;
    }

    /* فیلدهای فرم، اینپوت‌ها و ... */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    textarea,
    select {
        background-color: #1a120d !important;
        border-color: rgba(238, 210, 183, 0.45) !important;
        color: #f6eee4 !important;
    }

    input::placeholder,
    textarea::placeholder {
        color: rgba(246, 238, 228, 0.5) !important;
    }

    /* کلاس Tailwind برای پس‌زمینه‌ی خاص لاگین ادمین (bg-[#fdf7f1]) */
    .bg-\[\#fdf7f1\] {
        background-color: #120c08 !important;
    }

    .text-gray-800 { color: #ffffff !important; }
    .text-gray-700 { color: #ffffff !important; }
    .text-gray-500 { color: #ffffff !important; }
    .text-gray-600 { color: #ffffff !important; }
    .bg-gray-50 { background-color: #1a120e !important; }
    .border-gray-200 { border-color: rgba(220, 200, 180, 0.35) !important; }

    .bg-amber-50 { background-color: #2a1c12 !important; }
    .text-amber-800 { color: #ffffff !important; }
    .border-amber-200 { border-color: rgba(244, 217, 181, 0.35) !important; }
}

/* ولنتاین: دارک‌مود غیرفعال (همیشه لایت) */
@media (prefers-color-scheme: dark) {
    body.theme-valentine,
    body[data-theme="valentine_ruby"] {
        color-scheme: light;
        background-image:
            url("../images/patterns/valentine-hearts-small.svg"),
            url("../images/patterns/valentine-hearts-large.svg"),
            radial-gradient(circle at top, #fff0f4 0, #f9d6e2 45%, #f2b7c9 100%);
        background-repeat: repeat, repeat, no-repeat;
        background-size: 300px 300px, 420px 420px, auto;
        background-position: 28px 36px, 92px 78px, center;
        color: #3c2a21 !important;
    }

    body.theme-valentine .bg-cream,
    body[data-theme="valentine_ruby"] .bg-cream { background-color: #fff6f8 !important; }
    body.theme-valentine .bg-creamDeep,
    body[data-theme="valentine_ruby"] .bg-creamDeep { background-color: #f7d6e1 !important; }
    body.theme-valentine .bg-creamDeep\/70,
    body[data-theme="valentine_ruby"] .bg-creamDeep\/70 { background-color: rgba(247, 214, 225, 0.7) !important; }
    body.theme-valentine .bg-creamDeep\/60,
    body[data-theme="valentine_ruby"] .bg-creamDeep\/60 { background-color: rgba(247, 214, 225, 0.6) !important; }
    body.theme-valentine .bg-cream\/90,
    body[data-theme="valentine_ruby"] .bg-cream\/90 { background-color: rgba(255, 246, 248, 0.9) !important; }
    body.theme-valentine .bg-white,
    body[data-theme="valentine_ruby"] .bg-white { background-color: #ffffff !important; }

    body.theme-valentine .text-brownDark,
    body[data-theme="valentine_ruby"] .text-brownDark { color: #3c2a21 !important; }
    body.theme-valentine .text-brownDark\/90,
    body[data-theme="valentine_ruby"] .text-brownDark\/90 { color: #3c2a21 !important; }
    body.theme-valentine .text-brownDark\/80,
    body[data-theme="valentine_ruby"] .text-brownDark\/80 { color: #3c2a21 !important; }
    body.theme-valentine .text-brownDark\/75,
    body[data-theme="valentine_ruby"] .text-brownDark\/75 { color: #3c2a21 !important; }
    body.theme-valentine .text-brownDark\/70,
    body[data-theme="valentine_ruby"] .text-brownDark\/70 { color: #3c2a21 !important; }
    body.theme-valentine .text-brownDark\/60,
    body[data-theme="valentine_ruby"] .text-brownDark\/60 { color: #3c2a21 !important; }
    body.theme-valentine .text-brownDark\/70,
    body[data-theme="valentine_ruby"] .text-brownDark\/70 { color: rgba(60, 42, 33, 0.7) !important; }
    body.theme-valentine .text-brownDark\/80,
    body[data-theme="valentine_ruby"] .text-brownDark\/80 { color: rgba(60, 42, 33, 0.8) !important; }
    body.theme-valentine .text-brownDark\/50,
    body[data-theme="valentine_ruby"] .text-brownDark\/50 { color: #3c2a21 !important; }
    body.theme-valentine .text-brownDark\/30,
    body[data-theme="valentine_ruby"] .text-brownDark\/30 { color: #3c2a21 !important; }

    body.theme-valentine .text-brownLight,
    body[data-theme="valentine_ruby"] .text-brownLight { color: #b1124a !important; }
    body.theme-valentine .text-brownLight\/70,
    body[data-theme="valentine_ruby"] .text-brownLight\/70 { color: rgba(177, 18, 74, 0.7) !important; }

    body.theme-valentine .border-brownLight,
    body[data-theme="valentine_ruby"] .border-brownLight { border-color: rgba(177, 18, 74, 0.25) !important; }
    body.theme-valentine .border-brownLight\/20,
    body[data-theme="valentine_ruby"] .border-brownLight\/20 { border-color: rgba(177, 18, 74, 0.2) !important; }
    body.theme-valentine .border-brownLight\/30,
    body[data-theme="valentine_ruby"] .border-brownLight\/30 { border-color: rgba(177, 18, 74, 0.3) !important; }
    body.theme-valentine .border-brownLight\/40,
    body[data-theme="valentine_ruby"] .border-brownLight\/40 { border-color: rgba(177, 18, 74, 0.35) !important; }

    body.theme-valentine .bg-brownDark\/10,
    body[data-theme="valentine_ruby"] .bg-brownDark\/10 { background-color: rgba(177, 18, 74, 0.1) !important; }

    body.theme-valentine header,
    body[data-theme="valentine_ruby"] header,
    body.theme-valentine .site-header,
    body[data-theme="valentine_ruby"] .site-header {
        background-color: rgba(255, 246, 248, 0.95) !important;
        border-bottom-color: rgba(177, 18, 74, 0.2) !important;
    }

    /* خنثی‌سازی کلاس‌های dark: برای ولنتاین */
    body.theme-valentine .dark\:text-cream\/80,
    body[data-theme="valentine_ruby"] .dark\:text-cream\/80 { color: rgba(60, 42, 33, 0.8) !important; }
    body.theme-valentine .dark\:text-cream,
    body[data-theme="valentine_ruby"] .dark\:text-cream { color: #3c2a21 !important; }
    body.theme-valentine .dark\:text-brownDark,
    body[data-theme="valentine_ruby"] .dark\:text-brownDark { color: #3c2a21 !important; }
    body.theme-valentine .dark\:bg-cream,
    body[data-theme="valentine_ruby"] .dark\:bg-cream { background-color: #fff6f8 !important; }
    body.theme-valentine .dark\:hover\:text-cream:hover,
    body[data-theme="valentine_ruby"] .dark\:hover\:text-cream:hover { color: #3c2a21 !important; }
    body.theme-valentine .dark\:hover\:bg-white\/5:hover,
    body[data-theme="valentine_ruby"] .dark\:hover\:bg-white\/5:hover { background-color: rgba(177, 18, 74, 0.08) !important; }

    /* آیتم‌های فعال هدر باید یاقوتی باقی بمانند */
    body.theme-valentine .bg-brownDark,
    body[data-theme="valentine_ruby"] .bg-brownDark { background-color: #b1124a !important; }
    body.theme-valentine .bg-brownDark.dark\:bg-cream,
    body[data-theme="valentine_ruby"] .bg-brownDark.dark\:bg-cream { background-color: #b1124a !important; }
    body.theme-valentine .bg-brownDark.text-cream,
    body[data-theme="valentine_ruby"] .bg-brownDark.text-cream { color: #ffffff !important; }
    body.theme-valentine .bg-brownDark.dark\:text-brownDark,
    body[data-theme="valentine_ruby"] .bg-brownDark.dark\:text-brownDark { color: #ffffff !important; }

    body.theme-valentine footer,
    body[data-theme="valentine_ruby"] footer,
    body.theme-valentine .site-footer,
    body[data-theme="valentine_ruby"] .site-footer {
        background-color: #fff6f8 !important;
        color: #3c2a21 !important;
    }

    body.theme-valentine input[type="text"],
    body.theme-valentine input[type="email"],
    body.theme-valentine input[type="password"],
    body.theme-valentine input[type="number"],
    body.theme-valentine input[type="tel"],
    body.theme-valentine textarea,
    body.theme-valentine select,
    body[data-theme="valentine_ruby"] input[type="text"],
    body[data-theme="valentine_ruby"] input[type="email"],
    body[data-theme="valentine_ruby"] input[type="password"],
    body[data-theme="valentine_ruby"] input[type="number"],
    body[data-theme="valentine_ruby"] input[type="tel"],
    body[data-theme="valentine_ruby"] textarea,
    body[data-theme="valentine_ruby"] select {
        background-color: #ffffff !important;
        border-color: rgba(177, 18, 74, 0.25) !important;
        color: #3c2a21 !important;
    }

    body.theme-valentine input::placeholder,
    body.theme-valentine textarea::placeholder,
    body[data-theme="valentine_ruby"] input::placeholder,
    body[data-theme="valentine_ruby"] textarea::placeholder {
        color: rgba(60, 42, 33, 0.5) !important;
    }
}
