/* Custom CSS for Modern Alimane Home Page */

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

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

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

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

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

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(34, 197, 94, 0.6);
    }
}

/* Animation classes */
.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.8s ease-out;
}

.animate-fade-in-right {
    animation: fadeInRight 0.8s ease-out;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

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

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

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.glass-dark {
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(75, 85, 99, 0.3);
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #16a34a;
}

/* Dark mode scrollbar */
.dark ::-webkit-scrollbar-track {
    background: #1f2937;
}

.dark ::-webkit-scrollbar-thumb {
    background: #22c55e;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #16a34a;
}

/* Button animations */
.btn-primary {
    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%;
}

/* Card hover effects */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Image hover effects */
.image-hover {
    transition: all 0.3s ease;
}

.image-hover:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* Text selection */
::selection {
    background: #22c55e;
    color: white;
}

/* Focus styles */
.focus-ring:focus {
    outline: 2px solid #22c55e;
    outline-offset: 2px;
}

/* Loading animation */
.loading-dots {
    display: inline-block;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {
    0%, 20% {
        content: '';
    }
    40% {
        content: '.';
    }
    60% {
        content: '..';
    }
    80%, 100% {
        content: '...';
    }
}

/* Responsive utilities */
@media (max-width: 768px) {
    .mobile-hidden {
        display: none;
    }
    
    .mobile-text-center {
        text-align: center;
    }
    
    .mobile-p-4 {
        padding: 1rem;
    }
}

@media (min-width: 1024px) {
    .desktop-visible {
        display: block;
    }
    
    .desktop-hidden {
        display: none;
    }
}

/* Dark mode transitions */
* {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* Custom focus for accessibility */
.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;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn-primary {
        border: 2px solid currentColor;
    }
    
    .card-hover {
        border: 1px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .animate-fade-in-up,
    .animate-fade-in-left,
    .animate-fade-in-right,
    .animate-float,
    .animate-pulse-glow {
        animation: none;
    }
}

/* Hero Section Specific Styles */
#hero-carousel {
    position: relative;
    overflow: hidden;
}

#hero-carousel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Enhanced text visibility */
#hero-carousel h1 {
    text-shadow:
        2px 2px 4px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(0, 0, 0, 0.5);
    letter-spacing: -0.02em;
}

#hero-carousel p {
    text-shadow:
        1px 1px 2px rgba(0, 0, 0, 0.8),
        0 0 10px rgba(0, 0, 0, 0.5);
}

/* Promotional badge styling */
#hero-carousel .bg-yellow-500 {
    box-shadow: 0 4px 15px rgba(234, 179, 8, 0.4);
    text-shadow: none;
}

/* 34% highlight styling */
#hero-carousel .text-yellow-400 {
    text-shadow:
        3px 3px 6px rgba(0, 0, 0, 0.9),
        0 0 30px rgba(234, 179, 8, 0.3);
    filter: drop-shadow(0 0 20px rgba(234, 179, 8, 0.5));
}

/* Button enhancements */
#hero-carousel .shadow-2xl {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

#hero-carousel .hover\:shadow-primary-500\/50:hover {
    box-shadow: 0 25px 50px -12px rgba(34, 197, 94, 0.5);
}

#hero-carousel .hover\:shadow-white\/50:hover {
    box-shadow: 0 25px 50px -12px rgba(255, 255, 255, 0.5);
}

/* Carousel controls enhancement */
#hero-carousel button[data-carousel-prev],
#hero-carousel button[data-carousel-next] {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

#hero-carousel button[data-carousel-prev]:hover,
#hero-carousel button[data-carousel-next]:hover {
    background: rgba(0, 0, 0, 0.7) !important;
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

/* Carousel indicators enhancement */
#hero-carousel .carousel-indicator {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

#hero-carousel .carousel-indicator:hover {
    transform: scale(1.2);
    border-color: rgba(255, 255, 255, 0.5);
}

#hero-carousel .carousel-indicator.active {
    background: white !important;
    transform: scale(1.3);
    border-color: white;
}

/* Responsive adjustments for hero section */
@media (max-width: 640px) {
    #hero-carousel {
        height: 80vh !important;
    }

    #hero-carousel h1 {
        font-size: 2.5rem !important;
        line-height: 1.1 !important;
    }

    #hero-carousel .text-6xl {
        font-size: 4rem !important;
    }

    #hero-carousel .text-2xl {
        font-size: 1.5rem !important;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    #hero-carousel {
        height: 75vh !important;
    }

    #hero-carousel h1 {
        font-size: 3.5rem !important;
    }

    #hero-carousel .text-6xl {
        font-size: 5rem !important;
    }
}

@media (min-width: 1025px) {
    #hero-carousel {
        height: 85vh !important;
    }

    #hero-carousel h1 {
        font-size: 4.5rem !important;
    }

    #hero-carousel .text-6xl {
        font-size: 6rem !important;
    }
}

/* Token IMANE badge enhancement */
#hero-carousel .bg-white\/20 {
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Image overlay optimization */
#hero-carousel .bg-gradient-to-r {
    background: linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.8) 0%,
        rgba(0, 0, 0, 0.6) 30%,
        rgba(0, 0, 0, 0.4) 60%,
        rgba(0, 0, 0, 0.2) 100%
    );
}

/* Navbar Responsiveness Enhancements */
.navbar {
    transition: all 0.3s ease;
}

/* Logo responsive sizing */
.navbar .logo {
    transition: all 0.3s ease;
}

/* Centered navigation menu */
@media (min-width: 768px) {
    .navbar > div {
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        gap: 2rem;
    }
    
    .navbar #navbar-dropdown {
        justify-self: center;
        margin: 0 auto;
    }
    
    .navbar #navbar-dropdown ul {
        display: flex;
        justify-content: center;
        align-items: center;
    }
}

/* Navigation menu responsive spacing */
@media (min-width: 768px) and (max-width: 1023px) {
    .navbar ul[class*="md:space-x-"] {
        gap: 1rem !important;
    }
    
    .navbar .text-sm {
        font-size: 0.875rem !important;
    }
}

@media (min-width: 1024px) and (max-width: 1279px) {
    .navbar ul[class*="lg:space-x-"] {
        gap: 1.5rem !important;
    }
}

@media (min-width: 1280px) {
    .navbar ul[class*="xl:space-x-"] {
        gap: 2rem !important;
    }
}

/* Mobile menu improvements */
@media (max-width: 767px) {
    .navbar #navbar-dropdown {
        max-height: 80vh;
        overflow-y: auto;
        order: 3;
        width: 100%;
    }
    
    .navbar #navbar-dropdown ul {
        padding: 1rem 0;
    }
    
    .navbar #navbar-dropdown li {
        border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    }
    
    .navbar #navbar-dropdown li:last-child {
        border-bottom: none;
    }
}

/* Dropdown menu positioning fix */
.navbar .language-selector .dropdown-menu {
    right: 0;
    left: auto;
}

/* Button responsive sizing */
@media (max-width: 639px) {
    .navbar button[data-collapse-toggle],
    .navbar .language-selector button {
        width: 2rem;
        height: 2rem;
    }
    
    .navbar .language-selector button svg {
        width: 1rem;
        height: 1rem;
    }
}

/* Smooth transitions for all navbar elements */
.navbar * {
    transition: all 0.2s ease;
}

/* Hover effects optimization */
.navbar a:hover,
.navbar button:hover {
    transform: translateY(-1px);
}

/* Focus states for accessibility */
.navbar button:focus,
.navbar a:focus {
    outline: 2px solid #22c55e;
    outline-offset: 2px;
}

/* Dark mode navbar adjustments */
@media (prefers-color-scheme: dark) {
    .navbar {
        backdrop-filter: blur(10px);
        background: rgba(17, 24, 39, 0.95);
    }
}

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

/* Enhanced navbar layout for better centering */
.navbar nav > div {
    position: relative;
}

/* Logo positioning */
.navbar a[href*="home"] {
    z-index: 10;
}

/* Right side buttons positioning */
.navbar .flex.items-center.space-x-2 {
    z-index: 10;
}

/* Center navigation menu */
.navbar #navbar-dropdown {
    position: relative;
    z-index: 5;
}

/* Responsive grid adjustments */
@media (min-width: 768px) {
    .navbar nav > div {
        display: grid;
        grid-template-columns: minmax(auto, 200px) 1fr minmax(auto, 300px);
        align-items: center;
        gap: 1rem;
    }
    
    .navbar #navbar-dropdown {
        grid-column: 2;
        justify-self: center;
    }
    
    .navbar #navbar-dropdown ul {
        display: flex;
        justify-content: center;
        align-items: center;
        flex-wrap: nowrap;
    }
}

@media (min-width: 1024px) {
    .navbar nav > div {
        gap: 2rem;
    }
}

@media (min-width: 1280px) {
    .navbar nav > div {
        gap: 3rem;
    }
}
