/* UI Fixes for Better Visibility and User Experience */

/* Preloader Enhancements */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}
.navbar-toggler:focus {
    text-decoration: none;
    outline: 0;
    box-shadow: unset;
}

.preloader-content {
    text-align: center;
}

.tech-logo {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: pulse 2s infinite;
}

.loading-text {
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.loading-bar {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.loading-progress {
    height: 100%;
    background: var(--primary-color);
    width: 0;
    border-radius: 2px;
    animation: loading 2s ease-in-out infinite;
}

@keyframes loading {
    0% { width: 0; }
    50% { width: 80%; }
    100% { width: 100%; }
}

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

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    box-shadow: var(--box-shadow-lg);
    transition: var(--transition);
    z-index: 1000;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: var(--box-shadow-xl);
}

.back-to-top.show {
    display: flex;
    animation: fadeInUp 0.3s ease;
}

/* Floating Cards */
.floating-card {
    position: absolute;
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow-lg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 200px;
}

.floating-card .card-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: white;
}

.floating-card h6 {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.floating-card p {
    font-size: 0.875rem;
    color: var(--secondary-color);
    margin: 0;
}

.floating-card.card-1 {
    top: 20%;
    right: -20px;
    animation: float 6s ease-in-out infinite;
}

.floating-card.card-2 {
    top: 50%;
    left: -30px;
    animation: float 6s ease-in-out infinite 2s;
}

.floating-card.card-3 {
    bottom: 20%;
    right: -10px;
    animation: float 6s ease-in-out infinite 4s;
}

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

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    animation: bounce 2s infinite;
}

.scroll-text {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.scroll-arrow {
    font-size: 1.2rem;
    animation: bounceArrow 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

@keyframes bounceArrow {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(5px); }
    60% { transform: translateY(2px); }
}

/* Hero Badge */
.hero-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 2rem;
    color: rgb(0, 0, 0);
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(45deg, #f093fb 0%, #f5576c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Search Modal Improvements */

.search-input-group {
    position: relative;
    margin-bottom: 2rem;
    border: 2px solid var(--black);
    background: border-box;
}

.search-input-group .form-control {
    padding-right: 60px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    font-size: 1.1rem;
    padding: 1rem 1.5rem;
}

.search-input-group .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(48, 127, 226, 0.2);
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: #ffffff;
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius);
    width: 50px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    transition: var(--transition);
}

.search-btn:hover {
    /* background: var(--primary-dark); */
    transform: translateY(-50%) scale(1.05);
}

.suggestions-title {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.suggestions-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.suggestion-tag {
    padding: 0.25rem 0.75rem;
    background: var(--light-color);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 20px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
}

.suggestion-tag:hover {
    background: var(--primary-color);
    color: white;
}

/* Mobile Responsive Improvements */
@media (max-width: 768px) {
    .floating-card {
        position: static;
        margin-bottom: 1rem;
        animation: none !important;
    }

    .hero-title {
        font-size: 2.5rem !important;
    }
 .hero-badge {
             margin-top: 2rem;
    }
    .hero-subtitle {
        font-size: 1.1rem !important;
    }

    .hero-stats {
        justify-content: center;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }

    .scroll-indicator {
        bottom: 20px;
    }
}

@media (max-width: 576px) {
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .hero-actions .btn {
        margin-bottom: 1rem;
        width: 100%;
        max-width: 280px;
    }

    .clients-logos {
        justify-content: center;
    }
}

/* Accessibility/contrast fixes for navbar on scroll and buttons on light bg */
.navbar.scrolled {
    background: #ffffff !important; /* solid background when scrolled */
    box-shadow: 0 6px 20px rgba(0,0,0,.08) !important;
}

.navbar.scrolled .navbar-brand {
    background: none !important; /* remove gradient text clip for readability */
    -webkit-text-fill-color: initial !important;
    color: var(--primary-color) !important;
}

.navbar.scrolled .nav-link {
    color: var(--dark-color, #1f2937) !important;
}

.navbar.scrolled .nav-link:hover,
.navbar.scrolled .nav-link:focus {
    background: rgba(0,0,0,.06) !important;
}

/* Ensure toggler/icon visible on light background */
.navbar.scrolled .navbar-toggler,
.navbar.scrolled .navbar-toggler i,
.navbar.scrolled .navbar-toggler .icon {
    color: var(--dark-color, #1f2937) !important;
    border-color: rgba(0,0,0,.15) !important;
}

/* Outline light buttons become visible on light backgrounds */
.navbar.scrolled .btn-outline-light {
    color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    background: transparent !important;
}

/* Generic helper to invert light outline in any light section */
.light-bg .btn-outline-light,
.bg-white .btn-outline-light {
    color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    background: transparent !important;
}
.form-control {
    border: 2px solid #e2e8f0;
    border-radius: var(--border-radius);
    padding: 1rem;
    font-size: 1rem;
    transition: var(--transition);
    background: white !important;
}