/* Custom Styles for Sereen Website */

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* RTL Typography improvements */
body {
    font-family: "Baloo Bhaijaan 2", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    line-height: 1.6;
    letter-spacing: -0.01em;
    direction: rtl;
    text-align: right;
}

/* Arabic font optimization */
.font-arabic {
    font-family: "Baloo Bhaijaan 2", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    font-feature-settings: "kern" 1, "liga" 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Arabic text improvements */
h1, h2, h3, h4, h5, h6 {
    font-family: "Baloo Bhaijaan 2", sans-serif;
    font-optical-sizing: auto;
    font-weight: 700;
    font-style: normal;
    line-height: 1.2;
}

/* Better Arabic spacing */
p, .text-lg, .text-xl {
    word-spacing: 0.1em;
    line-height: 1.8;
}

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

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(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);
    }
}

/* Apply animations on scroll */
.animate-on-scroll {
    opacity: 0;
    animation-duration: 0.8s;
    animation-fill-mode: forwards;
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-on-scroll.fadeInUp {
    animation-name: fadeInUp;
}

.animate-on-scroll.fadeInDown {
    animation-name: fadeInDown;
}

.animate-on-scroll.scaleIn {
    animation-name: scaleIn;
}

.animate-on-scroll.slideInRight {
    animation-name: slideInRight;
}

.animate-on-scroll.slideInLeft {
    animation-name: slideInLeft;
}

/* Enhanced button styles */
.btn-primary {
    background: linear-gradient(135deg, #0ea5e9 0%, #0369a1 100%);
    border: none;
    border-radius: 12px;
    padding: 16px 32px;
    font-weight: 600;
    font-size: 1.125rem;
    color: white;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 4px 14px 0 rgba(14, 165, 233, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-primary::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;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px 0 rgba(14, 165, 233, 0.4);
}

.btn-secondary {
    background: white;
    border: 2px solid #0ea5e9;
    border-radius: 12px;
    padding: 14px 32px;
    font-weight: 600;
    font-size: 1.125rem;
    color: #0ea5e9;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: #0ea5e9;
    transition: width 0.3s;
    z-index: -1;
}

.btn-secondary:hover::before {
    width: 100%;
}

.btn-secondary:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px 0 rgba(14, 165, 233, 0.3);
}

/* Card hover effects */
.service-card {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.05) 0%, transparent 70%);
    transition: all 0.3s;
    transform: scale(0);
}

.service-card:hover::before {
    transform: scale(1);
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Testimonial cards */
.testimonial-card {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
}

.testimonial-card::after {
    content: '"';
    position: absolute;
    top: -10px;
    right: 20px;
    font-size: 5rem;
    color: rgba(14, 165, 233, 0.1);
    font-family: serif;
    line-height: 1;
}

.testimonial-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

/* Header and Logo Styling */
.logo-text {
    font-family: "Marck Script", cursive;
    font-weight: 400;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Enhanced navigation */
.nav-link {
    position: relative;
    transition: all 0.3s;
    padding: 0.5rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #0ea5e9, #d946ef);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
    right: auto;
    left: 0;
}

/* Hamburger Menu Animation */
.hamburger-icon {
    width: 24px;
    height: 18px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger-line {
    display: block;
    height: 3px;
    width: 100%;
    background-color: currentColor;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-button.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-button.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-button.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Menu Animations */
.mobile-menu.open {
    transform: translateX(0);
}

.mobile-menu-overlay.show {
    display: block;
    opacity: 1;
}

/* Mobile dropdown animations */
.mobile-dropdown-toggle.active svg {
    transform: rotate(180deg);
}

/* Enhanced mobile menu items */
.mobile-menu a, .mobile-menu button {
    position: relative;
    overflow: hidden;
}

.mobile-menu a::before, .mobile-menu button::before {
    content: '';
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(14, 165, 233, 0.1), transparent);
    transition: right 0.5s;
}

.mobile-menu a:hover::before, .mobile-menu button:hover::before {
    right: 100%;
}

/* Form enhancements */
.form-input {
    transition: all 0.3s;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 16px;
}

.form-input:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
    outline: none;
}

/* Loading states */
.loading {
    position: relative;
    color: transparent;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f4f6;
    border-top: 2px solid #0ea5e9;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Hero section enhancements */
.hero-gradient {
    background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 50%, #fdf4ff 100%);
    position: relative;
}

.hero-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(14, 165, 233, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(212, 70, 239, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* Section spacing improvements */
.section-padding {
    padding: 5rem 0;
}

@media (min-width: 768px) {
    .section-padding {
        padding: 7rem 0;
    }
}

@media (min-width: 1024px) {
    .section-padding {
        padding: 8rem 0;
    }
}

/* Typography enhancements */
.heading-primary {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.heading-secondary {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.text-large {
    font-size: clamp(1.125rem, 2.5vw, 1.25rem);
    line-height: 1.6;
}

/* Enhanced mobile experience */
@media (max-width: 768px) {
    .hero-gradient {
        padding: 3rem 0;
    }
    
    .service-card {
        margin-bottom: 1.5rem;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        text-align: center;
    }
}

/* WordPress theme preparation classes */
.wp-block-group {
    margin: 0;
}

.wp-block-columns {
    margin: 0;
}

.wp-block-column {
    margin: 0;
}

.has-primary-color {
    color: #0ea5e9;
}

.has-primary-background-color {
    background-color: #0ea5e9;
}

.has-secondary-color {
    color: #d946ef;
}

.has-secondary-background-color {
    background-color: #d946ef;
}

/* Performance optimizations */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.focus-visible:focus {
    outline: 2px solid #0ea5e9;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
    
    blockquote, table, pre {
        page-break-inside: avoid;
    }
    
    img {
        max-width: 100% !important;
    }
}

/* Dark mode preparation */
@media (prefers-color-scheme: dark) {
    .dark-mode-auto {
        background-color: #1f2937;
        color: #f9fafb;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn-primary,
    .btn-secondary {
        border: 2px solid;
    }
    
    .service-card,
    .testimonial-card {
        border: 2px solid;
    }
}