/* Custom Styles for SCMS Landing Page */

/* Font family for Arabic */
html[lang="ar"] {
    font-family: 'Rubik', sans-serif;
}

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

/* Skip to main content link (accessibility) */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #1A1A1A;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 0 0 8px 0;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

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

/* Mobile menu styles */
.mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}

.mobile-menu.active {
    max-height: 400px;
}

/* Navigation active state */
.nav-link.active {
    color: #111827;
    font-weight: 600;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    background: #004C97;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 50;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.back-to-top:hover {
    background: #00843D;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* Fade in animation */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Form validation styles */
input.error,
textarea.error {
    border-color: #ef4444;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: #004C97;
}

/* Loading spinner */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

/* Hover effects for cards */
.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Focus visible styles for accessibility */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #004C97;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .skip-link,
    header,
    .back-to-top,
    #mobile-menu-btn {
        display: none;
    }
    
    .fade-in {
        opacity: 1;
        transform: none;
    }
}

/* Reduced motion for accessibility */
@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;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .border {
        border-width: 2px;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles if needed */
}

/* Responsive typography */
@media (max-width: 640px) {
    html {
        font-size: 14px;
    }
}

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

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

::-webkit-scrollbar-thumb {
    background: #A1C5E7;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #004C97;
}

/* Selection color */
::selection {
    background-color: #004C97;
    color: white;
}

::-moz-selection {
    background-color: #004C97;
    color: white;
}

/* Logo Slider Styles */
.logo-slider {
    width: 100%;
    overflow: hidden;
    position: relative;
    background: white;
    border-radius: 1rem;
    padding: 1.5rem 0;
}

.logo-slide-track {
    display: flex;
    width: calc(250px * 30); /* 15 logos * 2 (duplicated) * width */
    animation: scroll 40s linear infinite;
}

.logo-slide {
    width: 200px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    flex-shrink: 0;
}

.logo-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.logo-slide:hover .logo-image {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.05);
}

/* Pause animation on hover */
.logo-slider:hover .logo-slide-track {
    animation-play-state: paused;
}

/* Keyframe animation for infinite scroll */
@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(-200px * 15)); /* Half of total width */
    }
}

/* RTL (Arabic) - Reverse slider direction */
html[dir="rtl"] .logo-slide-track {
    animation: scroll-rtl 40s linear infinite;
}

@keyframes scroll-rtl {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(200px * 15)); /* Positive value for RTL */
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .logo-slide {
        width: 150px;
        height: 80px;
    }
    
    .logo-slide-track {
        width: calc(150px * 30);
        animation: scroll-mobile 30s linear infinite;
    }
    
    @keyframes scroll-mobile {
        0% {
            transform: translateX(0);
        }
        100% {
            transform: translateX(calc(-150px * 15));
        }
    }
    
    /* RTL mobile */
    html[dir="rtl"] .logo-slide-track {
        animation: scroll-mobile-rtl 30s linear infinite;
    }
    
    @keyframes scroll-mobile-rtl {
        0% {
            transform: translateX(0);
        }
        100% {
            transform: translateX(calc(150px * 15));
        }
    }
}

@media (max-width: 480px) {
    .logo-slide {
        width: 120px;
        height: 60px;
        padding: 0.5rem;
    }
    
    .logo-slide-track {
        width: calc(120px * 30);
        animation: scroll-small 25s linear infinite;
    }
    
    @keyframes scroll-small {
        0% {
            transform: translateX(0);
        }
        100% {
            transform: translateX(calc(-120px * 15));
        }
    }
    
    /* RTL small screens */
    html[dir="rtl"] .logo-slide-track {
        animation: scroll-small-rtl 25s linear infinite;
    }
    
    @keyframes scroll-small-rtl {
        0% {
            transform: translateX(0);
        }
        100% {
            transform: translateX(calc(120px * 15));
        }
    }
}
