/* Main Transitions & Performance */
:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --accent: #14b8a6;
    --transition-speed: 0.35s;
    --ease: cubic-bezier(0.2, 0, 0.2, 1);
}

body {
    font-family: 'Cairo', sans-serif;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Header Base Styles - Optimized for Zero Reflow & Compact Fixed Size */
#main-header {
    transition: background-color 0.4s var(--ease),
                box-shadow 0.4s var(--ease);
    will-change: background-color, box-shadow;
    contain: layout paint;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    background-color: rgba(79, 70, 229, 0.98) !important;
}

#main-header .top-nav-container {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
    position: relative;
    z-index: 2;
}

#main-header .logo-text {
    display: inline-block;
    transform: scale(0.85);
    transform-origin: right center;
}

#main-header .search-container {
    height: 2.5rem !important; /* Fixed compact height */
    transition: background-color 0.4s var(--ease);
}

#main-header .bottom-nav-container {
    padding-top: 0.25rem !important;
    padding-bottom: 0.25rem !important;
    background-color: rgba(67, 56, 202, 0.98) !important;
    font-size: 0.8rem !important;
    gap: 1.5rem !important;
}

#main-header .hide-on-shrink {
    opacity: 0.8;
}

#main-header .hide-on-shrink:hover {
    opacity: 1;
}

#main-header .hide-on-shrink span {
    font-size: 10px !important;
}

#main-header .hide-on-shrink i {
    width: 1rem !important;
    height: 1rem !important;
}

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

.animate-slide-up { 
    animation: slideUp 0.5s var(--ease) forwards; 
    will-change: transform, opacity;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-fade-in { 
    animation: fadeIn 0.4s ease-out forwards; 
    will-change: opacity;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.animate-fade-out {
    animation: fadeOut 0.3s ease-in forwards;
    will-change: opacity;
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.animate-zoom-in { 
    animation: zoomIn 0.4s var(--ease) forwards; 
    will-change: transform, opacity;
}

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

.animate-slide-in-right {
    animation: slideInRight 0.4s var(--ease) forwards;
    will-change: transform, opacity;
}

@keyframes shrink {
    from { width: 100%; }
    to { width: 0%; }
}

@keyframes bounceOnce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.animate-bounce-once {
    animation: bounceOnce 0.5s var(--ease);
}

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

.animate-bounce-slow {
    animation: bounceSlow 2s infinite ease-in-out;
}

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

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

@keyframes pulseSoft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.animate-pulse-soft {
    animation: pulseSoft 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

.animate-slide-in-left {
    animation: slideInLeft 0.4s var(--ease) forwards;
    will-change: transform, opacity;
}

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

.animate-shimmer {
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0) 100%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.hover-scale {
    transition: transform 0.3s var(--ease);
}
.hover-scale:hover {
    transform: scale(1.03);
}

/* Utility */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
