/* Shared toolbar and menu styles */
.valo-toolbox-wrapper {
    position: fixed;
    top: 8px;
    right: 10px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 5px;
}

.valo-toolbox-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.valo-toolbox-link img {
    height: 45px;
    width: auto;
    display: block;
}

.valo-tagline {
    text-align: center;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem;
}

.valo-tagline-line {
    margin: 0;
    font-size: 0.7rem;
    letter-spacing: -0.02em;
}

.valo-tagline-subtext {
    font-size: 0.7rem;
    font-weight: 500;
    color: #000000;
}

.valo-tagline-tools {
    color: #0017e2;
}

.valo-tagline-results {
    color: #af7d00;
}

html.dark .valo-tagline-tools,
html.dark .valo-tagline-results,
html.dark .valo-tagline-subtext,
.dark .valo-tagline-tools,
.dark .valo-tagline-results,
.dark .valo-tagline-subtext {
    color: #ffffff;
}

.toolbar-button, .dropdown-button {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 12px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #4b5563;
    font-size: 14px;
    font-weight: 500;
    gap: 6px;
}

.dark .toolbar-button, .dark .dropdown-button {
    color: white;
}

.toolbar-button:hover, .dropdown-button:hover {
    background: #f3f4f6;
    color: #1a1a1a;
}

.dark .toolbar-button:hover, .dark .dropdown-button:hover {
    background: #1a1a1a;
    color: #DC2626;
}

.toolbar-button:disabled {
    cursor: not-allowed;
    color: #9ca3af !important;
    background: transparent !important;
}

.dark .toolbar-button:disabled {
    color: #6b7280 !important;
}

.toolbar-button.icon-only {
    width: 40px;
    padding: 0;
}

.toggle-avatar-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    width: auto !important;
    padding: 0 4px !important;
    background: transparent !important;
    border: none !important;
}

.toggle-avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 9999px;
    background: #1a2236;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.5px;
}

.toggle-avatar-circle.hidden {
    display: none;
}

.toggle-avatar-img {
    width: 38px;
    height: 38px;
    border-radius: 9999px;
    object-fit: cover;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
}

.toggle-avatar-img.hidden {
    display: none;
}

.toggle-avatar-caret {
    color: #6b7280;
    flex-shrink: 0;
}

.dark .toggle-avatar-caret {
    color: #9ca3af;
}

.toolbar-button.active, .dropdown-button.active {
    background: #FEE2E2;
    color: #7F1D1D;
    border-color: #DC2626;
}

.dark .toolbar-button.active, .dark .dropdown-button.active {
    background: #7F1D1D;
    color: #FEE2E2;
    border-color: #DC2626;
}

.main-toolbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    z-index: 50;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
}

.dark .main-toolbar {
    background: #1a1a1a;
    border-bottom-color: #1a1a1a;
}

.toolbar-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.toolbar-divider {
    width: 1px;
    height: 64px;
    background: #e5e7eb;
}

.dark .toolbar-divider {
    background: #4b5563;
}

.toolbar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1200px;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.nav-group-left {
    display: flex;
    align-items: center;
    gap: 40px;
    pointer-events: auto;
}

.nav-group-right {
    display: flex;
    align-items: center;
    gap: 20px;
    pointer-events: auto;
}

.toolbar-nav-link {
    padding: 8px 12px;
    height: auto;
    position: relative;
    display: inline-flex;
    align-items: center;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #4b5563;
    transition: color 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.toolbar-nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 4px;
    left: 50%;
    background-color: #dc2626;
    transition: all 0.3s ease;
    transform: translateX(-50%);
    opacity: 0;
}

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

.toolbar-nav-link:hover::after {
    width: 80%;
    opacity: 1;
}

.dark .toolbar-nav-link {
    color: #e5e7eb;
}

.dark .toolbar-nav-link:hover {
    color: #fff;
}

.toolbar-nav-link:disabled {
    cursor: default;
    opacity: 0.5;
}

.toolbar-nav-link:disabled:hover::after {
    width: 0;
    opacity: 0;
}

.toolbar-nav-signin {
    padding: 10px 24px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    border: 1px solid #e2e8f0;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.toolbar-nav-signin:hover {
    background: #ffffff;
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    color: #0f172a;
}

.dark .toolbar-nav-signin {
    background: rgba(30, 41, 59, 0.8);
    border-color: #334155;
    color: #f1f5f9;
}

.dark .toolbar-nav-signin:hover {
    background: #1e293b;
    border-color: #475569;
}

.toolbar-nav-cta {
    padding: 10px 28px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    box-shadow: 0 4px 6px -1px rgba(220, 38, 38, 0.2), 0 2px 4px -1px rgba(220, 38, 38, 0.1);
    position: relative;
    overflow: hidden;
}

.toolbar-nav-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: opacity 0.2s;
}

.toolbar-nav-cta:hover {
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(220, 38, 38, 0.4), 0 4px 6px -2px rgba(220, 38, 38, 0.2);
    filter: brightness(1.1);
}

.toolbar-nav-cta:hover::before {
    opacity: 1;
}

.dark .toolbar-nav-cta {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.relative {
    position: relative;
}

#dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: -18px;
    min-width: 360px;
    background-color: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    z-index: 1100;
    overflow: visible;
    transition: transform 0.15s ease-out, opacity 0.15s ease-out;
    transform-origin: top left;
    padding: 0;
}

#dropdown-menu.hidden {
    transform: scale(0.95);
    opacity: 0;
    pointer-events: none;
    display: block;
}

.dark #dropdown-menu {
    background-color: #212020;
    border: 1px solid #4b5563;
}

#dropdown-menu .toolbar-button {
    width: 100%;
    justify-content: flex-start;
    padding: 8px 12px;
    border-radius: 4px;
}

#dropdown-menu .toolbar-button:hover {
    background-color: #f3f4f6;
}

.dark #dropdown-menu .toolbar-button:hover {
    background-color: #7F1D1D;
    color: #FEE2E2;
}

.menu-shell {
    display: flex;
    gap: 0;
    min-width: 360px;
}

.menu-left {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 260px;
    flex: 1 1 320px;
    width: 100%;
}

.menu-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-avatar {
    width: 40px;
    height: 40px;
    border-radius: 9999px;
    background: #fef3c7;
    color: #7F1D1D;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark .menu-avatar {
    background: #451a1a;
    color: #fef3c7;
}

.menu-user-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #111827;
}

.dark .menu-user-name {
    color: #f9fafb;
}

.menu-user-email {
    font-size: 0.85rem;
    color: #6b7280;
}

.dark .menu-user-email {
    color: #d1d5db;
}

.menu-plan-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    text-decoration: none;
    color: inherit;
    background: #f9fafb;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.menu-plan-card:hover {
    border-color: #DC2626;
    transform: translateY(-1px);
}

.dark .menu-plan-card {
    background: #2f2f2f;
    border-color: #4b5563;
}

.menu-plan-title {
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.dark .menu-plan-title {
    color: #f9fafb;
}

.menu-plan-copy {
    font-size: 0.8rem;
    color: #6b7280;
    margin: 2px 0 0 0;
}

.dark .menu-plan-copy {
    color: #d1d5db;
}

.menu-plan-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: #7F1D1D;
    background: #FEE2E2;
    padding: 2px 10px;
    border-radius: 9999px;
}

.dark .menu-plan-badge {
    color: #FEE2E2;
    background: #7F1D1D;
}

.menu-divider {
    width: 100%;
    height: 1px;
    background: #e5e7eb;
    margin: 4px 0;
}

.dark .menu-divider {
    background: #4b5563;
}

.menu-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border-radius: 0.5rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: #1a1a1a;
    text-align: left;
    transition: background 0.2s ease, color 0.2s ease;
}

.menu-link svg {
    flex-shrink: 0;
}

.menu-link-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: #6b7280;
}

.menu-link:hover {
    background: #f3f4f6;
    color: #7F1D1D;
}

.menu-link:hover .menu-link-icon {
    color: #DC2626;
}

.dark .menu-link {
    color: #e5e7eb;
}

.dark .menu-link-icon {
    color: #9ca3af;
}

.dark .menu-link:hover {
    background: #1a1a1a;
    color: #FEE2E2;
}

.dark .menu-link:hover .menu-link-icon {
    color: #FEE2E2;
}

.menu-link.has-caret {
    justify-content: space-between;
}

.menu-link.has-caret .menu-link-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-link.has-caret svg.menu-caret {
    margin-left: auto;
    width: 1rem;
    height: 1rem;
    color: inherit;
}

.logout-link {
    margin-top: auto;
    border-top: 1px solid #e5e7eb;
    padding-top: 12px;
    color: #b91c1c;
}

.dark .logout-link {
    border-top-color: #4b5563;
    color: #fca5a5;
}

.menu-help-wrapper {
    position: relative;
    width: 100%;
}

.menu-help-dropdown {
    position: absolute;
    top: -180px;
    left: calc(100% + 20px);
    width: 220px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    background: #f9fafb;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1200;
    transform-origin: left top;
}

.menu-help-dropdown::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    left: -7px;
    bottom: 20px;
    background: #f9fafb;
    border-left: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    transform: rotate(45deg);
    box-shadow: 0 4px 6px -3px rgba(0, 0, 0, 0.2);
}

.menu-help-dropdown.hidden {
    display: none;
}

.dark .menu-help-dropdown {
    background: #18181b;
    border-color: #4b5563;
}

.dark .menu-help-dropdown::before {
    background: #18181b;
    border-color: #4b5563;
    box-shadow: 0 4px 6px -3px rgba(0, 0, 0, 0.6);
}

.menu-help-dropdown h4 {
    margin: 0 0 6px 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
}

.dark .menu-help-dropdown h4 {
    color: #f3f4f6;
}

.help-link {
    text-decoration: none;
    color: #1a1a1a;
    font-size: 0.9rem;
    padding: 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 0.35rem;
}

.help-link:hover {
    color: #DC2626;
}

.dark .help-link {
    color: #f3f4f6;
}

.dark .help-link:hover {
    color: #FEE2E2;
}
