/**
 * Unified Navigation Component Styles
 * Consistent styling for navigation across all pages
 */

/* Navigation Base Styles */
nav[data-nav-component="unified"] {
    background-color: white;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 50;
}

/* Logo Styles */
nav[data-nav-component="unified"] .flex-shrink-0 img {
    height: 5rem; /* h-20 */
    width: auto;
    transition: transform 0.2s ease;
}

nav[data-nav-component="unified"] .flex-shrink-0 img:hover {
    transform: scale(1.02);
}

/* Desktop Navigation Links */
.nav-link {
    position: relative;
    padding: 0.5rem 0.75rem; /* px-3 py-2 */
    font-size: 0.875rem; /* text-sm */
    font-weight: 500; /* font-medium */
    text-decoration: none;
    transition: all 0.3s ease;
    color: #6b7280; /* text-gray-500 */
}

.nav-link:hover {
    color: #111827; /* text-gray-900 */
}

/* Active Navigation State */
.nav-link.nav-active {
    color: #111827; /* text-gray-900 */
    font-weight: 600;
    position: relative;
}

/* Navigation Link Underline Effect */
.nav-link:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0.75rem; /* matches px-3 */
    background-color: #ff6b00; /* Orange accent */
    transition: width 0.3s ease;
}

.nav-link:hover:after {
    width: calc(100% - 1.5rem); /* Account for px-3 on both sides */
}

.nav-link.nav-active:after {
    width: calc(100% - 1.5rem); /* Account for px-3 on both sides */
    background-color: #ff6b00;
}

/* Enhanced hover states */
.nav-link:hover {
    color: #111827; /* text-gray-900 */
    transform: translateY(-1px);
}

.nav-link.nav-active:hover {
    color: #111827;
}

/* Focus states for better accessibility */
.nav-link:focus {
    outline: none;
    box-shadow: 0 0 0 2px #3b82f6;
    border-radius: 0.25rem;
}

/* Mobile active states */
.mobile-nav-link[aria-current="page"] {
    background-color: #f9fafb; /* bg-gray-50 */
    color: #111827; /* text-gray-900 */
    font-weight: 600;
    border-left: 3px solid #ff6b00;
    padding-left: calc(0.75rem - 3px); /* Adjust for border */
}

/* Primary Button Styles */
.btn-primary {
    background-color: #ff6b00;
    color: white;
    padding: 0.5rem 1.5rem; /* px-6 py-2 */
    border-radius: 0.375rem; /* rounded-md */
    font-size: 0.875rem; /* text-sm */
    font-weight: 500; /* font-medium */
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary:hover {
    background-color: #e05e00;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Language Selector */
.lang-selector {
    font-size: 0.875rem; /* text-sm */
    border: 1px solid #d1d5db; /* border */
    border-radius: 0.25rem; /* rounded */
    padding: 0.25rem 0.5rem; /* px-2 py-1 */
    background-color: white;
    color: #374151;
    transition: border-color 0.2s ease;
}

.lang-selector:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Mobile Menu Button */
.mobile-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem; /* p-2 */
    border-radius: 0.375rem; /* rounded-md */
    color: #9ca3af; /* text-gray-400 */
    background-color: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-menu-button:hover {
    color: #6b7280; /* text-gray-500 */
    background-color: #f3f4f6; /* bg-gray-100 */
}

.mobile-menu-button:focus {
    outline: none;
    box-shadow: 0 0 0 2px #3b82f6; /* focus:ring-2 focus:ring-blue-500 */
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    background-color: white;
    border-top: 1px solid #e5e7eb; /* border-gray-200 */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 40;
}

.mobile-menu.active {
    display: block;
}

/* Mobile menu overlay for better UX */
@media (max-width: 767px) {
    .mobile-menu.active {
        position: fixed;
        top: 5rem; /* Account for nav height */
        left: 0;
        right: 0;
        bottom: 0;
        background-color: white;
        overflow-y: auto;
        z-index: 40;
    }
    
    .mobile-menu.active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }
}

/* Mobile Navigation Links */
.mobile-nav-link {
    display: block;
    padding: 1rem 1.5rem; /* Larger touch targets */
    border-radius: 0.375rem; /* rounded-md */
    font-size: 1.125rem; /* text-lg for better readability */
    font-weight: 500; /* font-medium */
    text-decoration: none;
    color: #374151; /* text-gray-700 */
    transition: all 0.2s ease;
    border-bottom: 1px solid #f3f4f6; /* Subtle separator */
    position: relative;
}

.mobile-nav-link:last-of-type {
    border-bottom: none;
}

.mobile-nav-link:hover {
    color: #111827; /* text-gray-900 */
    background-color: #f9fafb; /* bg-gray-50 */
    transform: translateX(4px); /* Subtle slide effect */
}

.mobile-nav-link:focus {
    outline: none;
    background-color: #f3f4f6;
    box-shadow: inset 3px 0 0 #ff6b00;
}

.mobile-nav-link.text-gray-900 {
    color: #111827;
    background-color: #f9fafb;
}

/* Mobile Contact Button */
.mobile-nav-contact {
    background-color: #f97316; /* bg-orange-500 */
    color: white;
    margin: 1rem 1.5rem;
    border-radius: 0.5rem;
    text-align: center;
    font-weight: 600;
    padding: 0.875rem 1.5rem;
    border-bottom: none;
}

.mobile-nav-contact:hover {
    background-color: #ea580c; /* bg-orange-600 */
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Mobile menu container padding */
.mobile-menu .px-2 {
    padding-left: 0;
    padding-right: 0;
}

/* Improved mobile menu spacing */
@media (max-width: 767px) {
    .mobile-menu .space-y-1 > * + * {
        margin-top: 0;
    }
    
    .mobile-nav-link {
        margin: 0;
        border-radius: 0;
    }
}

/* Responsive Design */
@media (min-width: 768px) {
    .mobile-menu {
        display: none !important;
    }
    
    .mobile-menu-button {
        display: none;
    }
}

@media (max-width: 767px) {
    .nav-link {
        display: none;
    }
    
    nav[data-nav-component="unified"] .hidden.md\\:block {
        display: none !important;
    }
    
    nav[data-nav-component="unified"] .hidden.md\\:flex {
        display: none !important;
    }
}

/* Animation for mobile menu */
.mobile-menu {
    animation: slideDown 0.2s ease-out;
}

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

/* Focus states for accessibility */
.nav-link:focus,
.mobile-nav-link:focus {
    outline: none;
    box-shadow: 0 0 0 2px #3b82f6;
    border-radius: 0.25rem;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .nav-link:after {
        background-color: currentColor;
    }
    
    .btn-primary {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .nav-link,
    .nav-link:after,
    .btn-primary,
    .mobile-menu-button,
    .mobile-nav-link {
        transition: none;
    }
    
    .mobile-menu {
        animation: none;
    }
}