/* ==========================================================================
   Basic CRM — Topbar styles
   build_crm/css/master/top_bar/topbar.css
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Scroll offset for anchors — nadpisuje main.css (topbar wyższy niż 5rem)
   -------------------------------------------------------------------------- */
[id] {
    scroll-margin-top: 70px;
}

/* --------------------------------------------------------------------------
   2. Brand background
   -------------------------------------------------------------------------- */
.bg-brand-dark {
    background-color: #122738 !important;
    color: #ffffff;
}

/* --------------------------------------------------------------------------
   3. Desktop nav links
   -------------------------------------------------------------------------- */
#page-topbar nav a {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.875rem;
    text-decoration: none;
    position: relative;
    transition: color 0.2s ease;
}

#page-topbar nav a:hover {
    color: #ffffff;
}

/* Animowany pasek pod linkiem */
#page-topbar nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 0%;
    height: 2px;
    background-color: #11662D;
    transition: width 0.3s ease;
    border-radius: 1px;
}

#page-topbar nav a:hover::after {
    width: 100%;
}

/* --------------------------------------------------------------------------
   4. Buttons
   -------------------------------------------------------------------------- */
.btn-brand-primary {
    background-color: #11662D;
    color: #ffffff !important;
    border: none;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-brand-primary:hover {
    background-color: #0D4F22;
    color: #ffffff !important;
    transform: translateY(-1px);
}

.btn-brand-light {
    background-color: #ffffff;
    color: #122738 !important;
    border: none;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-brand-light:hover {
    background-color: #f4f4f4;
    color: #122738 !important;
    transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   5. Mobile menu
   -------------------------------------------------------------------------- */
#mobileMenu {
    background-color: #122738;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    max-height: calc(100vh - 70px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.topbar-mobile-link {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    padding: 0.65rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: color 0.2s ease, background-color 0.2s ease;
    display: block;
}

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

.topbar-mobile-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.04);
    text-decoration: none;
}

/* Przyciski CTA w menu mobilnym */
.topbar-mobile-cta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding: 0.75rem 0 0.25rem 0;
}

.topbar-mobile-cta .btn {
    width: 100%;
    text-align: center;
}

/* --------------------------------------------------------------------------
   6. Other
   -------------------------------------------------------------------------- */
.btn-feature-more {
    background-color: #11662D;
    color: #fff;
    border-radius: 6px;
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.25s ease;
}

.btn-feature-more:hover {
    background-color: #0D4F22;
    color: #fff;
    transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   7. Dropdown — Super moduły
   -------------------------------------------------------------------------- */
.topbar-dropdown {
    position: relative;
}

.topbar-dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    transition: color 0.2s ease;
}

.topbar-dropdown-toggle:hover {
    color: #fff;
}

.topbar-dropdown-toggle::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 0%;
    height: 2px;
    background-color: #11662D;
    transition: width 0.3s ease;
    border-radius: 1px;
}

.topbar-dropdown-toggle:hover::after,
.topbar-dropdown.open .topbar-dropdown-toggle::after {
    width: 100%;
}

.topbar-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    min-width: 200px;
    padding: 0.5rem 0;
    z-index: 1100;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.topbar-dropdown.open .topbar-dropdown-menu {
    display: block;
}

.topbar-dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.6rem 1.1rem;
    color: #122738 !important;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none !important;
    transition: background-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.topbar-dropdown-item:hover {
    background-color: rgba(17, 102, 45, 0.06);
    color: #11662D !important;
    text-decoration: none !important;
}

.topbar-dropdown-item i {
    color: #11662D;
    font-size: 1rem;
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   8. Mobile submenu — Super moduły
   -------------------------------------------------------------------------- */
.topbar-mobile-group {
    cursor: default;
    color: rgba(255, 255, 255, 0.85);
}

.topbar-mobile-submenu {
    display: flex;
    flex-direction: column;
    padding-left: 1rem;
    border-left: 2px solid rgba(17, 102, 45, 0.4);
    margin-top: 0.25rem;
}

.topbar-mobile-sublink {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    padding: 0.45rem 0;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
}

.topbar-mobile-sublink:hover {
    color: #ffffff;
    text-decoration: none;
}

.topbar-mobile-sublink i {
    font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   9. Dropdown — grupy i separator
   -------------------------------------------------------------------------- */

/* Szeroki dropdown dla wielu pozycji — 3 kolumny */
.topbar-dropdown-menu--wide {
    min-width: 620px;
    left: auto;
    right: 0;
    transform: none;
    display: none;
    columns: 3;
    column-gap: 0;
    padding: 0.75rem 0;
}

.topbar-dropdown.open .topbar-dropdown-menu--wide {
    display: block;
}

/* Label grupy */
.topbar-dropdown-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #11662D;
    padding: 0.5rem 1.1rem 0.25rem;
    break-inside: avoid;
}

/* Separator między grupami */
.topbar-dropdown-separator {
    height: 1px;
    background-color: rgba(18, 39, 56, 0.08);
    margin: 0.4rem 0.75rem;
    break-inside: avoid;
    column-span: all;
}

/* Prevent items breaking across columns */
.topbar-dropdown-item {
    break-inside: avoid;
}

@media (max-width: 1199px) {
    .topbar-dropdown-menu--wide {
        min-width: 440px;
        columns: 2;
    }
}
