/**
 * Header Styles - Enhanced hosting.com inspired design
 * CloudHosting.lu Theme
 */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
}

/* Custom CSS Variables */
:root {
    --primary-blue: #1e40af;
    --primary-blue-dark: #1e3a8a;
    --primary-blue-light: #3b82f6;
    --secondary-blue: #60a5fa;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.3s ease-in-out;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Utility Bar Styles */
.utility-bar {
    background: linear-gradient(135deg, var(--primary-blue-dark) 0%, var(--primary-blue) 100%);
    color: white;
    position: relative;
    z-index: 50;
}

.utility-bar a {
    transition: color var(--transition-fast);
}

.utility-bar a:hover {
    color: rgba(255, 255, 255, 1);
}

.utility-bar svg {
    transition: transform var(--transition-fast);
}

.utility-bar a:hover svg {
    transform: scale(1.1);
}

/* Language Dropdown */
.language-dropdown {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Main Header Styles */
.main-header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    top: 0;
    z-index: 40;
    transition: box-shadow var(--transition-normal);
}

.main-header.shadow-lg {
    box-shadow: var(--shadow-lg);
}

/* Logo Styles */
.site-logo {
    transition: transform var(--transition-fast);
}

.site-logo:hover {
    transform: translateY(-1px);
}

.logo-icon {
    background: linear-gradient(135deg, var(--primary-blue-light), var(--primary-blue));
    box-shadow: var(--shadow-sm);
}

.custom-logo {
    transition: transform var(--transition-fast);
}

.custom-logo:hover {
    transform: scale(1.05);
}

/* Navigation Styles */
.nav-menu-btn {
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
    border-radius: 0.5rem;
}

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

.nav-menu-btn:hover::before {
    left: 100%;
}

.nav-menu-btn svg {
    transition: transform var(--transition-normal);
}

.nav-menu-btn:hover svg {
    transform: rotate(180deg);
}

.nav-menu-btn:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* Header Actions */
.header-actions a,
.header-actions button {
    position: relative;
    transition: all var(--transition-normal);
    border-radius: 0.5rem;
}

.header-actions a:hover,
.header-actions button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.cart-link {
    position: relative;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    min-width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

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

/* Domain Search Styles */
.domain-search-bar {
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    transition: all var(--transition-normal);
}

.search-input {
    transition: all var(--transition-fast);
    border: 1px solid var(--gray-300);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.search-btn {
    background: linear-gradient(135deg, var(--primary-blue-light), var(--primary-blue));
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

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

.search-btn:hover::before {
    left: 100%;
}

.search-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.search-btn:active {
    transform: translateY(0);
}

/* Domain Offers */
.domain-offer {
    transition: all var(--transition-normal);
    border: 1px solid var(--gray-200);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.domain-offer:hover {
    background: white;
    border-color: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.domain-icon {
    background: linear-gradient(135deg, var(--primary-blue-light), var(--primary-blue));
    transition: transform var(--transition-fast);
}

.domain-offer:hover .domain-icon {
    transform: scale(1.05);
}

/* Dropdown Content */
#dropdown-content {
    transition: all var(--transition-fast);
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    box-shadow: var(--shadow-md);
}

.dropdown-menu-content {
    opacity: 0;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
}

.dropdown-menu-content:not(.hidden) {
    opacity: 1;
    transform: translateY(0);
}

.dropdown-menu-content a {
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.dropdown-menu-content a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.3s;
}

.dropdown-menu-content a:hover::before {
    left: 100%;
}

.dropdown-menu-content a:hover {
    background: var(--primary-blue);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Mobile Navigation */
.mobile-nav {
    backdrop-filter: blur(10px);
}

.mobile-nav-content {
    transition: transform var(--transition-normal) cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-xl);
}

.mobile-nav.active .mobile-nav-content {
    transform: translateX(0);
}

.mobile-menu-toggle svg {
    transition: transform var(--transition-normal);
}

.mobile-menu-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.mobile-nav-menu a {
    transition: all var(--transition-fast);
    position: relative;
}

.mobile-nav-menu a::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: var(--primary-blue);
    transition: width var(--transition-normal);
}

.mobile-nav-menu a:hover::before {
    width: 100%;
}

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

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

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

.animate-fade-in-up {
    animation: fadeInUp 0.3s ease-out;
}

.animate-fade-in-down {
    animation: fadeInDown 0.3s ease-out;
}

.animate-slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators */
.focus-visible:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .nav-menu-btn:hover {
        background: var(--gray-900);
        color: white;
    }
    
    .dropdown-menu-content a:hover {
        background: var(--gray-900);
        color: white;
    }
}

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

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --gray-50: #1f2937;
        --gray-100: #374151;
        --gray-200: #4b5563;
        --gray-300: #6b7280;
        --gray-400: #9ca3af;
        --gray-500: #d1d5db;
        --gray-600: #e5e7eb;
        --gray-700: #f3f4f6;
        --gray-800: #f9fafb;
        --gray-900: #ffffff;
    }
    
    .main-header {
        background: var(--gray-50);
        border-bottom-color: var(--gray-200);
    }
    
    .domain-search-bar {
        background: var(--gray-100);
        border-top-color: var(--gray-200);
    }
    
    #dropdown-content {
        background: var(--gray-100);
        border-top-color: var(--gray-200);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .utility-bar {
        display: none;
    }
    
    .main-header .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .domain-search-bar .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 768px) {
    .header-content {
        gap: 1rem;
        padding: 0.75rem 1rem;
    }
    
    .site-logo {
        font-size: 1.25rem;
    }
    
    .logo-icon {
        width: 2rem;
        height: 2rem;
    }
    
    .domain-offers {
        display: none;
    }
    
    .header-actions {
        gap: 0.5rem;
    }
    
    .login-btn span {
        display: none;
    }
}

@media (max-width: 640px) {
    .search-form {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .search-input,
    .search-btn {
        width: 100%;
    }
    
    .mobile-nav-content {
        width: 100%;
        max-width: 320px;
    }
}

/* Print styles */
@media print {
    .utility-bar,
    .main-header,
    .domain-search-bar,
    .mobile-nav,
    #dropdown-content {
        display: none !important;
    }
}

.search-btn {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem; /* Add consistent gap */
    min-width: fit-content; /* Prevent button from shrinking */
}

.search-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
}

/* Fix the specific hover effect in your template */
.search-btn span {
    transition: margin-right 0.3s ease;
    margin-right: 0;
}

.search-btn:hover span {
    margin-right: 0.5rem; /* 8px spacing */
}

.search-btn svg {
    width: 1.25rem;
    height: 1.25rem;
    transition: all 0.3s ease;
    opacity: 0;
    width: 0;
    margin-left: 0;
}

.search-btn:hover svg {
    opacity: 1;
    width: 1.25rem;
    margin-left: 0;
}

/* Alternative approach - simpler and more reliable */
.search-btn-v2 {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0;
    overflow: hidden;
}

.search-btn-v2:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
    gap: 0.5rem;
}

.search-btn-v2 .btn-text {
    transition: all 0.3s ease;
}

.search-btn-v2 .btn-arrow {
    width: 0;
    opacity: 0;
    transition: all 0.3s ease;
    overflow: hidden;
}

.search-btn-v2:hover .btn-arrow {
    width: 1.25rem;
    opacity: 1;
}
/* Mobile Navigation - Full Screen Enhancement */

/* Mobile Navigation Overlay */
.mobile-nav {
    backdrop-filter: blur(10px);
}

.mobile-nav-content {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -20px 0 50px rgba(0, 0, 0, 0.3);
    width: 100vw;
    max-width: 100vw;
}

/* Ensure mobile menu is always full screen on mobile devices */
@media (max-width: 1024px) {
    .mobile-nav-content {
        width: 100vw !important;
        max-width: 100vw !important;
        right: 0;
        left: 0;
    }
}

/* Mobile menu slides in from left */
.mobile-nav-content.-translate-x-full {
    transform: translateX(-100%);
}

.mobile-nav-content:not(.-translate-x-full) {
    transform: translateX(0);
}

/* Mobile menu toggle button styling */
.mobile-menu-toggle {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background: rgba(59, 130, 246, 0.1);
}

.mobile-menu-toggle svg {
    transition: transform 0.3s ease;
}

.mobile-menu-toggle:hover svg {
    transform: scale(1.1);
}

/* Mobile submenu animations */
.mobile-nav-menu [id^="mobile-"] {
    transition: all 0.3s ease;
    max-height: 0;
    overflow: hidden;
}

.mobile-nav-menu [id^="mobile-"]:not(.hidden) {
    max-height: 500px;
    overflow: visible;
}

/* Mobile menu links styling */
.mobile-nav-menu a {
    transition: all 0.2s ease;
    position: relative;
}

.mobile-nav-menu a::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: #3b82f6;
    transition: width 0.3s ease;
}

.mobile-nav-menu a:hover::before {
    width: 100%;
}

/* Mobile account buttons */
.mobile-nav .space-y-4 a {
    position: relative;
    overflow: hidden;
}

.mobile-nav .space-y-4 a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.mobile-nav .space-y-4 a:hover::before {
    left: 100%;
}

/* Smooth scrolling for mobile menu */
.mobile-nav-content {
    scroll-behavior: smooth;
}

/* Mobile menu header sticky positioning */
.mobile-nav-content > div:first-child {
    position: sticky;
    top: 0;
    z-index: 10;
    background: white;
    border-bottom: 1px solid #e5e7eb;
}

/* Enhanced mobile menu typography */
.mobile-nav-menu .text-lg {
    font-weight: 600;
    letter-spacing: -0.025em;
}

.mobile-nav-menu .text-base {
    font-weight: 500;
}

/* Mobile menu item spacing improvements */
.mobile-nav-menu ul > li {
    margin-bottom: 0;
}

.mobile-nav-menu ul > li:not(:last-child) {
    border-bottom: 1px solid #f3f4f6;
}

/* Mobile menu animation improvements */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.mobile-nav-menu li {
    animation: slideInRight 0.3s ease-out;
    animation-fill-mode: both;
}

.mobile-nav-menu li:nth-child(1) { animation-delay: 0.1s; }
.mobile-nav-menu li:nth-child(2) { animation-delay: 0.15s; }
.mobile-nav-menu li:nth-child(3) { animation-delay: 0.2s; }
.mobile-nav-menu li:nth-child(4) { animation-delay: 0.25s; }
.mobile-nav-menu li:nth-child(5) { animation-delay: 0.3s; }
.mobile-nav-menu li:nth-child(6) { animation-delay: 0.35s; }

/* Prevent body scroll when mobile menu is open */
body.overflow-hidden {
    overflow: hidden;
    height: 100vh;
}

/* Mobile menu overlay improvements */
.mobile-nav > div:first-child {
    background: rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s ease;
}

/* Close button hover effects */
.mobile-nav-close:hover {
    background: rgba(107, 114, 128, 0.1);
    border-radius: 0.5rem;
}

/* Mobile contact info styling */
.mobile-nav a[href^="tel:"] {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 0.75rem;
    padding: 1rem;
    transition: all 0.3s ease;
}

.mobile-nav a[href^="tel:"]:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .mobile-nav-content {
        font-size: 16px;
    }
    
    .mobile-nav-menu .text-lg {
        font-size: 1.125rem;
    }
    
    .mobile-nav-menu .text-base {
        font-size: 1rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .mobile-menu-toggle:hover {
        background: #000;
        color: #fff;
    }
    
    .mobile-nav-menu a:hover {
        background: #000;
        color: #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .mobile-nav-content,
    .mobile-menu-toggle,
    .mobile-menu-toggle svg,
    .mobile-nav-menu [id^="mobile-"],
    .mobile-nav-menu a {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* Dark mode support for mobile menu */
@media (prefers-color-scheme: dark) {
    .mobile-nav-content {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .mobile-nav-content > div:first-child {
        background: #1f2937;
        border-bottom-color: #374151;
    }
    
    .mobile-nav-menu a {
        color: #d1d5db;
    }
    
    .mobile-nav-menu a:hover {
        color: #f9fafb;
    }
    
    .mobile-nav-menu .text-gray-900 {
        color: #f9fafb;
    }
    
    .mobile-nav-menu .text-gray-600 {
        color: #d1d5db;
    }
}