/* Enhanced Styles for Language Toggle and Mobile Navigation */

/* Language Toggle Enhancements */
.language-toggle {
    display: flex;
    align-items: center;
    position: relative;
    background: var(--bg-secondary, var(--light-color));
    border-radius: 20px;
    padding: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-right: 10px;
    overflow: hidden;
    user-select: none;
    z-index: 5;
}

.language-toggle .lang-option {
    position: relative;
    padding: 4px 10px;
    border-radius: 18px;
    z-index: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary, var(--dark-color));
    transition: all 0.3s ease;
    min-width: 35px;
    text-align: center;
}

.language-toggle .lang-option.active {
    color: var(--text-light, var(--white-color));
}

.language-toggle::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 2px;
    width: calc(50% - 2px);
    height: calc(100% - 4px);
    background: var(--primary-color);
    border-radius: 18px;
    transition: transform 0.3s ease, width 0.2s ease;
    z-index: 0;
}

.language-toggle.ar-active::before {
    transform: translateX(calc(100% - 0px));
}

/* Touch-friendly enhancements */
@media (hover: hover) {
    .language-toggle:hover {
        box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    }
    
    .language-toggle .lang-option:hover {
        opacity: 0.9;
    }
}

.language-toggle.touch-active {
    transform: scale(0.97);
}

/* RTL adjustments for language toggle */
[dir="rtl"] .language-toggle {
    margin-right: 0;
    margin-left: 10px;
}

[dir="rtl"] .language-toggle::before {
    left: unset;
    right: 2px;
}

[dir="rtl"] .language-toggle.ar-active::before {
    transform: translateX(calc(-100% + 0px));
}

/* Mobile Menu Enhancements */
.menu-btn {
    display: none;
    font-size: 22px;
    cursor: pointer;
    background: transparent;
    border: none;
    color: var(--text-primary, var(--dark-color));
    transition: all 0.3s ease;
    padding: 8px;
    border-radius: 4px;
    z-index: 1001;
    position: relative;
}

@media (hover: hover) {
    .menu-btn:hover {
        color: var(--primary-color);
        transform: scale(1.05);
    }
}

.menu-btn.touch-active {
    transform: scale(0.95);
    color: var(--primary-color);
}

/* Improved mobile navigation */
@media screen and (max-width: 768px) {
    .menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .navigation {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: var(--bg-overlay, rgba(33, 34, 44, 0.95));
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        display: none;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        z-index: 1000;
        opacity: 0;
        transition: opacity 0.3s ease, transform 0.3s ease;
        transform: translateX(-20px);
        padding: 80px 20px 40px;
        overflow-y: auto;
        box-sizing: border-box;
    }
    
    /* RTL adjustments for mobile menu */
    [dir="rtl"] .navigation {
        left: unset;
        right: 0;
        transform: translateX(20px);
    }
    
    .navigation.active {
        opacity: 1;
        transform: translateX(0);
    }
    
    .navigation.menu-animating {
        animation: menuFadeIn 0.3s ease forwards;
    }
    
    .navigation a {
        margin: 15px 0;
        font-size: 20px;
        font-weight: 500;
        opacity: 0;
        transform: translateY(10px);
    }
    
    .navigation.active a {
        opacity: 1;
        transform: translateY(0);
        transition: opacity 0.3s ease, transform 0.3s ease;
    }
    
    /* Staggered animation for menu items */
    .navigation.active a:nth-child(1) { transition-delay: 0.1s; }
    .navigation.active a:nth-child(2) { transition-delay: 0.15s; }
    .navigation.active a:nth-child(3) { transition-delay: 0.2s; }
    .navigation.active a:nth-child(4) { transition-delay: 0.25s; }
    .navigation.active a:nth-child(5) { transition-delay: 0.3s; }
    .navigation.active a:nth-child(6) { transition-delay: 0.35s; }
    
    /* Header adjustments for mobile */
    header .container {
        justify-content: space-between;
        padding: 15px 20px;
    }
    
    /* Language toggle adjustments for mobile */
    .header-controls {
        display: flex;
        align-items: center;
        margin-right: 10px;
    }
    
    [dir="rtl"] .header-controls {
        margin-right: 0;
        margin-left: 10px;
    }
    
    /* Enhanced touch target sizes for mobile */
    .is-mobile .language-toggle .lang-option {
        padding: 6px 12px;
    }
    
    .is-mobile .menu-btn {
        padding: 10px;
    }
    
    .is-mobile .navigation a {
        padding: 12px 15px;
        display: block;
        width: 80%;
        text-align: center;
        border-radius: 8px;
        transition: background-color 0.2s ease;
    }
    
    .is-mobile .navigation a:active,
    .is-mobile .navigation a.touch-active {
        background-color: rgba(var(--primary-rgb, 44, 150, 68), 0.1);
    }
}

/* Animation keyframes for menu */
@keyframes menuFadeIn {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes menuFadeInRtl {
    0% {
        opacity: 0;
        transform: translateX(20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.navigation.menu-animating {
    animation: menuFadeIn 0.3s ease forwards;
}

[dir="rtl"] .navigation.menu-animating {
    animation: menuFadeInRtl 0.3s ease forwards;
}

/* Utility classes for RTL/LTR layouts */
.rtl-layout .ltr-only {
    display: none !important;
}

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

/* Enhanced Soccer Field Styles */
.project-card {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: var(--bg-secondary, var(--white-color));
    margin-bottom: 30px;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.project-img {
    position: relative;
    overflow: hidden;
    height: 250px;
}

.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover .project-img img {
    transform: scale(1.05);
}

/* Make sure touch active state is visible on all devices */
a.touch-active, 
button.touch-active, 
.menu-btn.touch-active, 
.language-toggle.touch-active,
.theme-toggle.touch-active {
    opacity: 0.8;
    transform: scale(0.97);
}

/* Force hardware acceleration for smoother animations */
.navigation,
.language-toggle,
.menu-btn,
.project-card {
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Focus styles for accessibility */
a:focus,
button:focus,
.menu-btn:focus,
.language-toggle:focus,
.theme-toggle:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Remove outline for mouse users but keep for keyboard navigation */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
.menu-btn:focus:not(:focus-visible),
.language-toggle:focus:not(:focus-visible),
.theme-toggle:focus:not(:focus-visible) {
    outline: none;
}

/* Preserve specificity - keep these styles at the end */
@media (prefers-reduced-motion: reduce) {
    *,
    ::before,
    ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
} 