/**
 * Common navbar styles for all Taxxavy pages.
 * Same green gradient and layout on every page.
 */
:root {
    --nav-primary: #00D084;
    --nav-primary-dark: #00B875;
    --nav-primary-light: #00E893;
    --gradient-primary: linear-gradient(135deg, #00D084 0%, #00B875 50%, #00E893 100%);
    --text-dark: #0F172A;
    --text-gray: #64748B;
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.navbar {
    background: var(--gradient-primary) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 1.2rem 0;
    transition: all 0.3s ease;
}
.navbar.scrolled {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    padding: 0.8rem 0;
}
.navbar-brand {
    font-size: 1.75rem !important;
    font-weight: 900 !important;
    color: #0F172A !important;
    letter-spacing: -0.5px;
    transition: all 0.3s ease;
}
.navbar-brand:hover {
    transform: scale(1.05);
    color: #0F172A !important;
}
.navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
}
.navbar-toggler:focus {
    box-shadow: none;
}
.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='rgba%280, 0, 0, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}
.nav-link {
    color: #0F172A !important;
    font-weight: 600;
    padding: 0.6rem 1.2rem !important;
    margin: 0 0.25rem;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: inline-block;
    text-decoration: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}
.nav-link.dropdown-toggle {
    color: #64748B !important;
    background: #F1F5F9 !important;
    opacity: 1 !important;
    visibility: visible !important;
    border: none !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}
.navbar-nav .nav-link {
    color: #0F172A !important;
}
.navbar-nav .nav-link.dropdown-toggle {
    color: #64748B !important;
    background: #F1F5F9 !important;
}
#productsDropdown,
#productsMenuDropdown {
    color: #64748B !important;
    background: #F1F5F9 !important;
}
#productsDropdown:hover,
#productsMenuDropdown:hover,
#productsDropdown:focus,
#productsMenuDropdown:focus,
#productsDropdown[aria-expanded="true"],
#productsMenuDropdown[aria-expanded="true"] {
    color: #475569 !important;
    background: #E2E8F0 !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15) !important;
}
.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 2px;
    transition: width 0.3s ease;
}
.nav-link:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.2) !important;
    transform: translateY(-2px);
}
.nav-link:hover::before {
    width: 80%;
    background: white;
}
.nav-link.dropdown-toggle:hover {
    color: #475569 !important;
    background: #E2E8F0 !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15) !important;
}
.nav-link.dropdown-toggle:focus,
.nav-link.dropdown-toggle[aria-expanded="true"] {
    color: #475569 !important;
    background: #E2E8F0 !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15) !important;
}
.dropdown-menu {
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 208, 132, 0.2);
    border-radius: 20px;
    padding: 0.5rem;
    box-shadow: var(--shadow-xl);
    min-width: 380px;
    max-width: 420px;
    margin-top: 0.75rem;
    animation: navSlideDown 0.3s ease;
}
@keyframes navSlideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (min-width: 992px) {
    .navbar-nav .dropdown-menu {
        right: 0;
        left: auto;
    }
}
@media (max-width: 991.98px) {
    .dropdown-menu {
        max-width: 100% !important;
        min-width: auto !important;
        right: auto !important;
        left: auto !important;
        width: 100%;
        margin-top: 0.5rem;
        border-radius: 8px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        max-height: 70vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .dropdown-item {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    .dropdown-item h6 {
        font-size: 1rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        line-height: 1.4;
        white-space: normal;
    }
    .dropdown-item p {
        font-size: 0.8rem;
        margin-top: 0.5rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        line-height: 1.4;
        white-space: normal;
    }
    .navbar-nav .dropdown-menu {
        position: static;
        float: none;
        width: 100%;
        margin-top: 0.5rem;
        background-color: rgba(255, 255, 255, 0.95) !important;
    }
    .nav-item.dropdown {
        width: 100%;
        margin-bottom: 1rem !important;
    }
    .nav-link.dropdown-toggle {
        width: 100%;
        text-align: left;
    }
    .nav-item:not(.dropdown) {
        margin-bottom: 1rem !important;
    }
}
@media (max-width: 576px) {
    .dropdown-menu {
        padding: 1.5rem;
        border-radius: 20px;
    }
    .dropdown-item {
        padding: 1rem 0;
    }
    .dropdown-icon-col {
        width: 35px;
        margin-right: 0.75rem;
    }
    .dropdown-icon-col svg {
        width: 35px;
        height: 35px;
    }
    .dropdown-item h6 {
        font-size: 1.1rem;
    }
    .dropdown-item p {
        font-size: 0.85rem;
    }
}
.dropdown-item {
    padding: 0.75rem 1.5rem;
    transition: all 0.3s;
    color: var(--text-dark) !important;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}
.dropdown-item:hover {
    background: rgba(0, 0, 0, 0.1) !important;
    color: var(--text-dark) !important;
}
.dropdown-icon-col {
    flex: 0 0 auto;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
}
.dropdown-content-col {
    flex: 1;
    min-width: 0;
}
.dropdown-item h6 {
    margin: 0;
    font-weight: 600;
    color: var(--text-dark) !important;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
    white-space: normal;
}
.dropdown-item p {
    margin: 0.25rem 0 0 0;
    font-size: 0.875rem;
    color: var(--text-gray) !important;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
    white-space: normal;
}
.dropdown-item:hover h6 {
    color: var(--text-dark) !important;
}
.dropdown-divider {
    border-top: 1px solid #000000;
    margin: 0.5rem 0;
    opacity: 1;
}
/* Product dropdown: full block → product page; Start analysis button → form */
.dropdown-product-item {
    position: relative;
    cursor: pointer;
    padding: 0.75rem 1.5rem;
}
.dropdown-product-item:hover {
    background: rgba(0, 0, 0, 0.04) !important;
}
/* Full-area link to product page (clicks on title/description go here) */
.dropdown-product-item-backdrop {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 0;
}
/* Content above backdrop; allow clicks to pass through except on button */
.dropdown-product-item-content {
    position: relative;
    z-index: 1;
    pointer-events: none;
}
.dropdown-product-item-content .btn-start-analysis {
    pointer-events: auto;
    position: relative;
    z-index: 2;
}
.dropdown-product-title {
    margin: 0;
    font-weight: 600;
    color: var(--text-dark) !important;
    transition: color 0.2s;
}
.dropdown-product-item:hover .dropdown-product-title {
    color: var(--nav-primary-dark) !important;
}
.dropdown-product-item .dropdown-content-col p {
    margin: 0.25rem 0 0.5rem 0;
}
.btn-start-analysis {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.5rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff !important;
    background: #00D084 !important;
    border: none;
    border-radius: 8px;
    text-decoration: none !important;
}
.btn-start-analysis:hover {
    color: #fff !important;
    background: #00D084 !important;
    /* No colour change on hover - stays green */
}
.dropdown-toggle::after {
    margin-left: 0.5rem;
    vertical-align: 0.255em;
}
@media (max-width: 768px) {
    .nav-item {
        margin-bottom: 1.25rem !important;
    }
    .nav-item:last-child {
        margin-bottom: 0 !important;
    }
    .nav-item.dropdown {
        margin-bottom: 1.5rem !important;
    }
}
