/* eDoktor Shared Header + Footer CSS — v3.0 (Mega Menu) */
/* Source of truth: edoktor-shared-includes/nav-footer.css */
/* Self-contained — no external CSS variables required */

/* ========== HEADER ========== */
.header,
#siteHeader {
    position: fixed !important;
    top: 0; left: 0; right: 0;
    z-index: 100;
    background: #ffffff !important;
    box-shadow: 0 1px 0 rgba(0,0,0,0.06);
    opacity: 1 !important;
}
.header--transparent {
    background: transparent;
    box-shadow: none;
}
.header.scrolled {
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}
.header-logo { display: flex; align-items: center; text-decoration: none !important; }
.header-logo img {
    height: 44px !important;
    width: auto !important;
}

/* Nav links */
.header-nav {
    display: flex !important;
    align-items: center;
    gap: 28px;
}
.header-nav .nav-link {
    color: #6b7280 !important;
    text-decoration: none !important;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s;
    white-space: nowrap;
}
.header-nav .nav-link:hover { color: #111827 !important; }

/* ========== MEGA MENU TOGGLE BUTTONS ========== */
.nav-mega-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #6b7280;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    background: none;
    border: none;
    font-family: 'Inter Tight', -apple-system, BlinkMacSystemFont, sans-serif;
    padding: 4px 0;
    transition: color 0.2s;
    white-space: nowrap;
    position: relative;
}
.nav-mega-toggle:hover,
.nav-mega-toggle.active { color: #111827; }
.nav-mega-toggle svg { transition: transform 0.3s; }
.nav-mega-toggle.active svg { transform: rotate(180deg); }
.nav-mega-toggle::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #14b8a6);
    border-radius: 1px;
    transform: scaleX(0);
    transition: transform 0.25s ease;
}
.nav-mega-toggle.active::after { transform: scaleX(1); }

/* ========== MEGA PANELS ========== */
.mega-panel {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: #ffffff;
    box-shadow: 0 8px 30px rgba(0,0,0,0.10);
    clip-path: inset(0 -50px -50px -50px);
    border-top: 1px solid #f3f4f6;
    display: none;
    z-index: 98;
    pointer-events: none;
}
/* Keep header-inner white when mega is open */
.header .header-inner {
    position: relative;
    z-index: 99;
    background: #ffffff !important;
}
.mega-panel.open {
    display: block;
    pointer-events: auto;
}
.mega-panel-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 32px 40px;
}
.mega-panel-inner .mega-heading {
    padding-left: 16px;
}

/* Mega backdrop — disabled to prevent header repaint flicker */
.mega-backdrop { display: none !important; pointer-events: none !important; }

/* ========== PORTAL MEGA MENU ========== */
.mega-heading {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #9ca3af;
    margin: 0 0 16px;
}
.mega-cards--2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.mega-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    text-decoration: none !important;
    transition: background 0.2s;
}
.mega-card:hover {
    background: #f9fafb;
}
.mega-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border-radius: 10px;
    flex-shrink: 0;
}
.mega-card-icon--blue {
    background: rgba(59,130,246,0.08);
    color: #3b82f6;
}
.mega-card-icon--teal {
    background: rgba(20,184,166,0.08);
    color: #14b8a6;
}
.mega-card-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.mega-card-text strong {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}
.mega-card-text span {
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.3;
}
.mega-card:hover .mega-card-text strong { color: #3b82f6; }

/* Categories column */
.mega-col--categories {
    border-left: 1px solid #f3f4f6;
    padding-left: 40px;
}
.mega-cat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}
.mega-cat-link {
    display: block;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    color: #4b5563 !important;
    text-decoration: none !important;
    border-radius: 8px;
    transition: all 0.15s;
}
.mega-cat-link:hover {
    background: #f9fafb;
    color: #3b82f6 !important;
}

/* ========== ALATI MEGA MENU ========== */
.mega-tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.mega-tool {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 10px;
    text-decoration: none !important;
    transition: background 0.2s;
}
.mega-tool:hover {
    background: #f9fafb;
}
.mega-tool-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px; height: 44px;
    border-radius: 10px;
    flex-shrink: 0;
}
.mega-tool-icon--blue {
    background: rgba(59,130,246,0.08);
    color: #3b82f6;
}
.mega-tool-icon--teal {
    background: rgba(20,184,166,0.08);
    color: #14b8a6;
}
.mega-tool-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.mega-tool-text strong {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}
.mega-tool-text span {
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.3;
}
.mega-tool:hover .mega-tool-text strong { color: #3b82f6; }

/* Portal grid — 4 columns to fit 8 categories evenly */
.mega-portal-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

/* Mobile highlight link (Analiza nalaza) — orange like desktop CTA */
.mobile-highlight-link,
.mobile-menu .mobile-highlight-link,
a.mobile-highlight-link {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    padding: 14px 20px !important;
    background: linear-gradient(135deg, #f97316, #f59e0b) !important;
    color: #ffffff !important;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none !important;
    border-radius: 12px;
    border-bottom: none !important;
    box-shadow: 0 4px 16px rgba(249,115,22,0.25);
}
.mobile-highlight-link svg {
    color: #ffffff !important;
    stroke: #ffffff !important;
}

/* ========== OLD DROPDOWN (kept for compat) ========== */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #6b7280;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    background: none;
    border: none;
    font-family: 'Inter Tight', -apple-system, BlinkMacSystemFont, sans-serif;
    padding: 0;
    transition: color 0.2s;
    white-space: nowrap;
}
.nav-dropdown-toggle:hover { color: #111827; }
.nav-dropdown-toggle svg { transition: transform 0.3s; }
.nav-dropdown:hover .nav-dropdown-toggle svg { transform: rotate(180deg); }
.nav-dropdown-panel {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding-top: 12px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}
.nav-dropdown:hover .nav-dropdown-panel { opacity: 1; visibility: visible; }
.nav-dropdown-panel-inner {
    background: #fff;
    border: 1px solid #f3f4f6;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.1);
    padding: 8px 0;
    min-width: 200px;
}
.nav-dropdown-panel-inner a {
    display: block;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #4b5563 !important;
    text-decoration: none !important;
    white-space: nowrap;
    transition: all 0.15s;
}
.nav-dropdown-panel-inner a:hover {
    background: #f9fafb;
    color: #3b82f6 !important;
}

/* CTA buttons (kept for compat) */
.header-nav .btn-header-cta {
    display: inline-flex !important;
    align-items: center;
    background: linear-gradient(135deg, #f97316, #f59e0b);
    color: #fff !important;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 3px 12px rgba(249,115,22,0.25);
    text-decoration: none !important;
    white-space: nowrap;
}
.header-nav .btn-header-cta:hover {
    background: linear-gradient(135deg, #ea580c, #d97706);
    box-shadow: 0 4px 18px rgba(249,115,22,0.35);
}
.header-nav .btn-header-outline {
    display: inline-flex !important;
    align-items: center;
    color: #3b82f6 !important;
    padding: 10px 20px;
    border-radius: 12px;
    border: 2px solid #3b82f6;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
    text-decoration: none !important;
    white-space: nowrap;
    background: transparent;
}
.header-nav .btn-header-outline:hover {
    background: rgba(59,130,246,0.08);
    transform: translateY(-1px);
}

/* Cart icon */
.header-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280 !important;
    text-decoration: none !important;
    padding: 6px;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
    position: relative;
}
.header-cart:hover {
    color: #3b82f6 !important;
    background: rgba(59,130,246,0.06);
}

/* Hamburger */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 12px;
    z-index: 102;
    -webkit-tap-highlight-color: transparent;
    pointer-events: auto !important;
    min-width: 44px;
    min-height: 44px;
    position: relative;
}
.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: #374151;
    margin: 6px 0;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); background: #111827; }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); background: #111827; }

/* ========== MOBILE MENU ========== */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #fff;
    z-index: 99;
    padding: 80px 24px 24px;
    flex-direction: column;
    gap: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.mobile-menu.open { display: flex; }
.mobile-menu > a {
    display: block !important;
    padding: 16px 0;
    font-size: 17px;
    font-weight: 600;
    color: #374151 !important;
    text-decoration: none !important;
    border-bottom: 1px solid #f3f4f6;
}
.mobile-menu > a:hover { color: #3b82f6 !important; }
.mobile-dropdown { border-bottom: 1px solid #f3f4f6; }
.mobile-dropdown-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    background: none;
    border: none;
    padding: 16px 0;
    font-family: 'Inter Tight', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 17px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.mobile-dropdown-toggle svg { transition: transform 0.3s; }
.mobile-dropdown-toggle.open svg { transform: rotate(180deg); }
.mobile-dropdown-items {
    display: none;
    flex-direction: column;
    padding: 0 0 12px 16px;
}
.mobile-dropdown-items.open { display: flex; }
.mobile-dropdown-items a {
    display: block;
    font-size: 15px;
    font-weight: 500;
    padding: 10px 0;
    color: #6b7280 !important;
    text-decoration: none !important;
    border-bottom: 1px solid #f9fafb;
}
.mobile-dropdown-items a:last-child { border-bottom: none; }
.mobile-dropdown-items a:hover { color: #3b82f6 !important; }

/* Mobile dropdown divider */
.mobile-dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 8px 0;
}

.mobile-cta-row {
    display: flex;
    gap: 10px;
    margin-top: 24px;
}
.mobile-cta-row a,
.mobile-cta-row button {
    flex: 1;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 14px 12px !important;
    font-weight: 600;
    font-size: 16px;
    text-decoration: none !important;
    border-radius: 12px;
    text-align: center;
    white-space: nowrap;
    min-height: 44px;
    font-family: 'Inter Tight', -apple-system, BlinkMacSystemFont, sans-serif;
    cursor: pointer;
}
.mobile-cta-row .mobile-cta {
    background: linear-gradient(135deg, #3b82f6, #14b8a6);
    color: #fff !important;
    box-shadow: 0 4px 16px rgba(59,130,246,0.25);
    border: none;
}
.mobile-cta-row .mobile-outline {
    color: #3b82f6 !important;
    border: 2px solid #3b82f6;
    background: transparent;
}
.mobile-menu-footer {
    margin-top: auto;
    background: #111827;
    margin: auto -24px -24px;
    padding: 24px;
    border-radius: 20px 20px 0 0;
}
.mobile-menu-social { display: flex; gap: 12px; margin-bottom: 16px; }
.mobile-menu-social a {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.6) !important;
    text-decoration: none !important;
    padding: 0 !important;
    border-bottom: none !important;
}
.mobile-menu-social a:hover { background: rgba(255,255,255,0.15); color: #fff !important; }
/* Mobile footer contact */
.mobile-menu-contact {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.mobile-menu-contact a {
    display: flex !important;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255,255,255,0.6) !important;
    text-decoration: none !important;
    padding: 0 !important;
    border-bottom: none !important;
    transition: color 0.2s;
}
.mobile-menu-contact a:hover { color: #fff !important; }
.mobile-menu-contact svg { flex-shrink: 0; opacity: 0.5; }

.mobile-menu-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 12px; }
.mobile-menu-links a {
    font-size: 13px;
    font-weight: 400;
    color: rgba(255,255,255,0.4) !important;
    text-decoration: none !important;
    padding: 0 !important;
    border-bottom: none !important;
}
.mobile-menu-links a:hover { color: rgba(255,255,255,0.7) !important; }
.mobile-menu-copy { font-size: 12px; color: rgba(255,255,255,0.25); }

/* ========== FOOTER ========== */
.site-footer {
    background: #111827;
    color: rgba(255,255,255,0.6);
    padding: 60px 0 0;
    margin-top: 0;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.footer-brand p {
    font-size: 14px;
    line-height: 1.7;
    margin: 16px 0;
    color: rgba(255,255,255,0.5);
}
.footer-logo img {
    height: 40px;
    width: auto;
    opacity: 0.7;
    filter: brightness(0) invert(1);
    transition: all 0.3s;
}
.footer-logo img:hover { opacity: 1; }
.footer-social { display: flex; gap: 10px; }
.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.5);
    transition: all 0.3s;
    text-decoration: none;
}
.footer-social a:hover { background: rgba(255,255,255,0.12); color: #fff; }
.footer-col h4 {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
    margin: 0 0 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul a {
    font-size: 14px;
    color: rgba(255,255,255,0.45);
    text-decoration: none;
    transition: color 0.2s;
}
.footer-col ul a:hover { color: rgba(255,255,255,0.9); }
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    font-size: 13px;
    color: rgba(255,255,255,0.3);
}
.footer-bottom-links { display: flex; gap: 16px; }
.footer-bottom-links a {
    color: rgba(255,255,255,0.3);
    text-decoration: none;
    transition: color 0.2s;
}
.footer-bottom-links a:hover { color: rgba(255,255,255,0.6); }

/* ========== AUTH SECTION — v2.0 ========== */
.header-auth { display: flex; align-items: center; gap: 8px; margin-left: 4px; }
.btn-header-login {
    font-size: 14px; font-weight: 600; color: #3b82f6;
    text-decoration: none; padding: 8px 16px;
    border: 1px solid #3b82f6; border-radius: 8px;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-header-login:hover { background: #3b82f6; color: #fff; }
.btn-header-register {
    font-size: 14px; font-weight: 600; color: #fff;
    text-decoration: none; padding: 8px 16px;
    background: #3b82f6; border-radius: 8px;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-header-register:hover { background: #2563eb; }

/* User dropdown - desktop */
.header-auth--user { position: relative; }
.header-user-toggle {
    display: flex; align-items: center; gap: 6px;
    background: none; border: none; cursor: pointer;
    font-family: 'Inter Tight', sans-serif;
    font-size: 14px; font-weight: 500; color: #374151;
    padding: 8px 12px; border-radius: 8px;
    transition: background 0.2s;
    white-space: nowrap;
}
.header-user-toggle:hover { background: rgba(0,0,0,0.04); }
.header-user-dropdown {
    display: none; position: absolute; top: 100%; right: 0;
    min-width: 180px; background: #fff; border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12); padding: 8px;
    z-index: 200; margin-top: 4px;
}
.header-user-dropdown.open { display: block; }
.header-user-dropdown a,
.header-user-dropdown button {
    display: block; width: 100%; text-align: left;
    padding: 10px 14px; font-size: 14px; color: #374151;
    text-decoration: none; background: none; border: none;
    border-radius: 8px; cursor: pointer;
    font-family: 'Inter Tight', sans-serif;
    transition: background 0.15s;
}
.header-user-dropdown a:hover,
.header-user-dropdown button:hover { background: #f3f4f6; }

/* Mobile auth items */
.mobile-user-info {
    padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.08);
    background: #111827; margin: -80px -24px 0; padding-top: 96px;
}
.mobile-user-name { display: block; font-weight: 600; font-size: 16px; color: #fff; }
.mobile-user-email { display: block; font-size: 13px; color: rgba(255,255,255,0.5); margin-top: 2px; }

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .header-nav .btn-header-outline { display: none !important; }
    .header-nav { gap: 20px; }
    .mega-tools-grid { grid-template-columns: repeat(2, 1fr); }
    .mega-portal-grid { grid-template-columns: repeat(2, 1fr); }
    .mega-tools-grid { grid-template-columns: repeat(2, 1fr); }
    .mega-cards--2col { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .header-nav .nav-link { display: none !important; }
    .header-nav .nav-dropdown { display: none !important; }
    .header-nav .nav-mega-toggle { display: none !important; }
    .header-nav .btn-header-cta { display: none !important; }
    .header-nav .btn-header-outline { display: none !important; }
    .header-cart { display: flex !important; }
    .hamburger { display: block !important; }
    .mega-panel { display: none !important; }
    .mega-backdrop { display: none !important; pointer-events: none !important; }
    .header-inner {
        padding: 0 16px;
        height: 60px !important;
        min-height: 60px;
    }
    .header.scrolled .header-inner {
        height: 60px !important;
        min-height: 60px;
    }
    .header-logo img { height: 38px !important; }
    .header-nav { gap: 10px; }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    /* Hide desktop auth on mobile — mobile menu has its own auth items */
    .header-auth { display: none !important; }
}
@media (max-width: 480px) {
    .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}
