/* Custom styles for Taqreer Company Website */

/* Import Cairo font for better Arabic support */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800&display=swap');

/* Root variables */
:root {
    --primary-color: #8e2936;
    --primary-dark: #7a2330;
    --primary-light: #a53344;
    --text-gray: #374151;
    --text-light: #6b7280;
    --bg-gray: #f9fafb;
}

/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

body {
    font-family: 'Cairo', sans-serif;
    line-height: 1.6;
    color: var(--text-gray);
    direction: rtl;
}

/* RTL/LTR support */
.rtl {
    direction: rtl;
    text-align: right;
}

.ltr {
    direction: ltr;
    text-align: left;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Hero section enhancements */
.hero-bg {
    position: relative;
    overflow: hidden;
}

.hero-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(142, 41, 54, 0.8), rgba(142, 41, 54, 0.6));
    z-index: 1;
}

.hero-bg > * {
    position: relative;
    z-index: 2;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in {
    animation: fadeInUp 0.8s ease-out;
}

.fade-in-left {
    animation: fadeInLeft 0.8s ease-out;
}

.fade-in-right {
    animation: fadeInRight 0.8s ease-out;
}

/* Card hover effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Button styles */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Form styles */
.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(142, 41, 54, 0.1);
}

.form-input.error {
    border-color: #ef4444;
}

/* Navigation enhancements */
nav {
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

nav.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
}

/* Navigation Layout Styles */
.rtl-nav,
.ltr-nav {
    transition: all 0.3s ease;
}

/* Ensure proper display based on language */
.rtl .rtl-nav {
    display: flex !important;
}

.rtl .ltr-nav {
    display: none !important;
}

.ltr .rtl-nav {
    display: none !important;
}

.ltr .ltr-nav {
    display: flex !important;
}

/* Navigation link styling */
nav a {
    font-weight: 700 !important;
    letter-spacing: 0.025em;
    position: relative;
}

/* Hover effect for navigation links */
nav a:not(.bg-primary):hover {
    color: var(--primary-color) !important;
}

/* Ensure spacing consistency */
.space-x-6 > * + * {
    margin-left: 1.5rem;
}

.space-x-reverse > * + * {
    margin-right: 1.5rem;
    margin-left: 0;
}

/* Mobile menu styling */
#mobileMenu {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

#mobileMenu a {
    font-weight: 700;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin: 0.125rem 0;
}

/* Language toggle styling */
#languageToggle,
#languageToggleEn,
#languageToggleMobile {
    position: relative;
    font-weight: 700 !important;
}

#languageToggle:hover,
#languageToggleEn:hover,
#languageToggleMobile:hover {
    color: var(--primary-color) !important;
}

/* Ensure language button stays in proper position regardless of direction */
.rtl #languageToggle,
body.rtl #languageToggle {
    margin-right: 1rem !important;
    margin-left: 0 !important;
}

.ltr #languageToggle,
body.ltr #languageToggle {
    margin-left: 1rem !important;
    margin-right: 0 !important;
}

.rtl #mobileMenuButton,
body.rtl #mobileMenuButton {
    margin-right: 1rem !important;
    margin-left: 0 !important;
}

.ltr #mobileMenuButton,
body.ltr #mobileMenuButton {
    margin-left: 1rem !important;
    margin-right: 0 !important;
}

/* Additional safety for navigation spacing */
.rtl .flex.items-center button,
body.rtl .flex.items-center button {
    margin-left: 0 !important;
}

.ltr .flex.items-center button,
body.ltr .flex.items-center button {
    margin-right: 0 !important;
}

/* Step indicator for booking form */
.step-indicator {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: all 0.3s ease;
    border: 2px solid #e5e7eb;
    background-color: white;
    color: #6b7280;
}

.step-indicator.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.step-indicator.completed {
    background-color: #10b981;
    border-color: #10b981;
    color: white;
}

/* Progress line between steps */
.step-line {
    height: 2px;
    background-color: #e5e7eb;
    flex: 1;
    transition: all 0.3s ease;
}

.step-line.completed {
    background-color: #10b981;
}

/* Service selection cards */
.service-card {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: white;
}

.service-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.service-card.selected {
    border-color: var(--primary-color);
    background-color: rgba(142, 41, 54, 0.05);
}

/* FAQ styling */
.faq-item {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
    background-color: white;
}

.faq-toggle {
    width: 100%;
    padding: 20px;
    background-color: white;
    border: none;
    text-align: right;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    color: #1f2937;
}

.faq-toggle:hover {
    background-color: #f9fafb;
}

.faq-content {
    padding: 0 20px 20px;
    background-color: #f9fafb;
    color: #374151;
    border-top: 1px solid #e5e7eb;
}

.faq-content p {
    color: #374151 !important;
    line-height: 1.6;
}

/* Working hours grid */
.working-hours-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.working-hours-card {
    background-color: white;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.working-hours-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Contact section styles */
.contact-info-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}

.contact-icon {
    background-color: var(--primary-color);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Footer enhancements */
footer {
    background: linear-gradient(135deg, #1f2937, #111827);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .hero-bg {
        padding-top: 80px;
        padding-bottom: 40px;
    }
    
    .hero-bg h1 {
        font-size: 2.5rem;
    }
    
    .hero-bg p {
        font-size: 1.125rem;
    }
    
    .step-indicator {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .service-card {
        padding: 16px;
    }
    
    .working-hours-grid {
        grid-template-columns: 1fr;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    :root {
        --text-gray: #f3f4f6;
        --text-light: #d1d5db;
        --bg-gray: #1f2937;
    }
}

/* Print styles */
@media print {
    nav, footer, .hero-bg {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.focus\:ring-primary:focus {
    box-shadow: 0 0 0 3px rgba(142, 41, 54, 0.3);
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Custom utilities */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.backdrop-blur {
    backdrop-filter: blur(10px);
}

.gradient-overlay {
    background: linear-gradient(135deg, rgba(142, 41, 54, 0.9), rgba(142, 41, 54, 0.7));
}

/* LANGUAGE DIRECTION FIXES - HIGH PRIORITY OVERRIDES */
/* These rules use !important to override Tailwind's utility classes */

/* Fix for mr-1 class */
html[dir="rtl"] .mr-1 {
    margin-right: 0 !important;
    margin-left: 0.25rem !important;
}

html[dir="ltr"] .mr-1 {
    margin-right: 0.25rem !important;
    margin-left: 0 !important;
}

/* Fix for mr-3 class */
html[dir="rtl"] .mr-3 {
    margin-right: 0 !important;
    margin-left: 0.75rem !important;
}

html[dir="ltr"] .mr-3 {
    margin-right: 0.75rem !important;
    margin-left: 0 !important;
}

/* Fix for ml-2 class */
html[dir="rtl"] .ml-2 {
    margin-left: 0 !important;
    margin-right: 0.5rem !important;
}

html[dir="ltr"] .ml-2 {
    margin-left: 0.5rem !important;
    margin-right: 0 !important;
}

/* Fix for ml-4 class */
html[dir="rtl"] .ml-4 {
    margin-left: 0 !important;
    margin-right: 1rem !important;
}

html[dir="ltr"] .ml-4 {
    margin-left: 1rem !important;
    margin-right: 0 !important;
}

/* Fix for space-x-reverse */
html[dir="rtl"] .space-x-reverse > * + * {
    margin-right: 0.5rem !important;
    margin-left: 0 !important;
}

html[dir="ltr"] .space-x-reverse > * + * {
    margin-left: 0.5rem !important;
    margin-right: 0 !important;
}

/* Fix for space-x-3 with reverse */
html[dir="rtl"] .space-x-3.space-x-reverse > * + * {
    margin-right: 0.75rem !important;
    margin-left: 0 !important;
}

html[dir="ltr"] .space-x-3.space-x-reverse > * + * {
    margin-left: 0.75rem !important;
    margin-right: 0 !important;
}

/* Fix for space-x-4 with reverse */
html[dir="rtl"] .space-x-4.space-x-reverse > * + * {
    margin-right: 1rem !important;
    margin-left: 0 !important;
}

html[dir="ltr"] .space-x-4.space-x-reverse > * + * {
    margin-left: 1rem !important;
    margin-right: 0 !important;
}

/* Fix for space-x-8 with reverse */
html[dir="rtl"] .space-x-8.space-x-reverse > * + * {
    margin-right: 2rem !important;
    margin-left: 0 !important;
}

html[dir="ltr"] .space-x-8.space-x-reverse > * + * {
    margin-left: 2rem !important;
    margin-right: 0 !important;
}

/* Text alignment fixes */
html[dir="rtl"] body {
    text-align: right !important;
}

html[dir="ltr"] body {
    text-align: left !important;
}

/* Flex direction fixes for navigation */
html[dir="rtl"] .flex.items-center {
    flex-direction: row-reverse;
}

html[dir="ltr"] .flex.items-center {
    flex-direction: row;
}

/* Fix for hero buttons spacing */
html[dir="rtl"] .space-x-4.space-x-reverse > * + * {
    margin-right: 1rem !important;
    margin-left: 0 !important;
}

html[dir="ltr"] .space-x-4.space-x-reverse > * + * {
    margin-left: 1rem !important;
    margin-right: 0 !important;
}

/* Additional fix for medium screens and above */
@media (min-width: 768px) {
    html[dir="rtl"] .md\:space-x-4.md\:space-x-reverse > * + * {
        margin-right: 1rem !important;
        margin-left: 0 !important;
    }

    html[dir="ltr"] .md\:space-x-4.md\:space-x-reverse > * + * {
        margin-left: 1rem !important;
        margin-right: 0 !important;
    }
}

/* Fallback for button spacing in flex containers */
html[dir="rtl"] .md\:flex.md\:justify-center > a + a {
    margin-right: 1rem !important;
    margin-left: 0 !important;
}

html[dir="ltr"] .md\:flex.md\:justify-center > a + a {
    margin-left: 1rem !important;
    margin-right: 0 !important;
}