/* Custom styles for Berhi Group landing page */

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

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

.animate-fadeIn {
    animation: fadeIn 0.6s ease-out;
}

/* Header sticky shadow */
header.scrolled {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Hero section gradient overlay */
.hero-gradient {
    background: linear-gradient(135deg, #f3f4f6 0%, #e0e7ff 100%);
}

/* Form inputs styling */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Button hover effects */
.btn-hover-lift {
    transition: all 0.3s ease;
}

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

/* Modal backdrop blur */
#modal {
    backdrop-filter: blur(4px);
}

/* Modal close button */
#close-modal {
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
}

#close-modal:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Improved form styling */
.modal-form input:focus,
.modal-form textarea:focus {
    transform: scale(1.02);
    transition: all 0.2s ease;
}

/* Mobile modal adjustments */
@media (max-width: 640px) {
    #modal > div {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
    }
}

/* Card hover effects */
.card-hover {
    transition: all 0.3s ease;
}

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

/* Modal transitions */
#modal {
    transition: opacity 0.3s ease;
}

#modal:not(.hidden) {
    opacity: 1;
}

#modal.hidden {
    opacity: 0;
}

#modal > div {
    transition: all 0.3s ease;
    transform: scale(0.95);
}

#modal:not(.hidden) > div {
    transform: scale(1);
}

/* Mobile menu transitions */
#mobile-menu {
    transition: opacity 0.3s ease;
}

#mobile-menu > div {
    transition: transform 0.3s ease;
    transform: translateX(-100%);
}

#mobile-menu.active {
    opacity: 1;
}

#mobile-menu.active > div {
    transform: translateX(0);
}

/* Success message */
.success-message {
    background-color: #10b981;
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    animation: fadeIn 0.3s ease-out;
}

/* Error message */
.error-message {
    background-color: #ef4444;
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    animation: fadeIn 0.3s ease-out;
}

/* Loading spinner */
.spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #2563eb;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Testimonial cards */
.testimonial-card {
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    transition: all 0.3s ease;
}

.testimonial-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Partner logos filter */
.partner-logo {
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.partner-logo:hover {
    filter: grayscale(0%);
    opacity: 1;
}

/* Section dividers */
.section-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #e5e7eb, transparent);
    margin: 4rem 0;
}

/* Responsive utilities */
@media (max-width: 1024px) {
    .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .grid-cols-6 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Hide desktop navigation */
    .lg\:flex {
        display: none !important;
    }
    
    /* Show mobile menu button */
    .lg\:hidden {
        display: block;
    }
    
    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .section-padding {
        padding: 3rem 0;
    }
    
    .grid-cols-3,
    .grid-cols-4,
    .grid-cols-6 {
        grid-template-columns: 1fr;
    }
    
    .grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    .lg\:grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    .lg\:grid-cols-3 {
        grid-template-columns: 1fr;
    }
    
    .lg\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .flex-col {
        flex-direction: column;
    }
    
    .text-center {
        text-align: center;
    }
    
    .py-16 {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
    
    .py-24 {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }
    
    .text-4xl {
        font-size: 2rem;
    }
    
    .text-3xl {
        font-size: 1.5rem;
    }
    
    .text-2xl {
        font-size: 1.25rem;
    }
    
    .text-xl {
        font-size: 1.125rem;
    }
    
    .px-8 {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .py-4 {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }
    
    .gap-12 {
        gap: 2rem;
    }
    
    .gap-8 {
        gap: 1.5rem;
    }
    
    .gap-6 {
        gap: 1rem;
    }
    
    .hidden {
        display: none;
    }
    
    .md\:block {
        display: block;
    }
    
    .lg\:flex {
        display: none !important;
    }
    
    .mb-8 {
        margin-bottom: 1.5rem;
    }
    
    .mb-6 {
        margin-bottom: 1rem;
    }
    
    .mb-4 {
        margin-bottom: 0.75rem;
    }
    
    .nav-links {
        display: none;
    }
    
    .hero-content h1 {
        margin-bottom: 1.5rem;
    }
    
    .hero-content p {
        margin-bottom: 1.5rem;
    }
    
    .hero-image {
        margin-top: 2rem;
    }
    
    .workflow-steps {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }
    
    .advantages-grid {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }
    
    .examples-list {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .footer-content {
        display: flex;
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }
}

/* Print styles */
@media print {
    header,
    footer,
    .cta-button,
    #mobile-menu {
        display: none;
    }
}

/* Accessibility improvements */
.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;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Preloader styles */
#preloader {
    backdrop-filter: blur(10px);
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
}

/* Animated gradient background for preloader */
@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

#preloader::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, #2563eb, #3b82f6, #60a5fa, #2563eb);
    background-size: 400% 400%;
    animation: gradientShift 3s ease infinite;
    opacity: 0.1;
}

/* Logo glow effect */
@keyframes logoGlow {
    0%, 100% {
        filter: brightness(0) invert(1) drop-shadow(0 0 10px rgba(59, 130, 246, 0.5));
    }
    50% {
        filter: brightness(0) invert(1) drop-shadow(0 0 20px rgba(59, 130, 246, 0.8));
    }
}

#preloader img {
    animation: logoGlow 2s ease-in-out infinite;
}

/* Progress bar shine effect */
@keyframes progressShine {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

#progress-bar {
    background: linear-gradient(
        90deg,
        #2563eb 0%,
        #3b82f6 40%,
        #60a5fa 50%,
        #3b82f6 60%,
        #2563eb 100%
    );
    background-size: 200% 100%;
    animation: progressShine 2s linear infinite;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

/* Bounce animation for dots */
@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0) translateY(0);
    }
    40% {
        transform: scale(1) translateY(-10px);
    }
}

/* Fade out animation for preloader */
@keyframes fadeOut {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

.preloader-hidden {
    animation: fadeOut 0.5s ease-out forwards;
}

/* Loading text variations */
@keyframes textRotate {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Particle effects */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #60a5fa;
    border-radius: 50%;
    opacity: 0;
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0);
    }
    20% {
        opacity: 1;
        transform: translateY(-20px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) scale(0);
    }
}

/* Rotating ring glow */
@keyframes ringGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.5),
                    inset 0 0 20px rgba(59, 130, 246, 0.2);
    }
    50% {
        box-shadow: 0 0 40px rgba(59, 130, 246, 0.8),
                    inset 0 0 40px rgba(59, 130, 246, 0.4);
    }
}

#preloader .animate-spin {
    animation: spin 2s linear infinite, ringGlow 2s ease-in-out infinite;
}

/* Progress counter style */
#progress-text {
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    font-variant-numeric: tabular-nums;
}

/* Loading dots custom bounce */
#preloader .animate-bounce {
    animation: bounce 1.4s infinite ease-in-out both;
}

/* Smooth entry animation for page content */
body:not(.preloader-active) > *:not(#preloader) {
    animation: contentFadeIn 0.8s ease-out;
}

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