/**
 * Custom Styles - Premium Design with Smooth Animations
 * Inspired by modern e-commerce sites
 */

/* Import Google Fonts for better typography */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Cairo:wght@300;400;600;700;800;900&display=swap');

/* RTL Support */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
    font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
}

[dir="ltr"] {
    direction: ltr;
    text-align: left;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Base typography improvements */
body {
    font-weight: 400;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* Smooth page transitions */
* {
    transition-property: color, background-color, border-color, transform, opacity, box-shadow;
    transition-duration: 0.3s;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom scrollbar - Red & Black theme */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #000000;
}

::-webkit-scrollbar-thumb {
    background: #dc2626;
    border-radius: 5px;
    border: 2px solid #000000;
}

::-webkit-scrollbar-thumb:hover {
    background: #b91c1c;
}

/* Product card hover effect - Premium animation */
.product-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e5e7eb;
    position: relative;
    overflow: hidden;
    will-change: transform;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.05) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
    pointer-events: none;
}

.product-card:hover::before {
    opacity: 1;
}

.product-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 40px rgba(220, 38, 38, 0.15), 0 0 0 1px rgba(220, 38, 38, 0.1);
    border-color: #dc2626;
}

.product-card img {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover img {
    transform: scale(1.1);
}

/* Premium Button animations */
.btn-primary {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    transform: translate(-50%, -50%);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1), height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

.btn-primary:hover::before {
    width: 400px;
    height: 400px;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 30px rgba(220, 38, 38, 0.35), 0 0 0 0 rgba(220, 38, 38, 0.4);
}

.btn-primary:active {
    transform: translateY(-1px) scale(0.98);
    transition: all 0.1s ease;
}

/* Mobile menu animation - Smooth slide */
#mobileMenu {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    max-height: 0;
    overflow: hidden;
}

#mobileMenu:not(.hidden) {
    max-height: 500px;
    animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
}

/* Responsive header fixes */
@media (max-width: 1023px) {
    header nav {
        display: none;
    }
    
    header .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (min-width: 1024px) {
    #mobileMenu {
        display: none !important;
    }
}

/* Ensure proper spacing on mobile */
@media (max-width: 640px) {
    header {
        padding: 0;
    }
    
    header .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    header nav a {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus styles for accessibility - Red theme */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #dc2626;
    outline-offset: 2px;
}

/* Custom red accent colors */
.text-red-accent {
    color: #dc2626;
}

.bg-red-accent {
    background-color: #dc2626;
}

.border-red-accent {
    border-color: #dc2626;
}

/* Header enhancements - Premium sticky header */
header {
    backdrop-filter: blur(20px) saturate(180%);
    background: rgba(255, 255, 255, 0.95) !important;
    border-bottom: 2px solid #dc2626;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: visible;
}

header .container {
    overflow: visible;
}

header nav {
    overflow: visible;
}

header nav a {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    overflow: visible;
}

header nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #dc2626;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

header nav a:hover::after,
header nav a.border-red-600::after {
    width: 100%;
}

header nav a:hover {
    color: #dc2626;
    transform: translateY(-1px);
}

/* Ensure navigation text is visible and properly aligned */
header nav a[data-i18n] {
    display: inline-block;
    text-decoration: none;
}

/* Mobile menu improvements */
#mobileMenu {
    overflow: visible;
    max-height: none;
}

#mobileMenu nav a {
    white-space: nowrap;
    overflow: visible;
    text-overflow: ellipsis;
}

/* Hero section gradient - Premium effects */
.hero-gradient {
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 50%, #000000 100%);
    min-height: 600px;
    position: relative;
    overflow: hidden;
}

/* Hero video styling with smooth transitions */
.hero-gradient video {
    object-fit: cover;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-gradient:hover video {
    transform: scale(1.05);
}

/* Hero text animations - Fixed to prevent disappearing */
.hero-gradient h1 {
    opacity: 1 !important;
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-fill-mode: both;
}

.hero-gradient p {
    opacity: 1 !important;
    animation: fadeInUp 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-fill-mode: both;
}

.hero-gradient a {
    opacity: 1 !important;
    animation: fadeInUp 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-fill-mode: both;
    position: relative;
    z-index: 10;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1 !important;
        transform: translateY(0);
    }
}

/* Category card hover - Smooth premium animation */
.category-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(220, 38, 38, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    z-index: 0;
}

.category-card:hover::before {
    width: 300px;
    height: 300px;
}

.category-card > * {
    position: relative;
    z-index: 1;
}

.category-card:hover {
    border-color: #dc2626;
    background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%);
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 15px 35px rgba(220, 38, 38, 0.15);
}

/* Price styling - Premium typography */
.price-red {
    color: #dc2626;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-size: 1.5rem;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(220, 38, 38, 0.1);
}

/* Cart badge - Premium animation */
.cart-badge {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.5);
    animation: pulse 2s infinite, bounce 1s ease-in-out;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.05);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Premium Button styles with advanced effects */
.btn-red {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    border: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-size: 0.875rem;
}

.btn-red::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-red:hover::after {
    left: 100%;
}

.btn-red:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(220, 38, 38, 0.4), 0 0 0 0 rgba(220, 38, 38, 0.5);
}

.btn-red:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.3);
}

.btn-black {
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    color: white;
    border: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.btn-black::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.btn-black:hover::after {
    left: 100%;
}

.btn-black:hover {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4), 0 0 0 0 rgba(0, 0, 0, 0.5);
}

.btn-black:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* Footer styling - Premium design */
footer {
    background: linear-gradient(180deg, #000000 0%, #0a0a0a 100%) !important;
    border-top: 3px solid #dc2626;
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(220, 38, 38, 0.5), transparent);
}

footer a {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

footer a::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: #dc2626;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

footer a:hover::before {
    width: 100%;
}

footer a:hover {
    transform: translateX(5px);
    color: #dc2626;
}

/* Input fields */
input:focus,
textarea:focus,
select:focus {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
}

/* Loading spinner */
.spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #dc2626;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notification styles - Premium animations */
.notification-success {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.4);
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.notification-error {
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

/* Language dropdown styling - Premium Design */
.language-select-wrapper {
    position: relative;
    display: inline-block;
}

.language-select {
    min-width: 140px;
    padding: 0.625rem 2.5rem 0.625rem 1rem !important;
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    background-image: none;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 0.75rem;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.02em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

[dir="rtl"] .language-select {
    padding: 0.625rem 1rem 0.625rem 2.5rem !important;
}

.language-select-wrapper::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 0.875rem;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #dc2626;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

[dir="rtl"] .language-select-wrapper::after {
    right: auto;
    left: 0.875rem;
}

.language-select-wrapper:hover::after,
.language-select-wrapper:focus-within::after {
    transform: translateY(-50%) rotate(180deg);
}

.language-select:hover {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-color: #dc2626;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
    transform: translateY(-2px);
}

.language-select:focus {
    outline: none;
    border-color: #dc2626;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2), 0 4px 12px rgba(220, 38, 38, 0.3);
    transform: translateY(-2px);
}

.language-select option {
    background-color: #000000;
    color: white;
    padding: 0.75rem 1rem;
    font-weight: 600;
}

.language-select option:hover {
    background-color: #dc2626;
}

/* Language icon styling */
.language-icon {
    display: inline-block;
    margin-left: 0.5rem;
    font-size: 1.125rem;
}

[dir="rtl"] .language-icon {
    margin-left: 0;
    margin-right: 0.5rem;
}

/* Smooth fade-in animations for content */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animate elements on scroll */
.animate-on-scroll {
    opacity: 1 !important;
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-fill-mode: both;
}

/* Smooth transitions for all interactive elements */
a, button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced input focus effects */
input:focus,
textarea:focus,
select:focus {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1) !important;
    transform: scale(1.01);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Premium card shadows */
.shadow-premium {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.shadow-premium:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Table enhancements */
table {
    border-collapse: separate;
    border-spacing: 0;
}

table thead th {
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-size: 0.75rem;
}

table tbody tr {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

table tbody tr:hover {
    background: rgba(220, 38, 38, 0.03);
    transform: scale(1.01);
}

/* Smooth image loading */
img {
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Keep lazy images visible even without JS; optional .loaded class can be used for fade-in */
img[loading="lazy"] {
    opacity: 1;
}

img[loading="lazy"].loaded {
    animation: fadeIn 0.4s ease;
}

/* Premium form inputs */
input[type="text"],
input[type="email"],
input[type="number"],
input[type="tel"],
textarea,
select {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid #e5e7eb;
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="number"]:hover,
input[type="tel"]:hover,
textarea:hover,
select:hover {
    border-color: #dc2626;
}

/* Loading states */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Smooth page transitions */
.page-transition {
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced link styles */
a {
    position: relative;
    text-decoration: none;
}

a:not(.btn-red):not(.btn-black):not(.category-card) {
    transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Premium section spacing */
section {
    position: relative;
    overflow: hidden;
}

/* Gradient text effect */
.gradient-text {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

