/* ====================================
   صيانة اريستون - Custom Styles
   Ariston Maintenance - Custom CSS
   ==================================== */

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Tajawal', sans-serif;
    line-height: 1.7;
    overflow-x: hidden;
}

/* RTL Support */
[dir="rtl"] {
    text-align: right;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1faee;
}

::-webkit-scrollbar-thumb {
    background: #e63946;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #c62828;
}

/* Hero Section Gradient Background */
.hero-gradient {
    background: linear-gradient(135deg, #1d3557 0%, #457b9d 50%, #e63946 100%);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Floating Animation */
.animate-float {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Slow Bounce Animation */
.animate-bounce-slow {
    animation: bounceSlow 3s ease-in-out infinite;
}

@keyframes bounceSlow {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Service Cards Hover Effects */
.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #e63946, #457b9d);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s ease;
}

.service-card:hover::before {
    transform: scaleX(1);
}

/* Button Ripple Effect */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-ripple:active::after {
    width: 300px;
    height: 300px;
}

/* FAQ Accordion Styles */
.faq-item {
    transition: all 0.3s ease;
}

.faq-item:hover {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.faq-question {
    cursor: pointer;
}

.faq-icon {
    transition: transform 0.3s ease;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

/* Form Input Focus Effects */
input:focus,
select:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.2);
}

/* Smooth Section Transitions */
section {
    position: relative;
}

/* Navigation Active State */
nav a.active {
    color: #e63946;
}

/* Mobile Menu Animation */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    opacity: 0;
}

#mobile-menu.show {
    max-height: 400px;
    opacity: 1;
}

/* Testimonial Cards */
.testimonial-card {
    transition: all 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-5px);
}

/* Stats Counter Animation */
.counter {
    display: inline-block;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Pulse Animation for CTA */
.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #e63946, #457b9d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Shadow Utilities */
.shadow-primary {
    box-shadow: 0 10px 40px rgba(230, 57, 70, 0.3);
}

.shadow-accent {
    box-shadow: 0 10px 40px rgba(69, 123, 157, 0.3);
}

/* Responsive Typography */
@media (max-width: 768px) {
    h1 {
        font-size: 1.5rem !important;
    }
    
    h2 {
        font-size: 1.75rem !important;
    }
    
    h3 {
        font-size: 1.25rem !important;
    }
    
    p {
        font-size: 0.95rem;
    }
}

/* Mobile Optimizations */
@media (max-width: 640px) {
    /* Reduce padding on mobile */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Stack buttons vertically on mobile */
    .flex-col-mobile {
        flex-direction: column;
    }
    
    /* Adjust floating buttons position */
    .fixed.bottom-6.left-6 {
        bottom: 1.5rem;
        left: 1.5rem;
    }
    
    .fixed.bottom-6.right-6 {
        bottom: 1.5rem;
        right: 1.5rem;
    }
    
    /* Smaller floating buttons on mobile */
    .fixed.bottom-6 {
        width: 3.5rem !important;
        height: 3.5rem !important;
    }
    
    .fixed.bottom-6 svg {
        width: 1.5rem !important;
        height: 1.5rem !important;
    }
    
    /* Hero section adjustments */
    .hero-gradient {
        min-height: auto;
        padding-top: 3rem;
        padding-bottom: 5rem;
    }
    
    /* Service cards full width on mobile */
    .service-card {
        padding: 1.5rem;
    }
    
    /* Reduce stats size on mobile */
    .stats-number {
        font-size: 1.5rem;
    }
}

/* Tablet Optimizations */
@media (min-width: 641px) and (max-width: 1024px) {
    .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* Print Styles */
@media print {
    .fixed,
    nav,
    footer {
        display: none;
    }
    
    body {
        font-size: 12pt;
        color: #000;
    }
    
    a {
        text-decoration: none;
        color: #000;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Focus Visible for Keyboard Navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #e63946;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .service-card,
    .bg-white {
        border: 2px solid #000;
    }
    
    a, button {
        text-decoration: underline;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    /* Uncomment if you want dark mode support
    body {
        background: #1a1a1a;
        color: #f1f1f1;
    }
    */
}

/* Selection Styling */
::selection {
    background: #e63946;
    color: white;
}

::-moz-selection {
    background: #e63946;
    color: white;
}

/* Image Lazy Loading Placeholder */
img[loading="lazy"] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Custom Utilities */
.text-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.backdrop-blur-custom {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Smooth Underline Animation */
.underline-animation {
    position: relative;
}

.underline-animation::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: #e63946;
    transition: width 0.3s ease;
}

.underline-animation:hover::after {
    width: 100%;
}

/* Card Flip Animation (for interactive elements) */
.flip-card {
    perspective: 1000px;
}

.flip-card-inner {
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

/* Shine Effect on Buttons */
.shine-effect {
    position: relative;
    overflow: hidden;
}

.shine-effect::before {
    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;
}

.shine-effect:hover::before {
    left: 100%;
}

/* Typing Effect (for hero headlines) */
.typing-effect {
    overflow: hidden;
    border-right: 2px solid #e63946;
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: #e63946;
    }
}

/* Smooth Page Load */
.page-loaded body {
    opacity: 1;
    transition: opacity 0.5s ease;
}

body {
    opacity: 1;
}

/* Fix for RTL layout issues */
[dir="rtl"] .ml-auto {
    margin-left: 0;
    margin-right: auto;
}

[dir="rtl"] .mr-auto {
    margin-right: 0;
    margin-left: auto;
}

/* Phone number direction fix */
[dir="ltr"] {
    direction: ltr;
    unicode-bidi: isolate;
}
