﻿/* =============================================
   CORXOR UTILITY CLASSES & MOBILE OPTIMIZATION
   Add this last to override any conflicts
   ============================================= */

/* =============================================
   UTILITY CLASSES
   ============================================= */

/* Gradients */
.gradient-text {
    background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-bg-cosmic {
    background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
}

/* Glass effect */
.glass {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.glass-dark {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(148, 163, 184, 0.15);
}

/* Shadows */
.shadow-soft {
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.shadow-medium {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.shadow-strong {
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.18);
}

.shadow-dramatic {
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.24);
}

/* Animations */
.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

.animate-slide-up {
    animation: slideUp 0.6s ease-out;
}

.animate-scale-in {
    animation: scaleIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* =============================================
   ENHANCED NAVBAR (Mobile-First)
   ============================================= */

#navigation {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
    transition: all 0.3s ease;
}

    #navigation.scrolled {
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    }

.navbar-brand .logo {
    transition: transform 0.3s ease;
}

.navbar-brand:hover .logo {
    transform: scale(1.05);
}


/* base nav link style */
.navbar-nav .nav-link {
    position: relative;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: color 0.3s ease;
}

    /* underline ONLY for links that are NOT dropdown toggles */
    .navbar-nav .nav-link:not(.dropdown-toggle)::after {
        content: '';
        position: absolute;
        bottom: -2px;
        left: 50%;
        transform: translateX(-50%) scaleX(0);
        width: 80%;
        height: 2px;
        background: linear-gradient(90deg, #4f46e5, #06b6d4);
        transition: transform 0.3s ease;
    }

    .navbar-nav .nav-link:not(.dropdown-toggle):hover::after,
    .navbar-nav .nav-link:not(.dropdown-toggle).active::after {
        transform: translateX(-50%) scaleX(1);
    }

.navbar-nav .dropdown-toggle:hover,
.navbar-nav .dropdown-toggle:focus {
    color: black; /* or any color you like */
}

/* proper caret icon for dropdown links */
.navbar-nav .dropdown-toggle::after {
    content: "";
    display: inline-block;
    margin-left: 0.3rem;
    vertical-align: 0.2rem;
    border-top: 0.35em solid currentColor;
    border-right: 0.35em solid transparent;
    border-left: 0.35em solid transparent;
    border-bottom: 0;
    position: static; /* so it stays to the right of text */
    transform: none; /* cancel any previous transform */
    background: none; /* kill the gradient from the underline rule */
    width: auto;
    height: auto;
}

/* Mobile menu enhancement */
@media (max-width: 991px) {
    .navbar-collapse {
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        padding: 1.5rem;
        margin-top: 1rem;
        border-radius: 16px;
        box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
    }

    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        border-radius: 8px;
        margin: 0.25rem 0;
    }

        .navbar-nav .nav-link:hover {
            background: rgba(79, 70, 229, 0.08);
        }

    .dropdown-menu {
        border: none;
        box-shadow: none;
        background: transparent;
        padding-left: 1rem;
    }
}

/* =============================================
   ENHANCED FOOTER
   ============================================= */

footer {
    background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
    color: #e5e7eb;
}

    footer .footer-top {
        padding: 3rem 0;
        border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    }

    footer .footer-bottom {
        padding: 1.5rem 0;
        background: rgba(0, 0, 0, 0.2);
    }

    footer .logo {
        filter: brightness(1.2);
        transition: transform 0.3s ease;
    }

        footer .logo:hover {
            transform: scale(1.05);
        }

    footer .link {
        color: #ffffff;
        font-weight: 700;
        margin-bottom: 1rem;
        font-size: 1.1rem;
        letter-spacing: 0.02em;
    }

    footer .footer-menu li {
        margin-bottom: 0.5rem;
    }

    footer .footer-menu a {
        color: #cbd5e1;
        text-decoration: none;
        transition: all 0.3s ease;
        display: inline-block;
    }

        footer .footer-menu a:hover {
            color: #ffffff;
            transform: translateX(4px);
        }

/* =============================================
   ENHANCED LANGUAGE POPUP
   ============================================= */

.language-popup {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

.language-popup-content {
    animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.language-popup .title {
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: #0f172a;
    text-align: center;
}

.language-switcher a {
    transition: all 0.3s ease;
    font-weight: 600;
}

    .language-switcher a:hover {
        background: #f3f4f6;
        border-color: #4f46e5;
        color: #4f46e5;
        transform: translateY(-2px);
    }

.language-switcher li.active a {
    background: linear-gradient(135deg, #4f46e5, #06b6d4);
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* =============================================
   ENHANCED CONTACT PAGE
   ============================================= */

.contact-card {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(2, 6, 23, 0.98));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.form-control:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

    .btn-primary::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.2);
        transform: translate(-50%, -50%);
        transition: width 0.6s, height 0.6s;
    }

    .btn-primary:hover::before {
        width: 300px;
        height: 300px;
    }

    .btn-primary:active {
        transform: scale(0.98);
    }

/* =============================================
   MOBILE OPTIMIZATIONS
   ============================================= */

@media (max-width: 768px) {
    /* Typography adjustments */
    h1, .h1 {
        font-size: 2rem;
    }

    h2, .h2 {
        font-size: 1.75rem;
    }

    h3, .h3 {
        font-size: 1.5rem;
    }

    /* Spacing adjustments */
    .home-section {
        padding: 2.5rem 0;
    }

    /* Card spacing */
    .service-card,
    .blog-card,
    .home-tips .box {
        margin-bottom: 1.5rem;
    }

    /* Better touch targets */
    button,
    a,
    .btn {
        min-height: 44px;
        min-width: 44px;
    }

    /* Improved form elements */
    input,
    textarea,
    select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

@media (max-width: 576px) {
    /* Even smaller screens */
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Compact cards */
    .service-card,
    .blog-card {
        padding: 1.25rem;
    }

    /* Stack elements */
    .home-tips .box {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1rem;
    }

    .home-tips .media-icon {
        margin: 0 auto;
    }
}

/* =============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================= */

/* Focus states */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

/* Skip to main content link */
.skip-to-main {
    position: absolute;
    left: -9999px;
    z-index: 999;
    padding: 1rem 1.5rem;
    background: #4f46e5;
    color: white;
    text-decoration: none;
    border-radius: 0 0 8px 8px;
}

    .skip-to-main:focus {
        left: 50%;
        transform: translateX(-50%);
        top: 0;
    }

/* 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;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .service-card,
    .blog-card,
    .home-tips .box {
        border: 2px solid currentColor;
    }
}

/* =============================================
   PRINT STYLES
   ============================================= */

@media print {
    .navbar,
    footer,
    .hero-slider,
    .owl-nav,
    .owl-dots,
    #scrollToTop,
    .language-popup {
        display: none !important;
    }

    .service-card,
    .blog-card {
        break-inside: avoid;
    }

    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
}



/* =============================================
   MOBILE MENU & DROPDOWN FIX
   Add this to the END of modern-utilities.css
   ============================================= */

/* =============================================
   FIX DROPDOWN MENUS (Desktop & Mobile)
   ============================================= */

/* Ensure dropdowns work properly */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    min-width: 200px;
    padding: 0.5rem;
    margin: 0.125rem 0 0;
    font-size: 0.95rem;
    color: #212529;
    text-align: left;
    list-style: none;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0,0,0,.15);
    border-radius: 0.5rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

    /* Show dropdown when active */
    .dropdown-menu.show {
        display: block;
    }

/* Dropdown items */
.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    clear: both;
    font-weight: 400;
    color: #212529;
    text-align: inherit;
    text-decoration: none;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

    .dropdown-item:hover,
    .dropdown-item:focus {
        color: #4f46e5;
        background-color: rgba(79, 70, 229, 0.08);
    }

/* =============================================
   MEGA MENU FIXES
   ============================================= */

.dropdown-menu.mega-menu {
    min-width: 600px;
    padding: 1.5rem;
}

.dropdown-menu.product-menu {
    min-width: 800px;
}

/* =============================================
   MOBILE SPECIFIC FIXES
   ============================================= */

@media (max-width: 991px) {
    /* Make navbar collapsible work properly */
    .navbar-collapse {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-in-out;
    }

        .navbar-collapse.show,
        .navbar-collapse.collapsing {
            max-height: 100vh;
            overflow-y: auto;
        }

    /* Mobile dropdown behavior */
    .navbar-nav .dropdown-menu {
        position: static;
        float: none;
        width: auto;
        margin-top: 0;
        background-color: transparent;
        border: 0;
        box-shadow: none;
        padding-left: 1rem;
    }

        .navbar-nav .dropdown-menu.show {
            display: block;
        }

    /* Mobile dropdown toggle */
    .navbar-nav .dropdown-toggle {
        width: 100%;
        text-align: left;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

        .navbar-nav .dropdown-toggle::after {
            margin-left: auto;
        }

    /* Mega menu mobile */
    .dropdown-menu.mega-menu,
    .dropdown-menu.product-menu {
        min-width: 100%;
    }

    /* Mobile dropdown items */
    .navbar-nav .dropdown-item {
        padding: 0.65rem 0.75rem;
        font-size: 0.9rem;
        border-radius: 6px;
        margin: 0.25rem 0;
    }
}

/* =============================================
   ENSURE BOOTSTRAP DROPDOWN JS WORKS
   ============================================= */

/* Dropdown trigger fix */
[data-toggle="dropdown"] {
    cursor: pointer;
}

/* Prevent body scroll when mobile menu open */
body.mobile-menu-open {
    overflow: hidden;
}

@media (max-width: 991px) {
    body.mobile-menu-open .navbar-collapse {
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }
}

/* =============================================
   HAMBURGER BUTTON ANIMATION
   ============================================= */

.navbar-toggler {
    padding: 0.5rem 0.75rem;
    font-size: 1.25rem;
    line-height: 1;
    background-color: transparent;
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: 8px;
    transition: all 0.3s ease;
}

    .navbar-toggler:focus {
        outline: 0;
        box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
        border-color: #4f46e5;
    }

    .navbar-toggler:hover {
        background-color: rgba(79, 70, 229, 0.05);
    }

/* Animated hamburger icon */
.navbar-toggler-icon {
    display: inline-block;
    width: 1.5em;
    height: 1.5em;
    vertical-align: middle;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgb(79, 70, 229)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100%;
    transition: all 0.3s ease;
    position: relative;
}

/* Transform to X icon when menu is open */
.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgb(79, 70, 229)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M6 6L24 24M6 24L24 6'/%3e%3c/svg%3e");
    transform: rotate(0deg);
}

/* Ensure toggler is always visible and properly styled */
.navbar-toggler {
    position: relative;
    z-index: 1031;
}

@media (max-width: 991px) {
    .navbar-toggler {
        padding: 0.4rem 0.6rem;
        margin-right: 0.5rem;
    }

    .navbar-toggler-icon {
        width: 1.3em;
        height: 1.3em;
    }
}

/* =============================================
   FIX FOR DROPDOWN NOT WORKING
   ============================================= */

/* Ensure dropdown parent is positioned */
.nav-item.dropdown {
    position: relative;
}

/* Desktop dropdown positioning */
@media (min-width: 992px) {
    .navbar-nav .dropdown-menu {
        position: absolute;
    }

    /* Hover effect for desktop */
    .navbar-nav .dropdown:hover > .dropdown-menu {
        display: block;
        animation: slideDown 0.3s ease;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================================
   ACCESSIBILITY & KEYBOARD NAVIGATION
   ============================================= */

/* Focus visible for keyboard users */
.dropdown-toggle:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

.dropdown-item:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: -2px;
}

/* =============================================
   LANGUAGE POPUP MOBILE FIX
   ============================================= */

@media (max-width: 576px) {
    .language-popup-content {
        width: 95%;
        max-width: 95%;
        padding: 1.25rem;
    }

    .language-switcher li {
        flex: 0 0 100%;
        max-width: 100%;
    }
}