/* Website Templates Marketplace - Client Custom Styles (RTL) */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&display=swap');

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --secondary: #7c3aed;
    --whatsapp: #16a34a;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 5.5rem;
    font-family: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    font-family: 'Cairo', system-ui, -apple-system, sans-serif;
    background-color: #f8fafc;
    color: #0f172a;
    overflow-x: hidden;
}

/* تأثيرات البطاقات والانتقالات السلسة */
.template-card {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.template-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 35px -10px rgba(79, 70, 229, 0.16), 0 8px 16px -6px rgba(15, 23, 42, 0.08);
}

.template-card .card-image {
    transition: transform 0.5s ease;
}

.template-card:hover .card-image {
    transform: scale(1.05);
}

/* أزرار الفلترة والتصنيفات */
.category-pill {
    transition: all 0.22s ease;
}

.category-pill.active {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 8px 20px -4px rgba(79, 70, 229, 0.45);
}

/* حاوية المعاينة الحية Live Preview Viewport Switcher مع دعم CSS Scale */
.preview-stage {
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
    min-height: 660px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 1.5rem 1rem;
    overflow: hidden;
    position: relative;
    max-width: 100%;
}

@media (max-width: 640px) {
    .preview-stage {
        min-height: 480px;
        padding: 0.75rem 0.25rem;
    }
}

.preview-scale-Slot {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    overflow: hidden;
}

.preview-device-wrapper {
    transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                height 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                border-radius 0.35s ease,
                border-width 0.35s ease;
    background: #ffffff;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.65);
    overflow: hidden;
    position: relative;
    transform-origin: top center;
    flex-shrink: 0;
}

/* وضع الكمبيوتر Desktop (أبعاد سطح مكتب حقيقية 1366px مع تحجيم تلقائي CSS Scale) */
.preview-device-wrapper.device-desktop {
    width: 1366px;
    height: 768px;
    border-radius: 14px;
    border: 3px solid #334155;
}

/* وضع التابلت Tablet */
.preview-device-wrapper.device-tablet {
    width: 768px;
    height: 740px;
    border-radius: 24px;
    border: 12px solid #1e293b;
    box-shadow: 0 0 0 2px #475569, 0 25px 60px -15px rgba(0, 0, 0, 0.75);
}

/* وضع الجوال Mobile */
.preview-device-wrapper.device-mobile {
    width: 390px;
    height: 720px;
    border-radius: 36px;
    border: 14px solid #0f172a;
    box-shadow: 0 0 0 2px #475569, 0 25px 60px -15px rgba(0, 0, 0, 0.8);
}

.preview-device-wrapper iframe {
    width: 100%;
    height: 100%;
    border: 0;
    background: #ffffff;
    display: block;
}

/* شريط التمرير المخصص */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
