/* Explain: Base styles, typography, and animations with Dark Mode support. - */
* {
    box-sizing: border-box;
}

html {
    background: var(--background-color);
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
    -webkit-user-select: none;
    user-select: none;
    word-break: break-word;
}

input, textarea, select {
    -webkit-user-select: auto;
    user-select: auto;
}

img {
    -webkit-user-drag: none;
}

[x-cloak] {
    display: none !important;
}

@keyframes marquee-rtl {
    0% { transform: translateX(0); }
    100% { transform: translateX(100%); }
}
.animate-marquee-rtl {
    animation: marquee-rtl 25s linear infinite;
}
.animate-marquee-rtl:hover {
    animation-play-state: paused;
}

@keyframes logo-move {
    0%, 100% { transform: scale(1) translateY(0); filter: drop-shadow(0 0 0 rgba(0,0,0,0)); }
    5% { transform: scale(1.05) translateY(-2px) rotate(2deg); filter: drop-shadow(0 4px 8px rgba(230,0,92,0.3)); }
    10% { transform: scale(1.05) translateY(-2px) rotate(-2deg); }
    15% { transform: scale(1.05) translateY(-2px) rotate(2deg); }
    20% { transform: scale(1) translateY(0) rotate(0); filter: drop-shadow(0 0 0 rgba(0,0,0,0)); }
}
.animate-logo-move {
    animation: logo-move 6s ease-in-out infinite;
    transform-origin: center;
}

/* تحسين بطاقات المنتجات على الجوال لتكون أكثر وضوحاً وسهولة في النقر */
@media (max-width: 768px) {
    .card {
        border-radius: 16px;
        box-shadow: 0 4px 16px rgba(0,0,0,0.08);
        border-color: #eaeaea;
        margin-bottom: 0.75rem;
    }
    .card-body {
        padding: 1rem !important;
        gap: 0.75rem !important;
    }
    .card h2 {
        font-size: 15px !important;
        line-height: 1.5 !important;
        font-weight: 800 !important;
    }
    .card .btn {
        min-height: 48px !important;
        height: 48px !important;
        font-size: 15px !important;
        border-radius: 10px !important;
        font-weight: bold !important;
    }
    .card .wishlist-btn {
        width: 42px !important;
        height: 42px !important;
        top: 10px !important;
        inset-inline-start: 10px !important;
        background-color: #ffffff !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
    }
    .card a, .card button {
        touch-action: manipulation;
    }
    .card .add-to-cart-btn:active {
        transform: scale(0.95);
    }
}

/* وضع الليل (الدارك مود) التلقائي - مريح للعين */
html.dark {
    color-scheme: dark;
}
html.dark body {
    background-color: #121212 !important;
    color: #e5e7eb !important;
}
html.dark .bg-white, html.dark .bg-gray-50, html.dark .bg-gray-100, html.dark .bg-base-100 {
    background-color: #18181b !important;
}
html.dark .bg-gray-50\/50, html.dark .bg-white\/50 {
    background-color: rgba(24, 24, 27, 0.5) !important;
}
html.dark .card, html.dark .modal-box, html.dark .dropdown-content {
    background-color: #18181b !important;
    border-color: #27272a !important;
}
html.dark .text-gray-900, html.dark .text-gray-800, html.dark .text-black {
    color: #f4f4f5 !important;
}
html.dark .text-gray-700, html.dark .text-gray-600 {
    color: #d4d4d8 !important;
}
html.dark .text-gray-500 {
    color: #a1a1aa !important;
}
html.dark .border-gray-100, html.dark .border-gray-200, html.dark .border-gray-300 {
    border-color: #27272a !important;
}
html.dark input.bg-gray-50, html.dark select.bg-gray-50, html.dark textarea.bg-gray-50,
html.dark input.bg-white, html.dark select.bg-white, html.dark textarea.bg-white,
html.dark input, html.dark select, html.dark textarea {
    background-color: #27272a !important;
    border-color: #3f3f46 !important;
    color: #f4f4f5 !important;
}
html.dark .shadow-sm, html.dark .shadow-md, html.dark .shadow-lg, html.dark .shadow-xl {
    box-shadow: 0 4px 10px -1px rgba(0, 0, 0, 0.5) !important;
}
html.dark .hover\:bg-gray-50:hover {
    background-color: #27272a !important;
}
html.dark .hover\:bg-gray-100:hover, html.dark .hover\:bg-gray-200:hover {
    background-color: #3f3f46 !important;
}

/* Hide scrollbar for horizontal scroll areas but keep functionality */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* تحسينات الشاشات الصغيرة جداً (الهواتف القديمة) */
@media (max-width: 380px) {
    .card-body {
        padding: 0.5rem !important;
        gap: 0.25rem !important;
    }
    .grid-cols-2 {
        gap: 0.5rem !important;
    }
    .text-sm {
        font-size: 0.75rem !important;
        line-height: 1rem !important;
    }
    .text-xs {
        font-size: 0.65rem !important;
        line-height: 0.85rem !important;
    }
    .btn-sm {
        height: 2rem !important;
        min-height: 2rem !important;
        font-size: 0.75rem !important;
        padding: 0 0.5rem !important;
    }
}
