/* IQRAE School Website - Custom Styles */

/* Root Variables */
:root {
    --iqrae-blue: #1e3a5f;
    --iqrae-cyan: #00a8e8;
    --iqrae-gold: #d4af37;
    --iqrae-light: #e8f4f8;
    --iqrae-dark: #0d2137;
}

/* Custom Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

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

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

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

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Animation Classes */
.animate-fade-in {
    animation: fadeIn 1s ease-out forwards;
}

.animate-slide-up {
    animation: slideUp 0.8s ease-out forwards;
    opacity: 0;
}

.animate-slide-in-left {
    animation: slideInLeft 0.8s ease-out forwards;
    opacity: 0;
}

.animate-slide-in-right {
    animation: slideInRight 0.8s ease-out forwards;
    opacity: 0;
}

.floating-book {
    animation: float 4s ease-in-out infinite;
}

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

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

::-webkit-scrollbar-track {
    background: var(--iqrae-light);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, var(--iqrae-blue), var(--iqrae-cyan));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--iqrae-cyan);
}

/* Selection Color */
::selection {
    background: var(--iqrae-cyan);
    color: white;
}

/* Navbar Styles */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(to right, var(--iqrae-blue), var(--iqrae-cyan));
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.navbar-scrolled {
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Timeline Styles */
.timeline-item {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Value Card Hover Effects */
.value-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.value-card:hover {
    transform: translateY(-10px) scale(1.02);
}

/* Achievement Card Styles */
.achievement-card {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.achievement-card:hover::before {
    left: 100%;
}

/* Infrastructure Card Styles */
.infra-card {
    transition: all 0.4s ease;
    position: relative;
}

.infra-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.infra-card:hover::after {
    opacity: 1;
}

/* Testimonial Card Styles */
.testimonial-card {
    transition: all 0.4s ease;
    position: relative;
}

.testimonial-card::before {
    content: '"';
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 80px;
    font-family: Georgia, serif;
    color: var(--iqrae-cyan);
    opacity: 0.1;
    line-height: 1;
}

.testimonial-card:hover {
    transform: translateY(-5px);
}

/* Team Card Styles */
.team-card {
    transition: all 0.3s ease;
}

.team-card:hover {
    transform: translateY(-10px);
}

/* Form Styles */
input:focus, select:focus, textarea:focus {
    outline: none;
}

/* Button Hover Effects */
button, a {
    transition: all 0.3s ease;
}

/* Loading Animation */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Counter Animation */
.counter {
    display: inline-block;
}

/* Back to Top Button */
#back-to-top {
    transition: all 0.3s ease;
}

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

#back-to-top:hover {
    transform: translateY(-5px);
}

/* Mobile Menu Animation */
#mobile-menu {
    transition: all 0.3s ease;
}

#mobile-menu.active {
    display: block;
}

/* Hero Section Gradient Animation */
.hero-gradient {
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Parallax Effect */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Card Shadows */
.card-shadow {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.card-shadow:hover {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

/* Text Gradient */
.text-gradient {
    background: linear-gradient(to right, var(--iqrae-blue), var(--iqrae-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glow Effect */
.glow {
    animation: pulse-glow 2s infinite;
}

/* Arabic Text Styling */
.font-arabic {
    direction: rtl;
    text-align: right;
}

/* Image Hover Zoom */
.img-zoom {
    overflow: hidden;
}

.img-zoom img {
    transition: transform 0.5s ease;
}

.img-zoom:hover img {
    transform: scale(1.1);
}

/* Badge Animation */
.badge-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Section Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .timeline-item {
        flex-direction: column !important;
    }
    
    .timeline-item > div:first-child,
    .timeline-item > div:last-child {
        width: 100%;
        padding: 0;
        margin-bottom: 1rem;
        text-align: left !important;
    }
    
    .timeline-line {
        display: none;
    }
    
    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Mobile touch-friendly improvements */
    button, a.rounded-full, .nav-link {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Better mobile padding */
    section {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Mobile navigation improvements */
    #mobile-menu a {
        padding: 0.875rem 1rem;
        min-height: 48px;
        display: flex;
        align-items: center;
    }
    
    /* Better mobile card spacing */
    .grid {
        gap: 1rem;
    }
}

@media (max-width: 640px) {
    h1 {
        font-size: 2rem !important;
        line-height: 1.2 !important;
    }
    
    h2 {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
    }
    
    .testimonial-card::before {
        font-size: 50px;
    }
    
    /* Mobile text improvements */
    p, li, span {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    /* Mobile button sizing */
    .rounded-full {
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
    }
    
    /* Mobile footer improvements */
    footer {
        padding: 2rem 1rem;
    }
    
    /* Mobile hero improvements */
    #accueil {
        padding-top: 6rem;
        min-height: auto;
    }
    
    /* Stats grid mobile */
    .grid-cols-2 {
        gap: 0.75rem;
    }
    
    /* Mobile language switcher */
    .group button {
        padding: 0.5rem;
    }
}

/* Extra small devices */
@media (max-width: 375px) {
    h1 {
        font-size: 1.75rem !important;
    }
    
    h2 {
        font-size: 1.25rem !important;
    }
    
    /* Smaller stats on very small screens */
    .text-4xl {
        font-size: 1.75rem !important;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    a {
        color: var(--iqrae-blue) !important;
        text-decoration: underline;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus States for Accessibility */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--iqrae-cyan);
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --iqrae-blue: #000066;
        --iqrae-cyan: #0066cc;
        --iqrae-gold: #cc9900;
    }
}

/* Dark Mode Support (optional) */
@media (prefers-color-scheme: dark) {
    /* Can be implemented if needed */
}
