/* Custom CSS for Emlak Website */

/* Root Variables */
:root {
    --primary-color: #84964e;
    --secondary-color: #3a591c;
    --dark-bg: #1C1C1C;
    --transition: all 0.3s ease;
}

/* RTL Support */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .space-x-reverse > :not([hidden]) ~ :not([hidden]) {
    margin-left: 0.75rem;
    margin-right: 0;
}

/* Custom Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Gallery Animations - Seamless Infinite Loop */
@keyframes moveRight {
    0% {
        transform: translateX(-50%);
    }
    100% {
        transform: translateX(0%);
    }
}

@keyframes moveLeft {
    0% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(-50%);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(132, 150, 78, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(132, 150, 78, 0.6);
    }
}

/* Navigation Styles */
.nav-link {
    color: #374151;
    font-weight: 500;
    transition: color 0.3s ease;
    text-decoration: none;
}

.dark .nav-link {
    color: #d1d5db;
}

.nav-link:hover {
    color: var(--primary-color);
    transform: translateY(-1px);
}

/* Button Styles */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    transform: scale(1);
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: scale(1.05);
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

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

/* Card Hover Effects */
.service-card {
    background-color: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    transform: translateY(0);
}

.dark .service-card {
    background-color: #1f2937;
}

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

.dark .service-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Icon Animations */
.icon-bounce:hover {
    animation: bounce 0.6s ease-in-out;
}

.icon-pulse:hover {
    animation: pulse 1s ease-in-out infinite;
}

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

.dark .service-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Icon Animations */
.icon-bounce:hover {
    animation: bounce 0.6s ease-in-out;
}

.icon-pulse:hover {
    animation: pulse 1s ease-in-out infinite;
}

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

::-webkit-scrollbar-track {
}

::-webkit-scrollbar-thumb {
}

::-webkit-scrollbar-thumb:hover {
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

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

/* Loading Screen Styles */
#loadingScreen {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    animation: fadeIn 0.3s ease-in-out;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.dark #loadingScreen {
    background: linear-gradient(135deg, var(--dark-bg) 0%, #111827 100%);
}

/* Loading Screen Content Container */
#loadingScreen .text-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: auto;
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.loading-logo img {
    animation: logoZoom 2s ease-in-out infinite;
    filter: drop-shadow(0 10px 30px rgba(132, 150, 78, 0.4));
    display: block;
    margin: 0 auto;
}

/* Loading Logo Container */
.loading-logo {
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile Loading Logo - Smaller Size */
@media screen and (max-width: 767px) {
    .loading-logo img {
        width: 80px;
        height: auto;
        max-width: 80px;
    }
    
    /* Ensure loading screen is properly centered on mobile */
    #loadingScreen {
        padding: 1rem;
    }
    
    #loadingScreen .text-center {
        padding: 1rem;
        max-width: 300px;
    }
}

@media screen and (max-width: 480px) {
    .loading-logo img {
        width: 70px;
        height: auto;
        max-width: 70px;
    }
    
    #loadingScreen .text-center {
        padding: 0.5rem;
        max-width: 250px;
    }
}

@media screen and (max-width: 375px) {
    .loading-logo img {
        width: 60px;
        height: auto;
        max-width: 60px;
    }
    
    #loadingScreen .text-center {
        padding: 0.5rem;
        max-width: 200px;
    }
}

.loading-text {
    animation: textFadeIn 1s ease-in-out 0.5s both;
}

.loading-spinner {
    animation: spin 1s linear infinite, fadeInSpinner 1s ease-in-out 1s both;
    width: 60px;
    height: 60px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #84964e;
    border-radius: 50%;
    position: relative;
}

.loading-spinner::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid transparent;
    border-top: 2px solid #3a591c;
    border-radius: 50%;
    animation: spinReverse 2s linear infinite;
}

/* Dark theme spinner */
.dark .loading-spinner {
    border: 4px solid #374151;
    border-top: 4px solid #84964e;
}

/* Loading Animations */
@keyframes logoZoom {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes textFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInSpinner {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Loading Screen Exit Animation */
.loading-exit {
    animation: fadeOut 0.8s ease-in-out forwards;
}

@keyframes fadeOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    100% {
        opacity: 0;
        transform: scale(1.1);
        visibility: hidden;
    }
}

/* Theme Transition */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Hero Background Pattern */
.hero-pattern {
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(132, 150, 78, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(58, 89, 28, 0.1) 0%, transparent 50%);
}

/* Service Icon Glow */
.service-icon {
    transition: all 0.3s ease;
}

.service-icon:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 10px rgba(132, 150, 78, 0.5));
}

/* Card Gradient Border */
.gradient-border {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 2px;
    border-radius: 1rem;
}

.gradient-border-content {
}

/* Responsive Typography */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1.5rem;
    }
}

/* Enhanced Mobile Responsiveness */
/* Extra Small Devices (Phones, 320px and up) */
@media (max-width: 375px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .hero-title {
        font-size: 2rem;
        line-height: 1.1;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .btn-primary, .btn-secondary {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .service-card {
        padding: 1rem;
    }
}

/* Small Devices (Landscape phones, 576px and up) */
@media (min-width: 376px) and (max-width: 575px) {
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-subtitle {
        font-size: 1.3rem;
    }
}

/* Medium Devices (Tablets, 768px and up) */
@media (min-width: 576px) and (max-width: 767px) {
    .hero-title {
        font-size: 2.8rem;
    }
    
    .hero-subtitle {
        font-size: 1.6rem;
    }
}

/* Large Devices (Landscape tablets, 992px and up) */
@media (min-width: 768px) and (max-width: 991px) {
    .hero-title {
        font-size: 3.2rem;
    }
    
    .hero-subtitle {
        font-size: 1.8rem;
    }
}

/* iPhone Specific Fixes */
@media screen and (device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) {
    /* iPhone 6/7/8 */
    .gallery-card {
        width: 150px;
        height: 110px;
    }
}

@media screen and (device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) {
    /* iPhone 6/7/8 Plus */
    .gallery-card {
        width: 170px;
        height: 120px;
    }
}

@media screen and (device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) {
    /* iPhone X/XS */
    .gallery-card {
        width: 160px;
        height: 115px;
    }
    
    /* Safe area padding for notch */
    .navbar {
        padding-top: env(safe-area-inset-top);
    }
}

@media screen and (device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3) {
    /* iPhone XR/XS Max */
    .gallery-card {
        width: 180px;
        height: 125px;
    }
}

/* Samsung Galaxy Specific Fixes */
@media screen and (device-width: 360px) and (device-height: 640px) and (-webkit-device-pixel-ratio: 3) {
    /* Galaxy S5/S6/S7 */
    .gallery-card {
        width: 140px;
        height: 105px;
    }
}

@media screen and (device-width: 360px) and (device-height: 720px) and (-webkit-device-pixel-ratio: 4) {
    /* Galaxy S8/S9 */
    .gallery-card {
        width: 145px;
        height: 110px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    /* Touch devices */
    .btn-primary, .btn-secondary {
        min-height: 44px; /* Apple's recommended minimum touch target */
        min-width: 44px;
    }
    
    .gallery-card {
        transition: transform 0.2s ease;
    }
    
    .gallery-card:active {
        transform: scale(0.98);
    }
    
    .nav-link {
        padding: 0.75rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* Language Transition */
.lang-transition {
    transition: opacity 0.3s ease;
}

.lang-fade-out {
    opacity: 0;
}

.lang-fade-in {
    opacity: 1;
}

/* Counter Animation */
.counter {
    font-variant-numeric: tabular-nums;
}

/* Feature List Styles */
.feature-list {
}

.feature-item {
}

.feature-item i {
}

/* Section Dividers */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
}

/* App Store Button Hover */
.app-store-btn {
}

.app-store-btn:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Contact Form Styles */
.form-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    background: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    resize: none;
}

.dark .form-input {
    background: #1e293b;
    border-color: #374151;
    color: white;
}

.form-input:focus {
    outline: none;
    border-color: #84964e;
    box-shadow: 0 0 0 3px rgba(132, 150, 78, 0.1);
    transform: translateY(-1px);
}

.form-input::placeholder {
    color: #9ca3af;
}

.dark .form-input::placeholder {
    color: #6b7280;
}

/* Stats Counter */
.stats-counter {
}

/* Testimonial Styles */
.testimonial-card {
}

.testimonial-stars {
}

/* Footer Styles */
.footer-link {
}

/* Mobile Menu Animation */
.mobile-menu-enter {
    max-height: 0;
    opacity: 0;
    transform: translateY(-10px);
}

.mobile-menu-enter-active {
    max-height: 300px;
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s ease;
}

/* Back to Top Button */
.back-to-top {
}

.back-to-top.hidden {
    opacity: 0;
    transform: translateY(100px);
}

/* Dark Mode Toggle Animation */
.theme-toggle {
}

.theme-toggle:hover {
    transform: rotate(180deg);
}

/* Language Switch Animation */
.lang-switch {
    position: relative;
    overflow: hidden;
}

.lang-switch::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.lang-switch:hover::before {
    left: 100%;
}

/* Section Fade In */
.section-fade {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.section-fade.in-view {
    opacity: 1;
    transform: translateY(0);
}

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

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark .glass-effect {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Hero Logo Styles */
.hero-logo {
    filter: drop-shadow(0 10px 20px rgba(132, 150, 78, 0.3));
    transition: transform 0.3s ease;
}

.hero-logo:hover {
    transform: scale(1.05);
}

/* RTL Fixes */
[dir="rtl"] .space-x-3 > :not([hidden]) ~ :not([hidden]) {
    margin-left: 0.75rem;
    margin-right: 0;
}

[dir="rtl"] .space-x-4 > :not([hidden]) ~ :not([hidden]) {
    margin-left: 1rem;
    margin-right: 0;
}

[dir="rtl"] .space-x-8 > :not([hidden]) ~ :not([hidden]) {
    margin-left: 2rem;
    margin-right: 0;
}

[dir="rtl"] .space-x-2 > :not([hidden]) ~ :not([hidden]) {
    margin-left: 0.5rem;
    margin-right: 0;
}

/* Navigation RTL Specific Fixes */
[dir="rtl"] .nav-container {
    direction: rtl;
}

[dir="rtl"] .nav-links {
    gap: 2rem;
}

[dir="rtl"] .nav-controls {
    gap: 1rem;
}

/* Family ID Security & Network Animations */
@keyframes scan-line {
    0% { 
        transform: translateY(-100vh) skew(-12deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% { 
        transform: translateY(100vh) skew(-12deg);
        opacity: 0;
    }
}

@keyframes scan-line-vertical {
    0% { 
        transform: translateX(100vw) skew(0deg, 12deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% { 
        transform: translateX(-100vw) skew(0deg, 12deg);
        opacity: 0;
    }
}

@keyframes data-flow {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes network-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(132, 150, 78, 0.7);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(132, 150, 78, 0);
        transform: scale(1.1);
    }
}

/* Enhanced Animations Classes */
.animate-network-pulse {
    animation: network-pulse 2s ease-in-out infinite;
}

.animate-data-flow {
    animation: data-flow 4s linear infinite;
}

/* Hero Text Animation */
@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animated-text {
    animation: slideUpFade 0.8s ease-out forwards;
}

.animated-text:nth-child(1) {
    animation-delay: 0.5s;
}

.animated-text:nth-child(2) {
    animation-delay: 1s;
}

.animated-text:nth-child(3) {
    animation-delay: 1.5s;
}

/* Text animation on page load */
.hero-text-container .animated-text {
    opacity: 0;
}

/* Bloom Village Gallery Styles - Seamless Layout */
.gallery-row {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    margin-bottom: 0.5rem;
    width: 100%;
}

.gallery-track {
    display: inline-flex;
    gap: 1rem;
    animation-duration: 20s;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    width: max-content;
}

.moving-right .gallery-track {
    animation-name: moveRight;
}

.moving-left .gallery-track {
    animation-name: moveLeft;
}

/* RTL Gallery Animation Assignments */
[dir="rtl"] .moving-right .gallery-track {
    animation-name: moveRightRTL;
}

[dir="rtl"] .moving-left .gallery-track {
    animation-name: moveLeftRTL;
}

.gallery-card {
    flex-shrink: 0;
    width: 280px;
    height: 180px;
    border-radius: 0.75rem;
    overflow: hidden;
    position: relative;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    cursor: pointer;
    margin: 0;
    border: none;
}

.gallery-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 15px 35px rgba(132, 150, 78, 0.25);
    z-index: 10;
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.gallery-card:hover .gallery-image {
    transform: scale(1.08);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 1.2rem 0.8rem 0.8rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-card:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-overlay h3 {
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    margin: 0;
    line-height: 1.2;
}

/* Gallery Animation Keyframes - True Seamless Infinite Loop */
@keyframes moveRight {
    0% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(-50%);
    }
}

@keyframes moveLeft {
    0% {
        transform: translateX(-50%);
    }
    100% {
        transform: translateX(0%);
    }
}

/* RTL Gallery Animation Keyframes */
@keyframes moveRightRTL {
    0% {
        transform: translateX(-50%);
    }
    100% {
        transform: translateX(0%);
    }
}

@keyframes moveLeftRTL {
    0% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Pause animation on hover */
.gallery-row:hover .gallery-track {
    animation-play-state: paused;
}

/* Dark mode gallery adjustments */
.dark .gallery-card {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.dark .gallery-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

/* RTL Gallery Specific Styles */
[dir="rtl"] .gallery-row {
    direction: ltr; /* Keep the animation direction consistent */
}

[dir="rtl"] .gallery-track {
    direction: ltr; /* Maintain left-to-right flow for seamless animation */
}

[dir="rtl"] .gallery-overlay h3 {
    text-align: center; /* Center text in RTL */
    direction: rtl; /* But allow text to flow RTL */
}

/* Responsive gallery - Enhanced Mobile Support */
@media (max-width: 1024px) {
    .gallery-card {
        width: 240px;
        height: 160px;
    }
    
    .gallery-overlay h3 {
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .gallery-card {
        width: 200px;
        height: 140px;
    }
    
    .gallery-overlay {
        padding: 1rem 0.6rem 0.6rem;
    }
    
    .gallery-overlay h3 {
        font-size: 0.85rem;
    }
    
    .gallery-track {
        animation-duration: 15s;
        gap: 0.8rem;
    }
}

@media (max-width: 640px) {
    .gallery-card {
        width: 180px;
        height: 130px;
    }
    
    .gallery-overlay h3 {
        font-size: 0.8rem;
    }
    
    .gallery-track {
        gap: 0.6rem;
    }
}

@media (max-width: 480px) {
    .gallery-card {
        width: 160px;
        height: 120px;
    }
    
    .gallery-overlay {
        padding: 0.8rem 0.5rem 0.5rem;
    }
    
    .gallery-overlay h3 {
        font-size: 0.75rem;
    }
    
    .gallery-track {
        animation-duration: 12s;
        gap: 0.5rem;
    }
}

@media (max-width: 390px) {
    /* Very small phones */
    .gallery-card {
        width: 140px;
        height: 105px;
    }
    
    .gallery-overlay h3 {
        font-size: 0.7rem;
    }
    
    .gallery-track {
        gap: 0.4rem;
    }
}

@media (max-width: 320px) {
    /* Ultra small phones */
    .gallery-card {
        width: 120px;
        height: 90px;
    }
    
    .gallery-overlay {
        padding: 0.6rem 0.4rem 0.4rem;
    }
    
    .gallery-overlay h3 {
        font-size: 0.65rem;
    }
    
    .gallery-track {
        gap: 0.3rem;
        animation-duration: 10s;
    }
}

/* Partner Carousel - Compact Size */
.partner-carousel {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    margin: 2rem 0;
    background: transparent;
}

.partner-carousel .owl-stage-outer {
    overflow: hidden;
}

.partner-carousel .owl-stage {
    display: flex;
    animation: partnerScroll 20s linear infinite;
}

.partner-carousel .owl-item {
    flex-shrink: 0;
    width: 100px !important;
    margin-right: 20px !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.partner-logo-item {
    width: 80px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    transition: all 0.3s ease;
}

.partner-logo-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.partner-logo {
    max-width: 64px;
    max-height: 44px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: brightness(0.8);
    transition: filter 0.3s ease;
}

.partner-logo:hover {
    filter: brightness(1);
}

@keyframes partnerScroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Hide navigation buttons for cleaner look */
.partner-carousel .owl-nav,
.partner-carousel .owl-dots {
    display: none;
}

/* RTL Partner Carousel Support */
[dir="rtl"] .partner-carousel {
    direction: ltr; /* Keep animation direction consistent */
}

[dir="rtl"] .partner-carousel .owl-stage {
    animation-name: partnerScrollRTL;
}

@keyframes partnerScrollRTL {
    0% {
        transform: translateX(-50%);
    }
    100% {
        transform: translateX(0%);
    }
}

/* Enhanced Responsive partner carousel */
@media (max-width: 1024px) {
    .partner-carousel .owl-item {
        width: 90px !important;
        margin-right: 18px !important;
    }
    
    .partner-logo-item {
        width: 70px;
        height: 55px;
        padding: 7px;
    }
    
    .partner-logo {
        max-width: 56px;
        max-height: 41px;
    }
}

@media (max-width: 768px) {
    .partner-carousel .owl-item {
        width: 80px !important;
        margin-right: 15px !important;
    }
    
    .partner-logo-item {
        width: 60px;
        height: 45px;
        padding: 6px;
    }
    
    .partner-logo {
        max-width: 48px;
        max-height: 33px;
    }
}

@media (max-width: 640px) {
    .partner-carousel .owl-item {
        width: 75px !important;
        margin-right: 12px !important;
    }
    
    .partner-logo-item {
        width: 55px;
        height: 42px;
        padding: 5px;
    }
    
    .partner-logo {
        max-width: 45px;
        max-height: 32px;
    }
}

@media (max-width: 480px) {
    .partner-carousel .owl-item {
        width: 70px !important;
        margin-right: 10px !important;
    }
    
    .partner-logo-item {
        width: 50px;
        height: 38px;
        padding: 4px;
    }
    
    .partner-logo {
        max-width: 42px;
        max-height: 30px;
    }
}

@media (max-width: 390px) {
    .partner-carousel .owl-item {
        width: 65px !important;
        margin-right: 8px !important;
    }
    
    .partner-logo-item {
        width: 45px;
        height: 35px;
        padding: 3px;
    }
    
    .partner-logo {
        max-width: 39px;
        max-height: 29px;
    }
}

@media (max-width: 320px) {
    .partner-carousel .owl-item {
        width: 60px !important;
        margin-right: 6px !important;
    }
    
    .partner-logo-item {
        width: 40px;
        height: 30px;
        padding: 2px;
    }
    
    .partner-logo {
        max-width: 36px;
        max-height: 26px;
    }
}

/* =============================================================================
   COMPREHENSIVE MOBILE & DEVICE SUPPORT
   ============================================================================= */

/* Base Mobile Optimizations */
@media screen and (max-width: 767px) {
    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
    }
    
    /* Optimize containers for mobile */
    .container {
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Mobile-friendly sections */
    section {
        padding: 3rem 0;
    }
    
    /* Optimize text for mobile reading */
    h1, h2, h3, h4, h5, h6 {
        line-height: 1.3;
        word-wrap: break-word;
        hyphens: auto;
    }
    
    p {
        line-height: 1.6;
        word-wrap: break-word;
    }
    
    /* Mobile navigation improvements */
    .nav-link {
        padding: 1rem;
        display: block;
        font-size: 1.1rem;
    }
    
    /* Mobile button improvements */
    .btn-primary, .btn-secondary {
        width: 100%;
        max-width: 280px;
        margin: 0.5rem auto;
        display: block;
        text-align: center;
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
    
    /* Card grid improvements */
    .service-card {
        margin-bottom: 1.5rem;
        padding: 1.5rem;
    }
}

/* Ultra-wide screens support */
@media screen and (min-width: 1920px) {
    .container {
        max-width: 1400px;
    }
    
    .gallery-card {
        width: 320px;
        height: 200px;
    }
}

/* High DPI displays optimization */
@media screen and (-webkit-min-device-pixel-ratio: 2),
       screen and (min-resolution: 192dpi),
       screen and (min-resolution: 2dppx) {
    /* Optimize images for retina displays */
    .gallery-image,
    .partner-logo,
    .hero-logo {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Landscape orientation optimizations */
@media screen and (orientation: landscape) and (max-height: 500px) {
    /* Optimize for landscape mobile phones */
    .hero-title {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
    
    section {
        padding: 2rem 0;
    }
    
    .gallery-card {
        width: 140px;
        height: 100px;
    }
}

/* Dark mode mobile optimizations */
@media screen and (max-width: 767px) {
    .dark .service-card {
        background-color: #1e293b;
        border: 1px solid #374151;
    }
    
    .dark .gallery-card {
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari viewport fix */
    .hero-section,
    .gallery-section {
        min-height: -webkit-fill-available;
    }
    
    /* Fix iOS Safari bottom bar issue */
    .footer {
        padding-bottom: calc(2rem + env(safe-area-inset-bottom));
    }
    
    /* iOS touch improvements */
    .gallery-card,
    .service-card,
    .btn-primary,
    .btn-secondary {
        -webkit-tap-highlight-color: rgba(132, 150, 78, 0.3);
    }
}

/* Android Chrome specific fixes */
@media screen and (-webkit-min-device-pixel-ratio: 1) and (max-width: 767px) {
    /* Android font rendering optimization */
    body {
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
    
    /* Android scroll performance */
    .gallery-track,
    .partner-carousel .owl-stage {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        will-change: transform;
    }
}

/* Accessibility improvements for mobile */
@media screen and (max-width: 767px) {
    /* Larger touch targets */
    button,
    .btn-primary,
    .btn-secondary,
    .nav-link {
        min-height: 48px;
        min-width: 48px;
    }
    
    /* Better focus indicators for touch */
    button:focus,
    .btn-primary:focus,
    .btn-secondary:focus {
        outline: 3px solid rgba(132, 150, 78, 0.7);
        outline-offset: 2px;
    }
}

/* Performance optimizations for mobile */
@media screen and (max-width: 767px) {
    /* Reduce animation complexity on mobile */
    .gallery-card {
        transition: transform 0.2s ease;
    }
    
    .gallery-card:hover {
        transform: translateY(-4px) scale(1.02);
    }
    
    /* Optimize animations for mobile performance */
    .gallery-track,
    .partner-carousel .owl-stage {
        animation-timing-function: linear;
        backface-visibility: hidden;
        perspective: 1000px;
    }
}

/* Foldable device support */
@media screen and (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    /* Galaxy Fold, Surface Duo, etc. */
    .gallery-card {
        width: 220px;
        height: 150px;
    }
    
    .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* =============================================================================
   END MOBILE & DEVICE SUPPORT
   ============================================================================= */
