:root {
    --primary-color: #e1a202;
    --accent-color: #002F34; /* OLX-like dark accent */
    --btn-text-color: #ffffff;
    --text-main: #002F34; /* Dark, almost black */
    --text-secondary: #7F9799;
    --bg-body: #ffffff; /* Changed to white to remove grey side bars */
    --bg-card: #ffffff;
    --bg-gradient: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%); /* Default gradient */
    --border-color: #E5E7EB;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    
    --radius-sm: 8px;
    --radius-md: 12px; /* Standard for cards */
    --radius-lg: 24px; /* Buttons/Pills */
    
    --header-height: 80px;
    --category-bar-height: 50px;
    --tabs-height: 50px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-main);
    background: var(--bg-gradient); /* Use gradient */
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* When dashboard is active, allow full page scroll */
body.dashboard-active {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Hide category bars when dashboard is active */
body.dashboard-active .tabs-scroll-wrapper,
body.dashboard-active .industry-tabs-bar,
body.dashboard-active .category-bar {
    display: none !important;
}

/* Reset fixed main-container when dashboard is active */
body.dashboard-active .main-container {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    min-height: auto;
    overflow: visible;
}

/* Hide login button when dashboard is active (user is already logged in) */
body.dashboard-active #loginBtn {
    display: none;
}

/* Hide mobile map toggle in dashboard — it's only relevant on the main map view */
body.dashboard-active .mobile-toggle-floating {
    display: none !important;
}

/* Remove padding-top created for fixed site header (not needed in dashboard) */
body.dashboard-active .dashboard-container {
    padding-top: 0;
}

.app-container {
    width: 100%; /* Puszczamy na całą szerokość, rezygnujemy z obramowania 80% */
    max-width: 100%;
    margin: 0 auto;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    background: transparent;
    pointer-events: none; /* Cały przód mapy przezroczysty dla kliknięć */
}

.app-container > * {
    pointer-events: auto; /* Ale zachowujemy klikalność header / category-bar */
}

/* --- Industry Tabs (Super Category Switcher) --- */

/* Wrapper that takes the flex:1 slot in the header */
.tabs-scroll-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    overflow-x: clip; /* clip only horizontally — allows vertical shadow/transform */
    overflow-y: visible;
    gap: 4px;
}

/* Scroll arrow buttons (shared for both tabs bar and category bar) */
.scroll-arrow {
    display: none; /* shown by JS when content overflows */
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1.5px solid rgba(0,0,0,0.14);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    color: #334155;
    transition: all 0.2s ease;
    z-index: 2;
    padding: 0;
    line-height: 1;
}

.scroll-arrow.visible {
    display: flex;
}

.scroll-arrow:hover {
    background: #1e293b;
    border-color: #1e293b;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.scroll-arrow i {
    font-size: 12px;
    pointer-events: none;
}

.industry-tabs-bar {
    align-self: stretch;
    background: transparent;
    border-bottom: none;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 6px 8px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.industry-tabs-bar::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* Super-kategorie - wyraziste przyciski zmieniające charakter portalu */
.industry-tab {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    min-width: 120px;
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 999px; /* Pill-shaped */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1.5px solid rgba(0,0,0,0.14);
    color: #334155;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255,255,255,0.9);
}

.industry-tab i {
    font-size: 18px;
    transition: all 0.3s ease;
    color: #475569;
}

.industry-tab span {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Efekt odwrócenia koloru na hover - clean design */
.industry-tab:hover {
    border-color: #1e293b;
    background: #1e293b;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.industry-tab:hover i {
    color: #ffffff;
    transform: scale(1.1);
}

/* Aktywny stan - pełne kolorowe tło */
.industry-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.industry-tab.active i {
    color: white;
    transform: scale(1.15);
}

.industry-tab.active span {
    color: white;
}

.industry-tab.active:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    transform: translateY(-3px);
}

.industry-tab::after {
    display: none; 
}

/* --- Header --- */
.main-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 24px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    z-index: 50;
    flex-shrink: 0;
    border-radius: 24px;
    margin: 16px 16px 0;
    border: 1px solid rgba(255, 255, 255, 0.4);
    width: calc(100% - 32px);
    gap: 128px;
    position: relative;
}

.brand-logo {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.5px;
    flex-shrink: 0;
}

.brand-logo i {
    color: var(--primary-color);
    font-size: 24px;
}

/* Removed .header-search styles as it's moved */

.header-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
    flex-shrink: 0;
}

.nav-btn {
    text-decoration: none;
    background: #ffffff;
    color: var(--text-main);
    padding: 6px 16px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 13px;
    border: 2px solid var(--text-main);
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-btn:hover {
    background: var(--text-main);
    color: #ffffff;
}

/* --- Theme Switcher --- */
.theme-switcher {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 4px;
}

.theme-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

/* Przycisk contrast w jasnym theme - lepiej widoczny */
.theme-btn[data-theme="contrast"] {
    color: #1e293b;
}

.theme-btn:hover {
    background: var(--bg-body);
    color: var(--text-main);
}

.theme-btn.active {
    background: var(--primary-color);
    color: white;
}

.mobile-menu-btn {
    display: none;
    border: none;
    background: none;
    font-size: 24px;
    color: var(--text-main);
    cursor: pointer;
    padding: 8px;
    transition: all 0.2s ease;
}

.mobile-menu-btn:hover {
    transform: scale(1.1);
}

.mobile-menu-btn.active i {
    color: var(--primary-color);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
}

.mobile-menu-panel {
    display: none;
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100%;
    background: white;
    z-index: 1000;
    transition: right 0.3s ease;
    box-shadow: -2px 0 12px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
    flex-direction: column;
}

.mobile-menu-panel.active {
    right: 0;
}

.mobile-menu-panel-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-menu-panel-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-main);
    cursor: pointer;
    padding: 4px;
}

.mobile-menu-panel-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Mobile menu sections */
.mobile-menu-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-menu-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    padding: 8px 0;
    border-top: 1px solid var(--border-color);
}

.mobile-menu-section:first-child .mobile-menu-section-title {
    border-top: none;
}

/* Industry tabs in mobile menu */
.mobile-industry-tabs {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mobile-industry-tab {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    cursor: pointer;
    transition: all 0.2s ease;
    color: #64748b;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
}

.mobile-industry-tab:hover {
    border-color: #cbd5e1;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    color: #475569;
}

.mobile-industry-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.mobile-industry-tab i {
    font-size: 16px;
    transition: all 0.2s ease;
}

/* Categories in mobile menu */
.mobile-categories {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mobile-category-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    cursor: pointer;
    transition: all 0.2s ease;
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
    font-size: 12px;
}

.mobile-category-pill:hover {
    border-color: #cbd5e1;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    color: #475569;
}

.mobile-category-pill.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.mobile-category-pill i {
    font-size: 14px;
}

/* Mobile menu theme buttons */
.mobile-menu-panel .theme-btn {
    justify-content: flex-start;
    gap: 12px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 6px;
    width: 100%;
    color: #64748b;
    font-weight: 600;
    font-size: 13px;
    font-family: inherit;
}

.mobile-menu-panel .theme-btn i {
    font-size: 16px;
    color: #334155;
}

.mobile-menu-panel .theme-btn span {
    font-weight: 600;
    color: #334155;
}

.mobile-menu-panel .theme-btn:hover {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-color: #cbd5e1;
    color: #475569;
}

.mobile-menu-panel .theme-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Dark theme for mobile menu */
[data-theme="dark"] .mobile-menu-section-title {
    color: #64748b;
    border-top-color: #334155;
}

[data-theme="dark"] .mobile-industry-tab,
[data-theme="dark"] .mobile-category-pill {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-color: #334155;
    color: #94a3b8;
}

[data-theme="dark"] .mobile-industry-tab:hover,
[data-theme="dark"] .mobile-category-pill:hover {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    border-color: #475569;
    color: #e2e8f0;
}

[data-theme="dark"] .mobile-industry-tab.active,
[data-theme="dark"] .mobile-category-pill.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

[data-theme="dark"] .mobile-menu-panel .theme-btn {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-color: #e2e8f0;
    color: #64748b;
}

[data-theme="dark"] .mobile-menu-panel .theme-btn:hover {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-color: #cbd5e1;
    color: #475569;
}

[data-theme="dark"] .mobile-menu-panel .theme-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Contrast theme for mobile menu */
[data-theme="contrast"] .mobile-menu-section-title {
    color: #ffffff;
    border-top-color: #ffffff;
}

[data-theme="contrast"] .mobile-industry-tab,
[data-theme="contrast"] .mobile-category-pill {
    background: #000000;
    border: 2px solid #ffffff;
    color: #ffffff;
}

[data-theme="contrast"] .mobile-industry-tab:hover,
[data-theme="contrast"] .mobile-category-pill:hover {
    background: #333333;
    border-color: #ffff00;
    color: #ffff00;
}

[data-theme="contrast"] .mobile-industry-tab.active,
[data-theme="contrast"] .mobile-category-pill.active {
    background: #ffff00;
    border-color: #ffff00;
    color: #000000;
}

[data-theme="contrast"] .mobile-menu-panel .theme-btn {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid #e2e8f0;
    color: #64748b;
}

[data-theme="contrast"] .mobile-menu-panel .theme-btn:hover {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-color: #cbd5e1;
    color: #475569;
}

[data-theme="contrast"] .mobile-menu-panel .theme-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* --- Map Search Container --- */
.map-search-container {
    margin-bottom: 12px;
    width: 100%;
}

/* Desktop search - inline inside listings island */
.map-search-container.desktop-search {
    position: static;
    top: auto;
    left: auto;
    transform: none;
    z-index: auto;
    width: 100%;
    padding: 0;
    margin-bottom: 12px;
    display: block;
}

/* Mobile search - hidden on desktop */
.map-search-container.mobile-search {
    display: none;
}

.map-search-container form {
    display: flex;
    align-items: center;
    height: 56px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 999px;
    padding: 6px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
}

.map-search-container form:focus-within {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.map-search-container i.fa-magnifying-glass {
    padding: 0 16px;
    color: var(--text-secondary);
    font-size: 18px;
}

.map-search-container input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 16px;
    color: var(--text-main);
    height: 100%;
}

.map-search-container input:focus {
    outline: none;
}

.map-search-container button[type="submit"] {
    height: 100%;
    aspect-ratio: 1;
    padding: 0;
    border: none;
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    font-size: 18px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-search-container button[type="submit"]:hover {
    background: #1b5e20; /* Darker green */
    transform: scale(1.05);
}

.search-reset-btn {
    height: 100%;
    width: 32px;
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
    padding: 0;
    margin-right: 6px;
}

.search-reset-btn:hover {
    background: #f1f5f9;
    color: var(--text-main);
}

/* --- Category bar --- */
.category-bar {
    position: fixed;
    top: calc(var(--header-height) + 18px); /* Below floated header */
    left: 16px;
    width: calc(100vw - 32px);
    z-index: 40;
    height: auto;
    min-height: var(--category-bar-height);
    padding: 6px 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-bottom: none;
    background: transparent;
    overflow-x: clip;
    overflow-y: visible;
    pointer-events: none;
}

.category-bar > * {
    pointer-events: auto;
}

.categories-container {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: visible;
    padding: 6px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.categories-container::-webkit-scrollbar {
    display: none;
}

.category-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    color: #334155;
    cursor: pointer;
    border: 1.5px solid rgba(0,0,0,0.14);
    border-radius: 999px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    min-width: auto;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255,255,255,0.9);
    font-weight: 600;
}

/* Minimalistyczny efekt odwrócenia kolorów na hover podobnie jak industry-tab */
.category-pill:hover {
    border-color: #1e293b;
    background: #1e293b; 
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.category-pill:hover i {
    color: #ffffff;
}

.category-pill.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.category-pill.active:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    transform: translateY(-3px);
}

.category-pill i {
    font-size: 14px;
    margin-bottom: 0; /* Reset margin */
}

.category-pill span {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.search-feedback {
    display: none;
}

/* --- Main layout --- */
.main-container {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 0;
    z-index: 5;
    overflow: hidden;
    background: transparent;
}

.listings-column {
    position: absolute;
    top: calc(var(--header-height) + var(--category-bar-height) + 32px);
    left: 24px;
    bottom: 24px;
    width: 33.33vw; /* Dokładnie 1/3 ekranu wg życzenia */
    min-width: 420px; /* Wyraźnie szerszy nawet na ciut mniejszych desktopach */
    max-width: 600px; /* Ogromny max, by na dużych ekranach było bardzo przestrzennie */
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    z-index: 10;
    border-radius: 24px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    /* Modern Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.15) transparent;
}

/* Pozycja przycisków zoom – left ustawiane dynamicznie przez JS */
.leaflet-top.leaflet-left {
    top: calc(var(--header-height) + var(--category-bar-height) + 32px) !important;
}

@media (max-width: 768px) {
    .leaflet-top.leaflet-left {
        top: calc(var(--header-height) + 16px) !important;
        left: 10px !important;
    }
}

/* Restyle native Leaflet zoom controls + reset to match app design */
.leaflet-bar {
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
    overflow: hidden !important;
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
}

.leaflet-bar a {
    background: transparent !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-radius: 0 !important;
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    color: var(--text-main) !important;
    font-size: 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.15s ease !important;
}

.leaflet-bar a:last-child {
    border-bottom: none !important;
}

.leaflet-bar a:hover {
    background: rgba(0, 0, 0, 0.06) !important;
    color: var(--primary-color) !important;
}

.leaflet-bar a.leaflet-disabled {
    color: #bbb !important;
    background: transparent !important;
}

/* Reset zoom button */
.leaflet-control-zoom-reset {
    line-height: 1 !important;
    font-size: 13px !important;
}

/* Responsive adjustment for map controls on smaller screens */
@media (min-width: 769px) {
    .leaflet-top.leaflet-left {
        left: calc(max(420px, min(33.33vw, 600px)) + 40px) !important;
    }
}

@media (max-width: 768px) {
    .leaflet-top.leaflet-left {
        top: calc(var(--header-height) + 16px) !important;
        left: 10px !important;
    }
}

.listings-column::-webkit-scrollbar {
    width: 6px;
}

.listings-column::-webkit-scrollbar-track {
    background: transparent;
}

.listings-column::-webkit-scrollbar-thumb {
    background-color: #d1d5db;
    border-radius: 20px;
}

.listings-column::-webkit-scrollbar-thumb:hover {
    background-color: #9ca3af;
}

.map-column {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 0;
    background: transparent;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    z-index: 1;
}

.map-card {
    flex: 1;
    background: #f0f0f0;
    overflow: hidden;
    border-radius: 0;
    position: relative;
    z-index: 0;
    display: flex;
    flex-direction: column;
}

#map {
    width: 100%;
    flex: 1;
    z-index: 1;
    background: #f0f0f0;
    /* border-radius handled by container overflow:hidden */
}

/* --- Footer --- */
.main-footer {
    height: 40px;
    background: var(--accent-color);
    border-top: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #ffffff;
    flex-shrink: 0;
    z-index: 10;
    border-radius: 12px; /* Separate box look */
    box-shadow: var(--shadow-sm);
}

/* Hide mobile footer on desktop */
.listings-footer {
    display: flex;
    flex-shrink: 0;
    position: sticky;
    bottom: -16px;
    margin: auto -16px -16px -16px;
    border-radius: 0 0 20px 20px;
}

/* Hide footer inside map column */
.map-column .main-footer {
    display: none;
}

.footer-content {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #ffffff;
}

/* --- Featured Listing Card (Legacy - Removed) --- */
/* Styles removed as featured listing is now a regular card with .featured class */

/* --- Listings --- */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.listings-header {
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    padding-bottom: 12px;
}

.results-count {
    font-weight: 500;
    font-size: 15px;
    color: var(--text-secondary);
}

.results-count span {
    color: var(--text-main);
    font-size: 17px;
    font-weight: 700;
}

/* Dark theme */
[data-theme="dark"] .results-count {
    color: #e2e8f0;
}

[data-theme="dark"] .results-count span {
    color: var(--primary-color);
}

/* Contrast theme */
[data-theme="contrast"] .results-count {
    color: #ffffff;
}

[data-theme="contrast"] .results-count span {
    color: var(--primary-color);
}

@media (min-width: 769px) {
    .listings-header {
        display: flex;
    }
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 24px;
}

.view-toggle {
    display: flex;
    background: #F2F4F5;
    padding: 4px;
    border-radius: 8px;
    gap: 4px;
}

.view-btn {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.view-btn:hover {
    color: var(--text-main);
    background: rgba(255,255,255,0.5);
}

.view-btn.active {
    background: #ffffff;
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
}

.listings-header h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.listings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 Columns */
    gap: 20px;
    padding-bottom: 40px;
}

/* List View Styles */
.listings-grid.list-view {
    grid-template-columns: 1fr; /* Single column */
    gap: 12px; /* Reduced gap */
}

.listings-grid.list-view .card {
    flex-direction: row;
    height: auto;
    min-height: 60px;
    align-items: stretch;
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s;
}

.listings-grid.list-view .card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.listings-grid.list-view .card-image {
    width: 84px; /* Reduced from 105px (-20%) */
    height: auto;
    min-height: auto;
}

.listings-grid.list-view .card-content {
    flex-direction: row;
    align-items: center;
    padding: 8px 12px; /* Reduced padding */
    gap: 12px; /* Reduced gap */
}

.listings-grid.list-view .card-content > div:first-child {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0; /* Fix truncation */
}

.listings-grid.list-view .card-header {
    margin-bottom: 4px;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
}

.listings-grid.list-view .card-title {
    margin-bottom: 2px;
    font-size: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
}

.listings-grid.list-view .card-category {
    margin-bottom: 0;
}

.listings-grid.list-view .card-desc {
    display: none;
}

.listings-grid.list-view .card-location {
    font-size: 0.85rem;
    margin-top: 2px;
}

.listings-grid.list-view .card-footer {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    min-width: 120px;
}

.listings-grid.list-view .card-price {
    font-size: 1.1rem;
}

.listings-grid.list-view .card-price {
    font-size: 1.1rem;
}

@media (max-width: 600px) {
    .listings-grid.list-view .card-image {
        width: 80px;
    }
    
    .listings-grid.list-view .card-content {
        padding: 12px;
        gap: 12px;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .listings-grid.list-view .card-footer {
        flex-direction: row;
        width: 100%;
        min-width: 0;
        justify-content: space-between;
        align-items: center;
        margin-top: 8px;
    }
}

.empty-state {
    grid-column: 1 / -1;
    padding: 64px 24px;
    text-align: center;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: #ffffff;
    color: var(--text-secondary);
}

/* --- High-End Card Design --- */
.card {
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s;
    display: flex;
    flex-direction: column; /* Vertical card for grid */
    background: #ffffff;
    backdrop-filter: blur(5px);
    border: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.05); /* Subtle base shadow */
    height: auto; /* Auto height */
}

.card:hover {
    transform: translateY(-6px) scale(1.015);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1); /* Modern soft shadow on hover */
}

.card-image {
    width: 100%; /* Full width image */
    height: 96px; /* Reduced from 120px (-20%) */
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    background-color: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 24px;
    position: relative;
}

.card-image::after {
    content: "\f03e";
    font-family: 'Font Awesome 6 Free';
    font-weight: 400;
    position: absolute;
    opacity: 0.3;
    pointer-events: none;
    z-index: 1;
}

.card-image.loaded::after {
    display: none !important;
}

.card-content {
    padding: 10px; /* Reduced from 12px */
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: #404040;
    margin-bottom: 4px;
    line-height: 1.3;
}

.card-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
}

.card-rating i {
    color: #FFD700; /* Gold star */
    font-size: 12px;
}

.card-category {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    background: #F2F4F5;
    padding: 4px 8px;
    border-radius: 4px;
}

.card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
    margin-bottom: 12px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.card-location {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-price {
    font-weight: 700;
    color: var(--text-main);
    font-size: 14px;
}

/* ============================================
   DETAIL VIEW - Nowoczesny układ 2/3 + 1/3
   ============================================ */

.detail-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 2000;
    overflow-y: auto;
    overflow-x: hidden;
    display: none;
    animation: fadeIn 0.3s ease;
    scrollbar-width: thin;
}

.detail-view::-webkit-scrollbar {
    width: 8px;
}

.detail-view::-webkit-scrollbar-track {
    background: transparent;
}

.detail-view::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.detail-view::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.detail-view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(40px) scale(0.98);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.close-detail-btn {
    position: fixed;
    top: 32px;
    left: 32px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: white;
    border: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    z-index: 2001;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #1a1a2e;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Pokaż przycisk zamknięcia gdy detail view jest aktywny */
.detail-view.active ~ .close-detail-btn {
    display: flex;
}

.close-detail-btn:hover {
    transform: scale(1.08) rotate(90deg);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

/* Back button inside auth container (login/register screens) */
.close-auth-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: white;
    border: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #1a1a2e;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.close-auth-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Container - układ 2/3 + 1/3 */
.detail-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
    align-items: start;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

/* ============================================
   LEWA KOLUMNA - Ogłoszenie (2/3)
   ============================================ */

.detail-listing {
    min-width: 0;
}

.listing-card {
    background: white;
    border-radius: 24px;
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
}

.listing-bottom-actions {
    position: relative;
    padding: 0 40px 32px;
    display: flex;
    justify-content: flex-end;
    z-index: 2;
    margin-top: 16px;
}

.listing-bottom-actions .category-pill {
    padding: 10px 16px;
}

/* Nagłówek ogłoszenia */
.listing-header {
    padding: 40px 40px 24px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.listing-header-main {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.category-pill.category-pill-danger {
    border-color: rgba(0, 0, 0, 0.14);
    color: #dc2626;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255,255,255,0.9);
}

.category-pill.category-pill-danger:hover {
    border-color: #dc2626;
    background: rgba(220, 38, 38, 0.08);
    color: #b91c1c;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.15);
}

.category-pill.category-pill-danger i {
    color: #dc2626;
}

.category-pill.category-pill-danger:hover i {
    color: #b91c1c;
}

.category-pill.category-pill-danger span {
    font-weight: 600;
}

.listing-badges {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.badge-category {
    background: color-mix(in srgb, var(--primary-color) 15%, transparent);
    color: var(--primary-color);
    border: 1px solid color-mix(in srgb, var(--primary-color) 30%, transparent);
}

.badge-category i {
    font-size: 12px;
}

.badge-supercategory {
    background: var(--primary-color);
    color: white;
}

.listing-title {
    font-size: 36px;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1.25;
    margin-bottom: 16px;
    letter-spacing: -0.8px;
}

.listing-location {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    background: #f0f2f5;
    padding: 8px 16px;
    border-radius: 20px;
    width: fit-content;
}

.listing-location i {
    color: var(--primary-color);
    font-size: 14px;
}

/* Divider */
.listing-divider {
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        color-mix(in srgb, var(--primary-color) 20%, #e0e0e0) 20%, 
        color-mix(in srgb, var(--primary-color) 20%, #e0e0e0) 80%, 
        transparent
    );
    margin: 0 32px;
}

/* Galeria */
.listing-gallery {
    padding: 0 40px 24px;
}

.gallery-main {
    position: relative;
    width: 100%;
    height: 360px;
    border-radius: 16px;
    overflow: hidden;
    background: #f0f0f0;
    margin-bottom: 16px;
}

.gallery-main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    border: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #1a1a2e;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.gallery-main:hover .gallery-nav {
    opacity: 1;
}

.gallery-nav:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.gallery-prev { left: 16px; }
.gallery-next { right: 16px; }

.gallery-counter {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.gallery-thumbs {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.gallery-thumbs::-webkit-scrollbar {
    height: 6px;
}

.gallery-thumbs::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
}

.gallery-thumbs::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.gallery-thumb {
    width: 80px;
    height: 60px;
    border-radius: 12px;
    object-fit: cover;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    flex-shrink: 0;
}

.gallery-thumb:hover,
.gallery-thumb.active {
    opacity: 1;
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.gallery-thumb.active {
    opacity: 1;
    border-color: var(--primary-color);
}

/* Opis ogłoszenia */
.listing-description {
    padding: 32px 40px;
}

.listing-views {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 40px 32px;
    color: #666;
    font-size: 16px;
    font-weight: 500;
}

.listing-views i {
    color: var(--primary-color);
    font-size: 20px;
    background: color-mix(in srgb, var(--primary-color) 10%, transparent);
    padding: 10px;
    border-radius: 50%;
}

.listing-views span:first-of-type {
    font-weight: 700;
    color: #1a1a2e;
}

.listing-other-listings {
    padding: 32px 40px 40px;
    background: #fafbfc;
}

.listings-grid-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.other-listing-card {
    background: white;
    border: none;
    border-radius: 16px;
    padding: 20px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}

.other-listing-card:hover {
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.08);
    transform: translateY(-4px) scale(1.01);
}

.other-listing-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f0f0f0;
    color: #666;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 6px;
    width: fit-content;
}

.other-listing-badge i {
    color: var(--primary-color);
    font-size: 13px;
}

.other-listing-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    line-height: 1.4;
    word-break: break-word;
}

.other-listing-location {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #888;
}

.other-listing-location i {
    color: var(--primary-color);
    font-size: 11px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

.section-title i {
    color: var(--primary-color);
    font-size: 22px;
}

.description-text {
    font-size: 17px;
    line-height: 1.8;
    color: #4a4a5a;
    white-space: pre-line;
}

/* Parametry */
.listing-params {
    padding: 24px 32px;
}

.params-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.param-item {
    background: #f8f9fa;
    padding: 16px 20px;
    border-radius: 12px;
    border-left: 3px solid var(--primary-color);
    border: 2px solid #cbd5e1; /* Dark border for visibility */
    border-left: 3px solid var(--primary-color); /* Keep left border accent */
}

.param-label {
    display: block;
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.param-value {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
}

/* Mapa */
.listing-map {
    padding: 24px 32px 32px;
}

.map-wrapper {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mini-map {
    width: 100%;
    height: 280px;
    background: #e8e8e8;
}

/* ============================================
   PRAWA KOLUMNA - Firma (1/3)
   ============================================ */

.detail-company {
    min-width: 0;
}

.company-card {
    background: white;
    border-radius: 24px;
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: sticky;
    top: 40px;
}

.sticky-card {
    position: sticky;
    top: 0;
}

/* Header firmy */
.company-header {
    padding: 32px 24px 24px;
    text-align: center;
}

.company-logo-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.company-logo {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), color-mix(in srgb, var(--primary-color) 70%, #000));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px color-mix(in srgb, var(--primary-color) 30%, transparent);
    overflow: hidden;
}

/* Logo w detail view - bez ramki, bez tła, bez cienia */
.detail-company .company-logo {
    width: auto;
    height: auto;
    max-width: 100px;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.company-logo i {
    font-size: 36px;
    color: white;
}

/* Ikona w detail view - ukryta gdy jest obraz */
.detail-company .company-logo i {
    display: none;
}

.company-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Logo w detail view - pokaż obraz w pełności */
.detail-company .company-logo img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.company-name {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.company-since {
    font-size: 14px;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.company-since i {
    color: var(--primary-color);
    font-size: 12px;
}

/* Divider firmy */
.company-divider {
    height: 1px;
    background: #eee;
    margin: 0 24px;
}

/* O firmie */
.company-about {
    padding: 20px 24px;
}

.company-about-box {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px 20px;
    border: 2px solid #cbd5e1; /* Dark border for visibility */
}

[data-theme="dark"] .company-about-box {
    background: #1e293b;
    border: 2px solid #475569; /* More visible dark border */
}

[data-theme="contrast"] .company-about-box {
    background: #000000;
    border: 2px solid #ffffff; /* High contrast */
}

/* Company Gallery */
.company-gallery {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 24px;
}

.company-gallery-main {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 8px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.company-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.company-gallery-main .gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.company-gallery-main .gallery-nav:hover {
    background: rgba(0, 0, 0, 0.8);
}

.company-gallery-main .gallery-prev {
    left: 12px;
}

.company-gallery-main .gallery-next {
    right: 12px;
}

/* Make arrows hidden by default and show on hover */
.company-gallery-main .gallery-nav {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.company-gallery-main:hover .gallery-nav {
    opacity: 1;
}

.company-gallery-main .gallery-counter {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    z-index: 10;
}

.company-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.company-desc {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
}

/* Kontakt */
.company-contact {
    padding: 20px 24px;
}

.contact-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background: #f8f9fa;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 2px solid #cbd5e1; /* Dark border for visibility */
}

.contact-item:hover {
    background: color-mix(in srgb, var(--primary-color) 10%, #f8f9fa);
    transform: translateX(4px);
}

.contact-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.contact-icon i {
    font-size: 16px;
    color: var(--primary-color);
}

.contact-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.contact-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.contact-value {
    font-size: 14px;
    font-weight: 500;
    color: #1a1a2e;
    word-break: break-word;
}

/* Lista ogłoszeń firmy */
.company-listings {
    padding: 20px 24px;
}

.company-listings-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.company-listing-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #f8f9fa;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border-left: 3px solid var(--primary-color);
    border: 2px solid #cbd5e1; /* Dark border for visibility */
    border-left: 3px solid var(--primary-color); /* Keep left border accent */
}

.company-listing-item:hover {
    background: color-mix(in srgb, var(--primary-color) 10%, #f8f9fa);
    transform: translateX(4px);
}

.company-listing-item-text {
    flex: 1;
    min-width: 0;
}

.company-listing-title {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.company-listing-category {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.company-listing-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}

.company-listing-icon i {
    font-size: 14px;
    color: var(--primary-color);
}

/* Adres */

.company-address {
    padding: 20px 24px;
}

.address-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: color-mix(in srgb, var(--primary-color) 8%, #f8f9fa);
    border-radius: 12px;
    border: 2px solid #cbd5e1; /* Dark border for visibility */
}

.address-box > i {
    color: var(--primary-color);
    font-size: 16px;
    margin-top: 2px;
}

.address-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.address-text span {
    font-size: 14px;
    color: #444;
}

/* Dane firmy - jeden box */
.company-details-box {
    padding: 20px 24px;
}

.details-box {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px 20px;
    border: 2px solid #cbd5e1; /* Dark border for visibility */
}

.details-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.details-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.details-row:first-child {
    padding-top: 0;
}

.details-row-last {
    margin-top: auto;
    padding-top: 12px;
}

.details-label {
    font-size: 13px;
    color: #888;
    flex-shrink: 0;
    min-width: 60px;
}

.details-value {
    font-size: 14px;
    font-weight: 500;
    color: #1a1a2e;
    text-align: right;
}

.details-value span {
    display: block;
}

/* NIP - usunięty, przeniesiony do details-box */
.company-vat {
    padding: 16px 24px;
}

.vat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vat-label {
    font-size: 13px;
    color: #888;
}

.vat-value {
    font-size: 14px;
    font-weight: 500;
    color: #1a1a2e;
    font-family: monospace;
}

/* CTA Buttons */
.company-actions {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-cta-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--primary-color) 40%, transparent);
}

.btn-cta-primary:hover {
    filter: brightness(0.95);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px color-mix(in srgb, var(--primary-color) 50%, transparent);
}

.btn-cta-secondary {
    background: white;
    color: var(--text-main);
    border: 2px solid #e0e0e0;
}

.btn-cta-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: color-mix(in srgb, var(--primary-color) 5%, white);
}

/* ============================================
   RESPONSYWNOŚĆ DETAIL VIEW
   ============================================ */

@media (max-width: 1200px) {
    .detail-container {
        padding: 24px 24px;
        gap: 24px;
    }
    
    .params-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .detail-container {
        grid-template-columns: 1fr;
    }
    
    .sticky-card {
        position: static;
    }
    
    .gallery-main {
        height: 240px;
    }
}

@media (max-width: 768px) {
    .detail-container {
        padding: 20px 16px;
        padding-top: 80px;
    }
    
    .close-detail-btn {
        position: fixed;
        top: 16px;
        left: 16px;
        width: 44px;
        height: 44px;
    }
    
    .listing-header {
        padding: 24px 20px 20px;
    }
    
    .listing-title {
        font-size: 24px;
    }
    
    .listing-divider {
        margin: 0 20px;
    }
    
    .listing-gallery,
    .listing-description,
    .listing-views,
    .listing-params,
    .listing-map,
    .listing-other-listings {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .listings-grid-2col {
        grid-template-columns: 1fr;
    }
    
    .gallery-main {
        height: 200px;
    }
    
    .params-grid {
        grid-template-columns: 1fr;
    }
    
    .mini-map {
        height: 220px;
    }
    
    .company-header {
        padding: 24px 20px 20px;
    }
    
    .company-divider {
        margin: 0 20px;
    }
    
    .company-about,
    .company-contact,
    .company-address,
    .company-vat {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .company-actions {
        padding: 20px;
    }
}

/* --- Map popups & markers --- */
.leaflet-popup-content-wrapper {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 0;
    width: 280px !important;
}

/* Hover popup shown above cluster – same styling as regular popup, no autopan */
.cluster-hover-popup .leaflet-popup-tip-container {
    display: block;
}

/* Fix popup close button visibility when there's an image */
.leaflet-popup-close-button {
    background: rgba(255, 255, 255, 0.8) !important;
    border-radius: 50% !important;
    width: 24px !important;
    height: 24px !important;
    top: 8px !important;
    right: 8px !important;
    color: #333 !important;
    font-size: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
    z-index: 10 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.leaflet-popup-close-button::after {
    content: '×';
    font-size: 16px;
    line-height: 1;
    color: #333;
    display: block;
    margin-top: -1px;
}

.leaflet-popup-close-button:hover {
    background: #ffffff !important;
}

.leaflet-popup-close-button:hover::after {
    color: #000;
}

.popup-card {
    display: flex;
    flex-direction: column;
}

.popup-image {
    height: 140px;
    background-size: cover;
    background-position: center;
}

.popup-info {
    padding: 16px;
}

.popup-info h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.popup-btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 4px;
    background: var(--text-main);
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
}

/* ============================================
   Leaflet Marker Cluster - custom styles
   ============================================ */
.marker-cluster-custom {
    background: transparent !important;
    border: none !important;
}

.cluster-inner {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 14px rgba(0,0,0,0.35), 0 0 0 4px rgba(255,255,255,0.6);
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cluster-inner:hover {
    transform: scale(1.12);
    box-shadow: 0 5px 18px rgba(0,0,0,0.4), 0 0 0 5px rgba(255,255,255,0.75);
}

.cluster-inner span {
    color: #ffffff;
    font-size: 14px;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Hide default markercluster divs since we use fully custom icons */
.leaflet-cluster-anim .leaflet-marker-icon,
.leaflet-cluster-anim .leaflet-marker-shadow {
    transition: transform 0.3s ease-out, opacity 0.3s ease-in;
}

/* ============================================
   Custom Pin Markers
   ============================================ */
.custom-marker {
    background: white;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

.custom-marker:hover {
    transform: scale(1.1);
    z-index: 1000 !important;
}

.custom-marker i {
    color: white;
    font-size: 18px;
}

.marker-solar { background: linear-gradient(135deg,#f59e0b,#f97316); }
.marker-heat-pumps { background: linear-gradient(135deg,#ef4444,#dc2626); }
.marker-ev-chargers { background: linear-gradient(135deg,#3b82f6,#2563eb); }
.marker-hvac { background: linear-gradient(135deg,#10b981,#059669); }
.marker-audits { background: linear-gradient(135deg,#8b5cf6,#7c3aed); }
.marker-other { background: linear-gradient(135deg,#6b7280,#4b5563); }

/* Highlight styles for hover over listing card */
.marker-highlighted {
    transform: scale(1.35) !important;
    z-index: 1000 !important;
    filter: brightness(1.3) drop-shadow(0 0 8px rgba(255,255,255,0.9)) !important;
    transition: transform 0.15s ease, filter 0.15s ease !important;
}

.cluster-highlighted {
    transform: scale(1.3) !important;
    z-index: 1000 !important;
    box-shadow: 0 5px 24px rgba(0,0,0,0.45), 0 0 0 5px rgba(255,255,255,1), 0 0 0 8px rgba(255,255,255,0.55) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

/* --- Mobile Toggle --- */
.mobile-toggle {
    display: none; /* Hidden by default on desktop */
}

/* Mobile floating toggle button */
.mobile-toggle-floating {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100;
}

.mobile-toggle-floating .btn-primary {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    padding: 0;
    border: none;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .app-container {
        width: 100%;
    }
    
    .listings-column {
        width: 40vw;
        min-width: 320px;
        padding: 16px;
    }
}

@media (max-width: 768px) {
    .main-header {
        padding: 12px 16px;
        margin: 0;
        width: 100%;
        height: 56px;
        flex-wrap: nowrap;
        gap: 8px;
        border-radius: 0;
        border: none;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        z-index: 100;
        position: sticky;
        top: 0;
    }

    .brand-logo {
        font-size: 18px;
        order: 1;
    }

    .tabs-scroll-wrapper {
        display: none; /* Ukryj w headerze na mobile */
    }

    .industry-tabs-bar {
        display: none;
    }

    .category-bar .scroll-arrow {
        display: none !important;
    }

    .header-nav {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        order: 2;
        margin-left: auto;
    }

    .mobile-menu-overlay {
        display: block;
    }

    .mobile-menu-panel {
        display: flex;
    }

    /* Dark theme mobile menu */
    [data-theme="dark"] .mobile-menu-panel {
        background: #1e293b;
        box-shadow: -2px 0 12px rgba(0, 0, 0, 0.3);
    }

    [data-theme="dark"] .mobile-menu-panel-header {
        border-bottom-color: #334155;
    }

    [data-theme="dark"] .mobile-menu-panel-close {
        color: #f1f5f9;
    }

    /* Contrast theme mobile menu */
    [data-theme="contrast"] .mobile-menu-panel {
        background: #000000;
        border-left: 2px solid #ffffff;
        box-shadow: -2px 0 0 #ffffff;
    }

    [data-theme="contrast"] .mobile-menu-panel-header {
        border-bottom-color: #ffffff;
    }

    [data-theme="contrast"] .mobile-menu-panel-close {
        color: #ffffff;
    }

    .category-bar {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        padding: 8px 0;
        gap: 6px;
        height: auto;
        pointer-events: auto;
        display: none; /* Ukryj w headerze */
    }

    .categories-container {
        gap: 6px;
        padding: 6px 16px;
    }

    /* Hide desktop search on mobile */
    .map-search-container.desktop-search {
        display: none;
    }

    /* Show mobile search */
    .map-search-container.mobile-search {
        display: block;
        position: sticky;
        top: 0;
        z-index: 50;
        margin-bottom: 12px;
        background: white;
        padding: 12px 16px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .map-search-container.mobile-search form {
        margin: 0;
    }

    /* Hide search bar when map is active in mobile */
    .map-column.mobile-active .map-search-container {
        display: none;
    }

    /* Dark theme for mobile search bar */
    [data-theme="dark"] .map-search-container.mobile-search {
        background: #0f172a;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }

    /* Contrast theme for mobile search bar */
    [data-theme="contrast"] .map-search-container.mobile-search {
        background: #000000;
        border-bottom: 2px solid #ffffff;
    }

    .category-pill {
        padding: 8px 14px;
        font-size: 12px;
    }

    .search-feedback {
        padding: 6px 16px;
        font-size: 12px;
    }

    .main-container {
        flex-direction: column;
        flex: 1;
        min-height: 0;
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        bottom: auto;
        overflow: hidden;
    }

    .listings-column {
        position: relative;
        top: auto;
        left: auto;
        bottom: auto;
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        padding: 0;
        border-radius: 0;
        box-shadow: none;
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .listings-column.mobile-active {
        display: flex;
    }

    .listings-header {
        display: none; /* Hide grid/list toggle in mobile */
    }

    .map-column {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        bottom: auto;
        width: 100%;
        height: auto;
        margin: 0;
        padding: 0;
        gap: 0;
        border-radius: 0;
        transform: none;
        transition: none;
        background: white;
        z-index: 1;
        display: none;
    }

    .map-column.mobile-active {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh;
        flex-direction: column;
        z-index: 40;
        padding-top: 60px;
    }

    /* Hide map when listings are active on mobile */
    .listings-column.mobile-active ~ .map-column {
        display: none;
    }

    .listings-grid {
        gap: 8px;
        padding: 12px;
        padding-bottom: 12px;
        grid-template-columns: 1fr !important; /* Force single column */
        flex: 1;
        overflow-y: auto;
        min-height: 0;
    }

    /* Force list view in mobile */
    .listings-grid .card {
        flex-direction: row !important;
        height: 60px;
        flex-shrink: 0;
    }

    .listings-grid .card-image {
        width: 70px !important;
        height: 60px !important;
        flex-shrink: 0;
        min-width: 70px;
    }

    .listings-grid .card-content {
        flex: 1;
        padding: 8px 10px;
        flex-direction: column;
        gap: 4px;
        justify-content: center;
        width: 100%;
    }

    .listings-grid .card-content > div:first-child {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        width: 100%;
        min-width: 0;
    }

    .listings-grid .card-header {
        margin-bottom: 2px;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 0;
    }

    .listings-grid .card-title {
        margin-bottom: 1px;
        padding-top: 4px;
        font-size: 14px;
        line-height: 1.2;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        width: 100%;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .listings-grid .card-desc {
        display: none;
    }

    .listings-grid .card-location {
        font-size: 11px;
        color: var(--text-secondary);
        margin-top: 2px;
    }

    .listings-grid .card-footer {
        margin-top: 0;
        padding-top: 0;
        border-top: none;
        flex-direction: column;
        align-items: flex-end;
        justify-content: center;
        gap: 0;
        flex-shrink: 0;
    }

    .listings-grid .card-price {
        font-size: 12px;
        line-height: 1.2;
    }

    .mobile-toggle {
        display: none;
    }

    .mobile-toggle-floating {
        display: block;
    }

    .detail-body {
        flex-direction: column;
        padding: 12px;
    }

    .detail-header-image {
        height: 240px;
    }

    .params-grid {
        grid-template-columns: 1fr;
    }

    .map-search-container {
        margin-bottom: 8px;
    }

    .map-search-container form {
        height: 40px;
        padding: 2px;
    }

    .map-search-container i.fa-magnifying-glass {
        padding: 0 8px;
    }

    .map-search-container input {
        font-size: 13px;
    }

    .map-search-container button {
        padding: 0 12px;
        font-size: 12px;
    }
}

@media (max-width: 600px) {
    .main-header {
        padding: 10px 12px;
        gap: 6px;
    }

    .brand-logo {
        font-size: 16px;
    }

    .industry-tab {
        padding: 6px 12px;
        font-size: 11px;
        min-width: 80px;
    }

    .industry-tab span {
        font-size: 11px;
    }

    .mobile-menu-btn {
        font-size: 20px;
    }

    .category-bar {
        padding: 6px 0;
    }

    .categories-container {
        padding: 4px 12px;
        gap: 4px;
    }

    .category-pill {
        padding: 6px 12px;
        font-size: 11px;
    }

    .listings-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        padding-bottom: 20px;
    }

    .listings-grid.list-view {
        gap: 6px;
    }

    .listings-grid.list-view .card {
        height: 50px;
        flex-shrink: 0;
    }

    .listings-grid.list-view .card-image {
        width: 65px;
        height: 50px;
    }

    .listings-grid.list-view .card-content {
        padding: 5px 8px;
        gap: 4px;
        flex: 1;
        min-width: 0;
    }

    .listings-grid .card-content {
        padding: 5px 8px;
        flex: 1;
        min-width: 0;
    }

    .listings-grid .card-content > div:first-child {
        width: 100%;
        min-width: 0;
    }

    .listings-grid .card-title {
        font-size: 13px;
        line-height: 1.2;
        padding-top: 3px;
        margin-bottom: 1px;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        width: 100%;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .listings-grid .card-location {
        font-size: 10px;
        color: var(--text-secondary);
        margin-top: 2px;
    }

    .card-title {
        font-size: 12px;
        line-height: 1.2;
    }

    .card-desc {
        display: none;
    }

    .card-price {
        font-size: 12px;
        line-height: 1.2;
    }

    .map-column {
        height: auto;
        display: flex;
        flex-direction: column;
    }

    .map-card {
        flex: 1;
        overflow: hidden;
    }

    .map-column .main-footer {
        flex-shrink: 0;
    }

    .map-search-container {
        margin-bottom: 6px;
    }

    .map-search-container form {
        height: 36px;
        padding: 2px;
    }

    .map-search-container i.fa-magnifying-glass {
        padding: 0 6px;
        font-size: 14px;
    }

    .map-search-container input {
        font-size: 12px;
    }

    .map-search-container button {
        padding: 0 10px;
        font-size: 11px;
    }

    .main-footer {
        height: auto;
        padding: 10px 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 0;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
        z-index: 50;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 6px;
        text-align: center;
        font-size: 11px;
        padding: 0 12px;
    }
    
    .footer-links {
        gap: 12px;
        font-size: 11px;
    }

    /* Mobile Footer in Listings */
    .listings-footer {
        display: flex;
        position: relative;
        width: 100%;
        margin: 0;
        border-radius: 0;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
        z-index: 10;
        flex-shrink: 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .detail-container {
        padding: 16px 12px;
        padding-top: 70px;
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .close-detail-btn {
        top: 12px;
        left: 12px;
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .listing-title {
        font-size: 20px;
    }

    .listing-header {
        padding: 16px 16px 12px;
    }

    .gallery-main {
        height: 200px;
    }

    .gallery-thumb {
        width: 50px;
        height: 40px;
    }

    .params-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .param-item {
        padding: 12px 16px;
    }

    .company-card {
        border-radius: 12px;
    }

    .company-header {
        padding: 16px 16px 12px;
    }

    .company-logo {
        width: 70px;
        height: 70px;
    }

    .company-logo i {
        font-size: 28px;
    }

    .company-name {
        font-size: 18px;
    }

    .company-since {
        font-size: 12px;
    }
}

/* Ultra-small screens (< 480px) */
@media (max-width: 480px) {
    .main-header {
        padding: 8px 10px;
    }

    .brand-logo {
        font-size: 14px;
    }

    .brand-logo i {
        font-size: 18px;
    }

    .industry-tabs-bar {
        gap: 4px;
    }

    .industry-tab {
        padding: 6px 10px;
        min-width: 70px;
        gap: 4px;
    }

    .industry-tab i {
        font-size: 16px;
    }

    .mobile-menu-btn {
        font-size: 18px;
        padding: 4px;
    }

    .category-bar {
        padding: 4px 0;
        min-height: auto;
    }

    .categories-container {
        padding: 4px 10px;
    }

    .category-pill {
        padding: 5px 10px;
        font-size: 10px;
    }

    .listings-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 0;
    }

    .listings-column {
        padding: 8px;
        padding-bottom: 60px;
    }

    .card-image {
        height: 80px;
    }

    .card-content {
        padding: 8px;
    }

    .card-title {
        font-size: 13px;
    }

    .card-desc {
        font-size: 11px;
    }

    .map-column {
        height: 35vh;
    }

    .map-card {
        border-radius: 8px;
    }

    .map-search-container form {
        height: 32px;
        border-radius: 8px;
    }

    .map-search-container i.fa-magnifying-glass {
        padding: 0 4px;
        font-size: 12px;
    }

    .map-search-container input {
        font-size: 11px;
        padding: 0 4px;
    }

    .map-search-container button {
        padding: 0 8px;
        font-size: 10px;
    }

    .detail-container {
        padding: 12px 10px;
        padding-top: 60px;
    }

    .close-detail-btn {
        position: fixed;
        width: 36px;
        height: 36px;
        font-size: 16px;
        top: 10px;
        left: 10px;
    }

    .listing-title {
        font-size: 18px;
    }

    .listing-header {
        padding: 12px 12px 8px;
    }

    .listing-location {
        font-size: 13px;
    }

    .gallery-main {
        height: 180px;
    }

    .gallery-thumb {
        width: 45px;
        height: 35px;
    }

    .gallery-nav {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .gallery-prev {
        left: 8px;
    }

    .gallery-next {
        right: 8px;
    }

    .gallery-counter {
        bottom: 8px;
        right: 8px;
        font-size: 11px;
        padding: 4px 10px;
    }

    .section-title {
        font-size: 16px;
        gap: 8px;
        margin-bottom: 12px;
    }

    .section-title i {
        font-size: 16px;
    }

    .description-text {
        font-size: 13px;
        line-height: 1.6;
    }

    .params-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .param-item {
        padding: 10px 12px;
        border-radius: 8px;
    }

    .param-label {
        font-size: 10px;
    }

    .param-value {
        font-size: 13px;
    }

    .company-header {
        padding: 12px 12px 8px;
    }

    .company-logo {
        width: 60px;
        height: 60px;
        margin-bottom: 12px;
    }

    .company-logo i {
        font-size: 24px;
    }

    .company-name {
        font-size: 16px;
        margin-bottom: 6px;
    }

    .company-since {
        font-size: 11px;
    }

    .company-divider {
        margin: 0 12px;
    }

    .company-about {
        padding: 12px 12px;
    }

    .company-about-box {
        padding: 12px 14px;
        border-radius: 8px;
    }

    .company-section-title {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .company-desc {
        font-size: 12px;
        line-height: 1.5;
    }

    .contact-item {
        padding: 10px 12px;
        gap: 10px;
        border-radius: 8px;
    }

    .contact-icon {
        width: 36px;
        height: 36px;
        border-radius: 8px;
    }

    .contact-icon i {
        font-size: 14px;
    }

    .contact-label {
        font-size: 10px;
    }

    .contact-value {
        font-size: 12px;
    }

    .address-box {
        padding: 12px 14px;
        gap: 10px;
        border-radius: 8px;
    }

    .address-box > i {
        font-size: 14px;
    }

    .address-text span {
        font-size: 12px;
    }

    .footer-content {
        font-size: 10px;
    }

    .footer-links {
        font-size: 10px;
        gap: 10px;
    }

    /* Mobile menu panel na małych ekranach */
    .mobile-menu-panel {
        width: 260px;
    }

    .mobile-menu-panel-header {
        padding: 12px;
    }

    .mobile-menu-panel-content {
        padding: 12px;
        gap: 10px;
    }
}

/* ============================================
   Loading States
   ============================================ */

.listings-grid.loading {
    position: relative;
    min-height: 200px;
}

.listings-grid.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.listings-grid.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 11;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Loading skeleton for cards */
.card.skeleton {
    background: var(--bg-card);
}

.card.skeleton .card-image,
.card.skeleton .card-title,
.card.skeleton .card-category,
.card.skeleton .card-desc {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.card.skeleton .card-image {
    height: 160px;
}

.card.skeleton .card-title {
    width: 70%;
    height: 20px;
}

.card.skeleton .card-category {
    width: 50%;
    height: 16px;
    margin-top: 8px;
}

.card.skeleton .card-desc {
    width: 100%;
    height: 40px;
    margin-top: 8px;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* ============================================
   Error States
   ============================================ */

.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    color: var(--text-secondary);
}

.error-state i {
    font-size: 48px;
    color: #ef4444;
    margin-bottom: 16px;
}

.error-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.error-state p {
    font-size: 14px;
    margin-bottom: 16px;
}

.error-state button {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.error-state button:hover {
    opacity: 0.9;
}

/* Search feedback error state */
.search-feedback {
    display: block;
    padding: 8px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
}

.search-feedback.error {
    color: #ef4444;
    background: #fef2f2;
    border-radius: 8px;
    margin: 8px 24px;
}

/* ============================================
   Empty State Enhancement
   ============================================ */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    color: var(--text-secondary);
    grid-column: 1 / -1; /* Span all columns in grid */
}

.empty-state i {
    font-size: 48px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
}

/* ============================================
   Toast Notifications (for future use)
   ============================================ */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--text-main);
    color: white;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    max-width: 360px;
}

.toast.success {
    background: #22c55e;
}

.toast.error {
    background: #ef4444;
}

.toast.warning {
    background: #f59e0b;
}

.toast i {
    font-size: 18px;
}

.toast-message {
    flex: 1;
    font-size: 14px;
}

.toast-close {
    background: none;
    border: none;
    color: white;
    opacity: 0.7;
    cursor: pointer;
    padding: 4px;
}

.toast-close:hover {
    opacity: 1;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ============================================
   Transitions & Animations
   ============================================ */

.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-4px);
}

.industry-tab,
.category-pill {
    transition: all 0.2s ease;
}

.btn-primary {
    transition: all 0.2s ease;
}

.btn-primary:active {
    transform: scale(0.98);
}

/* --- Loading & Error States --- */
.loading-indicator {
    padding: 12px 24px;
    color: var(--text-secondary);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.loading-indicator::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-message {
    padding: 16px 24px;
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}

/* --- Dark Theme for Tabs & Pills --- */
[data-theme="dark"] .scroll-arrow {
    background: rgba(30, 41, 59, 0.9);
    border-color: #334155;
    color: #94a3b8;
}

[data-theme="dark"] .scroll-arrow:hover {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

[data-theme="dark"] .industry-tab {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-color: #334155;
    color: #94a3b8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .industry-tab:hover {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    border-color: #475569;
    color: #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .industry-tab:hover i {
    color: #e2e8f0;
}

[data-theme="dark"] .industry-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .industry-tab.active i {
    color: white;
}

[data-theme="dark"] .industry-tab.active span {
    color: white;
}

[data-theme="dark"] .category-pill {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-color: #334155;
    color: #94a3b8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .category-pill:hover {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    border-color: #475569;
    color: #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

[data-theme="dark"] .category-pill.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

[data-theme="dark"] .category-pill.active:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    transform: translateY(-3px);
}

/* ============================================
   DARK THEME - Pełne style
   ============================================ */

[data-theme="dark"] {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --text-main: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
}

[data-theme="dark"] body {
    background: #0f172a;
}

[data-theme="dark"] .app-container {
    background: transparent;
}

[data-theme="dark"] .main-header {
    background: #1e293b;
    border-bottom: 1px solid #334155;
}

[data-theme="dark"] .leaflet-bar {
    background: rgba(30, 41, 59, 0.92) !important;
}

[data-theme="dark"] .leaflet-bar a {
    color: #f1f5f9 !important;
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .leaflet-bar a:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .brand-logo {
    color: #f1f5f9;
}

[data-theme="dark"] .theme-switcher {
    background: #334155;
    border-color: #475569;
}

[data-theme="dark"] .theme-btn {
    color: #94a3b8;
}

[data-theme="dark"] .theme-btn:hover {
    background: #475569;
    color: #f1f5f9;
}

[data-theme="dark"] .theme-btn.active {
    background: var(--primary-color);
    color: white;
}

[data-theme="dark"] .category-bar {
    background: transparent;
    border-bottom: none;
}

[data-theme="dark"] .card {
    background: #1e293b;
    border: 2px solid #475569; /* More visible dark border */
}

[data-theme="dark"] .card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .card-title {
    color: #f1f5f9;
}

[data-theme="dark"] .card-desc {
    color: #94a3b8;
}

[data-theme="dark"] .card-location {
    color: #64748b;
}

[data-theme="dark"] .listings-column {
    background: #0f172a;
}

[data-theme="dark"] .detail-view {
    background: #1e293b;
}

[data-theme="dark"] .detail-header {
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0.8), #1e293b);
}

[data-theme="dark"] .detail-content h2,
[data-theme="dark"] .detail-content h3 {
    color: #f1f5f9;
}

[data-theme="dark"] .detail-content p {
    color: #94a3b8;
}

[data-theme="dark"] .detail-info li {
    color: #94a3b8;
    border-bottom-color: #334155;
}

[data-theme="dark"] .close-detail-btn {
    background: #334155;
    color: #f1f5f9;
}

[data-theme="dark"] .close-detail-btn:hover {
    background: #475569;
}

[data-theme="dark"] .empty-state {
    color: #94a3b8;
}

[data-theme="dark"] .empty-state h3 {
    color: #f1f5f9;
}

[data-theme="dark"] .map-search-container form {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .map-search-container i.fa-magnifying-glass {
    color: #94a3b8;
}

[data-theme="dark"] .map-search-container input {
    background: transparent;
    color: #f1f5f9;
}

[data-theme="dark"] .map-search-container input::placeholder {
    color: #64748b;
}

[data-theme="dark"] .map-search-container button {
    background: var(--primary-color);
}

[data-theme="dark"] .popup-card {
    background: #1e293b;
}

[data-theme="dark"] .popup-title {
    color: #f1f5f9;
}

[data-theme="dark"] .popup-meta {
    color: #94a3b8;
}

[data-theme="dark"] .nav-btn {
    background: #334155;
    color: #f1f5f9;
    border-color: #475569;
}

[data-theme="dark"] .nav-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
    border-color: #f1f5f9;
}

[data-theme="dark"] .view-toggle {
    background: #334155;
}

[data-theme="dark"] .view-toggle button {
    background: #334155;
    border-color: #475569;
    color: #94a3b8;
}

[data-theme="dark"] .view-toggle button:hover,
[data-theme="dark"] .view-toggle button.active {
    background: var(--primary-color);
    color: white;
}

/* Dark theme - list view cards with more visible borders */
[data-theme="dark"] .listings-grid.list-view .card {
    border: 2px solid #475569;
}

/* ============================================
   CONTRAST THEME - Wysoki kontrast (WCAG AAA)
   ============================================ */

[data-theme="contrast"] {
    --bg-body: #000000;
    --bg-card: #000000;
    --bg-gradient: #000000;
    --text-main: #ffffff;
    --text-secondary: #ffffff;
    --border-color: #ffffff;
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;
}

[data-theme="contrast"] body {
    background: #000000;
}

[data-theme="contrast"] .main-header {
    background: #000000;
    border-bottom: 2px solid #ffffff;
}

[data-theme="contrast"] .brand-logo {
    color: #ffffff;
}

[data-theme="contrast"] .theme-switcher {
    background: #000000;
    border: 2px solid #ffffff;
}

[data-theme="contrast"] .theme-btn {
    color: #ffffff;
    border: 2px solid transparent;
}

[data-theme="contrast"] .theme-btn:hover {
    background: #ffffff;
    color: #000000;
    border-color: #ffffff;
}

[data-theme="contrast"] .theme-btn.active {
    background: #ffff00;
    color: #000000;
    border: 2px solid #ffff00;
    font-weight: 600;
}

[data-theme="contrast"] .industry-tab {
    background: #000000;
    border: 2px solid #ffffff;
    color: #ffffff;
    box-shadow: none;
}

[data-theme="contrast"] .industry-tab i {
    color: #ffffff;
}

[data-theme="contrast"] .industry-tab:hover {
    background: #333333;
    border-color: #ffff00;
    color: #ffff00;
    box-shadow: none;
    transform: none;
}

[data-theme="contrast"] .industry-tab:hover i {
    color: #ffff00;
}

[data-theme="contrast"] .industry-tab.active {
    background: #ffff00;
    border-color: #ffff00;
    color: #000000;
    box-shadow: none;
}

[data-theme="contrast"] .industry-tab.active i,
[data-theme="contrast"] .industry-tab.active span {
    color: #000000;
}

[data-theme="contrast"] .category-bar {
    background: #000000;
    border-bottom: 2px solid #ffffff;
}

[data-theme="contrast"] .category-pill {
    background: #000000;
    border: 2px solid #ffffff;
    color: #ffffff;
    box-shadow: none;
}

[data-theme="contrast"] .category-pill:hover {
    background: #333333;
    border-color: #ffff00;
    color: #ffff00;
    box-shadow: none;
    transform: none;
}

[data-theme="contrast"] .category-pill.active {
    background: #ffff00;
    border-color: #ffff00;
    color: #000000;
    box-shadow: none;
    transform: none;
}

[data-theme="contrast"] .card {
    background: #000000;
    border: 2px solid #ffffff;
    box-shadow: none;
}

[data-theme="contrast"] .card:hover {
    box-shadow: none;
}

[data-theme="contrast"] .card-title {
    color: #ffffff;
}

[data-theme="contrast"] .card-category {
    color: #ffff00;
}

[data-theme="contrast"] .card-desc {
    color: #ffffff;
}

[data-theme="contrast"] .card-location {
    color: #ffffff;
}

[data-theme="contrast"] .card-rating {
    color: #ffff00;
}

[data-theme="contrast"] .listings-column {
    background: #000000;
}

[data-theme="contrast"] .detail-view {
    background: #000000;
    border-left: 2px solid #ffffff;
}

[data-theme="contrast"] .detail-header {
    background: #000000;
}

[data-theme="contrast"] .detail-content h2,
[data-theme="contrast"] .detail-content h3 {
    color: #ffffff;
}

[data-theme="contrast"] .detail-content p {
    color: #ffffff;
}

[data-theme="contrast"] .detail-info li {
    color: #ffffff;
    border-bottom: 1px solid #ffffff;
}

[data-theme="contrast"] .close-detail-btn {
    background: #000000;
    border: 2px solid #ffffff;
    color: #ffffff;
}

[data-theme="contrast"] .close-detail-btn:hover {
    background: #ffff00;
    color: #000000;
}

[data-theme="contrast"] .empty-state,
[data-theme="contrast"] .empty-state h3,
[data-theme="contrast"] .empty-state p {
    color: #ffffff;
}

[data-theme="contrast"] .nav-btn {
    background: #000000;
    color: #ffffff;
    border: 2px solid #ffffff;
}

[data-theme="contrast"] .nav-btn:hover {
    background: #ffff00;
    color: #000000;
    border-color: #ffff00;
}

[data-theme="contrast"] .map-search-container form {
    background: #000000;
    border: 2px solid #ffffff;
}

[data-theme="contrast"] .map-search-container i.fa-magnifying-glass {
    color: #ffffff;
}

[data-theme="contrast"] .map-search-container input {
    background: transparent;
    color: #ffffff;
}

[data-theme="contrast"] .map-search-container input::placeholder {
    color: #cccccc;
}

[data-theme="contrast"] .map-search-container button {
    background: #ffff00;
    color: #000000;
    border: 2px solid #ffff00;
}

[data-theme="contrast"] .popup-card {
    background: #000000;
    border: 2px solid #ffffff;
}

[data-theme="contrast"] .popup-title {
    color: #ffffff;
}

[data-theme="contrast"] .popup-meta {
    color: #ffffff;
}

[data-theme="contrast"] .popup-btn {
    background: #ffff00;
    color: #000000;
    border: none;
}

[data-theme="contrast"] .view-toggle {
    background: #000000;
    border: 2px solid #ffffff;
    padding: 4px;
}

[data-theme="contrast"] .view-toggle button {
    background: #000000;
    border: 2px solid #ffffff;
    color: #ffffff;
}

[data-theme="contrast"] .view-toggle button:hover,
[data-theme="contrast"] .view-toggle button.active {
    background: #ffff00;
    color: #000000;
    border-color: #ffff00;
}

/* Contrast theme - list view cards with maximum visibility */
[data-theme="contrast"] .listings-grid.list-view .card {
    border: 2px solid #ffffff;
}

[data-theme="contrast"] a {
    color: #ffff00;
    text-decoration: underline;
}

[data-theme="contrast"] a:hover {
    color: #ffffff;
}

/* Contrast theme - focus states dla dostępności */
[data-theme="contrast"] *:focus {
    outline: 3px solid #ffff00;
    outline-offset: 2px;
}

[data-theme="contrast"] .custom-marker {
    border: 2px solid #ffffff !important;
}

/* ============================================
   DARK THEME - Detail View (Nowy układ 2/3 + 1/3)
   ============================================ */

[data-theme="dark"] .detail-view {
    background: #0f172a;
}

[data-theme="dark"] .close-detail-btn {
    background: #1e293b;
    color: #f1f5f9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .listing-card {
    background: #1e293b;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .listing-title {
    color: #f1f5f9;
}

[data-theme="dark"] .listing-location {
    color: #94a3b8;
}

[data-theme="dark"] .badge-category {
    background: color-mix(in srgb, var(--primary-color) 20%, #1e293b);
    border-color: color-mix(in srgb, var(--primary-color) 40%, transparent);
}

[data-theme="dark"] .listing-divider {
    background: linear-gradient(90deg, 
        transparent, 
        color-mix(in srgb, var(--primary-color) 30%, #334155) 20%, 
        color-mix(in srgb, var(--primary-color) 30%, #334155) 80%, 
        transparent
    );
}

[data-theme="dark"] .gallery-main {
    background: #334155;
}

[data-theme="dark"] .gallery-nav {
    background: #1e293b;
    color: #f1f5f9;
}

[data-theme="dark"] .gallery-thumb {
    border-color: #334155;
}

[data-theme="dark"] .gallery-thumb.active {
    border-color: var(--primary-color);
}

[data-theme="dark"] .section-title {
    color: #f1f5f9;
}

[data-theme="dark"] .description-text {
    color: #94a3b8;
}

[data-theme="dark"] .param-item {
    background: #0f172a;
    border: 2px solid #475569; /* More visible dark border */
    border-left: 3px solid var(--primary-color); /* Keep left border accent */
}

[data-theme="dark"] .param-label {
    color: #64748b;
}

[data-theme="dark"] .param-value {
    color: #f1f5f9;
}

[data-theme="dark"] .map-wrapper {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .mini-map {
    background: #334155;
}

/* Dark theme - Prawa kolumna (firma) */
[data-theme="dark"] .company-card {
    background: #1e293b;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .company-name {
    color: #f1f5f9;
}

[data-theme="dark"] .company-since {
    color: #64748b;
}

[data-theme="dark"] .company-divider {
    background: #334155;
}

[data-theme="dark"] .company-section-title {
    color: #64748b;
}

[data-theme="dark"] .company-desc {
    color: #94a3b8;
}

[data-theme="dark"] .contact-item {
    background: #0f172a;
    border: 2px solid #475569; /* More visible dark border */
}

[data-theme="dark"] .contact-item:hover {
    background: color-mix(in srgb, var(--primary-color) 15%, #0f172a);
}

[data-theme="dark"] .contact-icon {
    background: #1e293b;
}

[data-theme="dark"] .contact-label {
    color: #64748b;
}

[data-theme="dark"] .contact-value {
    color: #f1f5f9;
}

[data-theme="dark"] .company-listing-item {
    background: #0f172a;
    border: 2px solid #475569; /* More visible dark border */
    border-left: 3px solid var(--primary-color); /* Keep left border accent */
}

[data-theme="dark"] .company-listing-item:hover {
    background: color-mix(in srgb, var(--primary-color) 15%, #0f172a);
}

[data-theme="dark"] .company-listing-title {
    color: #f1f5f9;
}

[data-theme="dark"] .company-listing-category {
    color: #64748b;
}

[data-theme="dark"] .company-listing-icon {
    background: #1e293b;
}

[data-theme="dark"] .details-box {
    background: #1e293b;
    border: 2px solid #475569; /* More visible dark border */
}

[data-theme="dark"] .details-row {
    border-bottom-color: #334155;
}

[data-theme="dark"] .details-label {
    color: #64748b;
}

[data-theme="dark"] .details-value {
    color: #f1f5f9;
}

[data-theme="dark"] .address-box {
    background: color-mix(in srgb, var(--primary-color) 10%, #0f172a);
    border: 2px solid #475569; /* More visible dark border */
}

[data-theme="dark"] .address-text span {
    color: #cbd5e1;
}

[data-theme="dark"] .vat-label {
    color: #64748b;
}

[data-theme="dark"] .vat-value {
    color: #f1f5f9;
}

[data-theme="dark"] .btn-cta-secondary {
    background: #0f172a;
    color: #f1f5f9;
    border-color: #475569;
}

[data-theme="dark"] .btn-cta-secondary:hover {
    background: color-mix(in srgb, var(--primary-color) 10%, #0f172a);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

[data-theme="dark"] .popup-btn {
    background: var(--primary-color);
    color: white;
    border: none;
}

/* ============================================
   CONTRAST THEME - Detail View (Nowy układ 2/3 + 1/3)
   ============================================ */

[data-theme="contrast"] .detail-view {
    background: #000000;
}

[data-theme="contrast"] .close-detail-btn {
    background: #000000;
    color: #ffffff;
    border: 2px solid #ffffff;
}

[data-theme="contrast"] .listing-card {
    background: #000000;
    border: 2px solid #ffffff;
    box-shadow: none;
}

[data-theme="contrast"] .listing-title {
    color: #ffffff;
}

[data-theme="contrast"] .listing-location {
    color: #ffffff;
}

[data-theme="contrast"] .badge {
    border: 2px solid #ffff00;
}

[data-theme="contrast"] .badge-category {
    background: #000000;
    color: #ffff00;
}

[data-theme="contrast"] .badge-supercategory {
    background: #ffff00;
    color: #000000;
}

[data-theme="contrast"] .listing-divider {
    background: #ffffff;
}

[data-theme="contrast"] .gallery-main {
    border: 2px solid #ffffff;
}

[data-theme="contrast"] .gallery-nav {
    background: #000000;
    color: #ffffff;
    border: 2px solid #ffffff;
}

[data-theme="contrast"] .gallery-nav:hover {
    background: #ffff00;
    color: #000000;
}

[data-theme="contrast"] .gallery-counter {
    background: #000000;
    border: 1px solid #ffffff;
}

[data-theme="contrast"] .gallery-thumb {
    border: 2px solid #ffffff;
}

[data-theme="contrast"] .gallery-thumb.active {
    border-color: #ffff00;
}

[data-theme="contrast"] .section-title {
    color: #ffffff;
}

[data-theme="contrast"] .section-title i {
    color: #ffff00;
}

[data-theme="contrast"] .description-text {
    color: #ffffff;
}

[data-theme="contrast"] .param-item {
    background: #000000;
    border: 2px solid #ffffff;
    border-left: 4px solid #ffff00;
}

[data-theme="contrast"] .param-label {
    color: #ffffff;
}

[data-theme="contrast"] .param-value {
    color: #ffffff;
}

[data-theme="contrast"] .map-wrapper {
    border: 2px solid #ffffff;
}

[data-theme="contrast"] .mini-map {
    background: #333333;
}

/* Contrast theme - Prawa kolumna (firma) */
[data-theme="contrast"] .company-card {
    background: #000000;
    border: 2px solid #ffffff;
    box-shadow: none;
}

[data-theme="contrast"] .company-name {
    color: #ffffff;
}

[data-theme="contrast"] .company-since {
    color: #ffffff;
}

[data-theme="contrast"] .company-divider {
    background: #ffffff;
}

[data-theme="contrast"] .company-section-title {
    color: #ffff00;
}

[data-theme="contrast"] .company-desc {
    color: #ffffff;
}

[data-theme="contrast"] .contact-item {
    background: #000000;
    border: 2px solid #ffffff; /* High contrast */
}

[data-theme="contrast"] .contact-item:hover {
    background: #ffff00;
    border-color: #ffff00;
}

[data-theme="contrast"] .contact-item:hover .contact-icon,
[data-theme="contrast"] .contact-item:hover .contact-icon i,
[data-theme="contrast"] .contact-item:hover .contact-label,
[data-theme="contrast"] .contact-item:hover .contact-value {
    color: #000000;
}

[data-theme="contrast"] .contact-icon {
    background: #000000;
    border: 2px solid #ffffff;
}

[data-theme="contrast"] .contact-icon i {
    color: #ffff00;
}

[data-theme="contrast"] .contact-label {
    color: #ffffff;
}

[data-theme="contrast"] .company-listing-item {
    background: #000000;
    border: 2px solid #ffffff; /* High contrast */
    border-left: 4px solid #ffff00; /* Keep left border accent */
}

[data-theme="contrast"] .company-listing-item:hover {
    background: #ffff00;
    border-left-color: #ffff00;
}

[data-theme="contrast"] .company-listing-item:hover .company-listing-title,
[data-theme="contrast"] .company-listing-item:hover .company-listing-category,
[data-theme="contrast"] .company-listing-item:hover .company-listing-icon i {
    color: #000000;
}

[data-theme="contrast"] .company-listing-title {
    color: #ffffff;
}

[data-theme="contrast"] .company-listing-category {
    color: #ffffff;
}

[data-theme="contrast"] .company-listing-icon {
    background: #000000;
    border: 2px solid #ffffff;
}

[data-theme="contrast"] .company-listing-icon i {
    color: #ffff00;
}

[data-theme="contrast"] .contact-value {
    color: #ffffff;
}

[data-theme="contrast"] .details-box {
    background: #000000;
    border: 2px solid #ffffff; /* High contrast */
}

[data-theme="contrast"] .details-row {
    border-bottom-color: #ffffff;
}

[data-theme="contrast"] .details-label {
    color: #ffffff;
}

[data-theme="contrast"] .details-value {
    color: #ffffff;
}

[data-theme="contrast"] .address-box {
    background: #000000;
    border: 2px solid #ffff00;
}

[data-theme="contrast"] .address-box > i {
    color: #ffff00;
}

[data-theme="contrast"] .address-text span {
    color: #ffffff;
}

[data-theme="contrast"] .vat-label {
    color: #ffffff;
}

[data-theme="contrast"] .vat-value {
    color: #ffffff;
}

[data-theme="contrast"] .btn-cta-primary {
    background: #ffff00;
    color: #000000;
    border: 2px solid #ffff00;
}

[data-theme="contrast"] .btn-cta-primary:hover {
    background: #ffffff;
}

[data-theme="contrast"] .btn-cta-secondary {
    background: #000000;
    color: #ffffff;
    border: 2px solid #ffffff;
}

[data-theme="contrast"] .btn-cta-secondary:hover {
    background: #ffff00;
    color: #000000;
    border-color: #ffff00;
}

[data-theme="contrast"] .popup-btn {
    background: #ffff00;
    color: #000000;
    border: 2px solid #ffff00;
    font-weight: 600;
}

[data-theme="contrast"] .popup-btn:hover {
    background: #ffffff;
    color: #000000;
    border-color: #ffffff;
}

/* ============================================
   AUTHENTICATION SCREENS
   ============================================ */

.auth-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: flex-start;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), #1e40af);
    z-index: 9999;
    opacity: 1;
    overflow-y: auto;
    transition: opacity 0.3s ease;
}

.auth-container.active {
    display: flex;
}

.auth-container.hidden {
    display: none;
}

.auth-screen {
    display: none;
    animation: slideUp 0.3s ease;
}

.auth-screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    width: 100%;
    padding: 0;
}

/* Login screen specifically: no extra padding, layout handled by auth-login-layout */
.login-screen.active {
    justify-content: center;
    padding: 0;
}

.auth-box {
    background: white;
    border-radius: 16px;
    padding: 48px 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
}

.auth-title i {
    color: var(--primary-color);
    font-size: 32px;
}

.auth-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
    background: white;
    color: var(--text-main);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.1);
}

.form-help {
    font-size: 12px;
    color: var(--text-secondary);
}

.form-error {
    font-size: 12px;
    color: #dc2626;
    min-height: 16px;
}

.btn-auth {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-auth:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner.hidden {
    display: none;
}

.hidden {
    display: none !important;
}

.error-message {
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #dc2626;
    font-size: 14px;
    text-align: center;
    margin-bottom: 0;
}

.error-message:not(:empty) {
    padding: 12px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    margin-bottom: 16px;
}

.success-message {
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #16a34a;
    font-size: 14px;
    text-align: center;
    margin-bottom: 0;
}

.success-message:not(:empty):not(.hidden) {
    padding: 12px 16px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    margin-bottom: 16px;
}

.success-message.hidden {
    display: none;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
    color: var(--text-secondary);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.auth-divider span {
    font-size: 13px;
}

.auth-link-text {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.auth-link:hover {
    text-decoration: underline;
}

@media (max-width: 600px) {
    .auth-box {
        padding: 32px 24px;
        margin: 16px;
    }

    .auth-title {
        font-size: 24px;
    }

    .auth-subtitle {
        font-size: 14px;
    }
}

/* ============================================
   REGISTER FORM – MULTI-SECTION
   ============================================ */

/* Wider auth box for the extended register form */
.auth-box--wide {
    max-width: 560px;
}

.auth-subtitle-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-style: italic;
}

/* Section wrappers */
.register-section {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 4px;
    transition: all 0.3s ease;
}

.register-section--hidden {
    display: none;
}

.register-section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.register-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.register-section-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 14px;
    line-height: 1.5;
}

/* NIP input row: input + button side by side */
.nip-input-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.nip-input-row input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
    background: white;
    color: var(--text-main);
}

.nip-input-row input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.1);
}

/* Form rows for side-by-side fields */
.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

.form-group--street { flex: 3 !important; }
.form-group--building { flex: 1 !important; }
.form-group--postal { flex: 2 !important; }
.form-group--town { flex: 3 !important; }
.form-group--vat-status { flex: 1.5 !important; }

/* VAT status badge */
.vat-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    background: #f1f5f9;
    color: var(--text-secondary);
    border: 2px solid #e2e8f0;
    min-height: 44px;
    line-height: 1.2;
    white-space: nowrap;
}

.vat-status--active {
    background: #f0fdf4;
    border-color: #86efac;
    color: #166534;
}

.vat-status--exempt {
    background: #fffbeb;
    border-color: #fcd34d;
    color: #92400e;
}

.vat-status--unregistered {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
}

/* Read-only company data fields */
.form-group input[readonly] {
    background: #f1f5f9;
    color: var(--text-secondary);
    border-color: #e2e8f0;
    cursor: default;
}

@media (max-width: 600px) {
    .auth-box--wide {
        max-width: 100%;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .nip-input-row {
        flex-direction: column;
    }

    .nip-input-row input {
        width: 100%;
    }
}

/* ============================================
   DASHBOARD STYLES
   ============================================ */

.dashboard-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-body);
    color: var(--text-main);
    padding-top: var(--header-height);
}

.dashboard-header {
    height: 60px;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: var(--shadow-md);
}

.dashboard-brand {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
}

.dashboard-brand i {
    color: var(--primary-color);
    font-size: 28px;
}

.dashboard-user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-email {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f3f4f6;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.dashboard-tabs {
    display: flex;
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 0 20px;
    position: sticky;
    top: 60px; /* height of .dashboard-header */
    z-index: 99;
}

.dashboard-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-secondary);
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.dashboard-tab:hover {
    color: var(--text-main);
}

.dashboard-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.dashboard-tab i {
    font-size: 18px;
}

.dashboard-content {
    flex: 1;
    padding: 20px;
}

.dashboard-tab-content {
    display: none;
}

.dashboard-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.dashboard-section {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 20px;
    margin-bottom: 20px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 16px;
}

.section-title i {
    color: var(--primary-color);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.pin-stats {
    display: flex;
    gap: 8px;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: color-mix(in srgb, var(--primary-color) 10%, white);
    border: 1px solid color-mix(in srgb, var(--primary-color) 20%, #e2e8f0);
    border-radius: 20px;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 13px;
}

.section-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Company Info Display */
.company-info-display {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-item label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.info-value {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-main);
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.info-value.readonly {
    opacity: 0.7;
}

.info-value.badge {
    display: inline-block;
    width: fit-content;
    padding: 6px 12px;
    background: #dcfce7;
    color: #16a34a;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    border: none;
}

.info-value.badge.unverified {
    background: #fee2e2;
    color: #dc2626;
}

/* Forms */
.company-edit-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: fadeIn 0.3s ease;
}

.pin-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.form-grid.full-width {
    grid-column: 1 / -1;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.textarea-counter-inline {
    font-size: 12px;
    font-weight: normal;
    color: var(--text-secondary);
    margin-left: 0;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-main);
    background: white;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    width: 100%;
    max-width: 800px;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.7;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Description and Logo Layout */
.description-logo-wrapper {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 40px;
    align-items: flex-start;
    grid-column: 1 / -1;
}

.description-section {
    grid-column: 1;
}

.description-section .form-group {
    width: 100%;
}

.description-section textarea {
    width: 100%;
    max-width: 410px;
}

.logo-section {
    grid-column: 3;
    min-width: 200px;
}

.logo-section .form-group {
    width: 100%;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.btn-primary,
.btn-secondary,
.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #229d3a;
    transform: translateY(-2px);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: #e5e7eb;
    color: #1f2937;
    border: 1px solid #9ca3af;
}

.btn-secondary:hover {
    background: #d1d5db;
    color: #111827;
}

.btn-danger {
    background: #fecaca;
    color: #991b1b;
}

.btn-danger:hover {
    background: #fca5a5;
}

/* Pins Table */
.pins-table-wrapper {
    overflow-x: auto;
}

.pins-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.pins-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid var(--border-color);
}

.pins-table th {
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-main);
}

.pins-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
}

.pins-table tbody tr:hover {
    background: #f8f9fa;
}

.pins-table .empty-row td {
    text-align: center;
    color: var(--text-secondary);
    padding: 20px;
}

.table-actions {
    display: flex;
    gap: 8px;
}

.table-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.table-action-btn.edit {
    background: #dbeafe;
    color: #0284c7;
}

.table-action-btn.edit:hover {
    background: #bfdbfe;
}

.table-action-btn.delete {
    background: #fee2e2;
    color: #dc2626;
}

.table-action-btn.delete:hover {
    background: #fecaca;
}

.btn-add-pin {
    align-self: flex-start;
}

.views-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    color: #6b7280;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: calc(var(--header-height) + 20px) 20px calc(20px + env(safe-area-inset-bottom, 0px)) 20px;
    animation: fadeIn 0.2s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 0 24px 24px;
}

.modal-content-small {
    max-width: 400px;
}

.modal-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 20px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.modal-close:hover {
    color: var(--text-main);
}

.modal-body {
    padding: 16px;
    color: var(--text-secondary);
}

.modal-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-content-large {
    max-width: 800px;
}

.pin-form {
    padding: 16px;
}

/* Pin Map Picker */
.pin-map-picker-container {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    background: #f8f9fa;
}

.pin-map-picker {
    width: 100%;
    height: 300px;
    cursor: crosshair;
}

.pin-location-info {
    display: flex;
    gap: 24px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-top: 1px solid var(--border-color);
}

.location-coords {
    display: flex;
    align-items: center;
    gap: 8px;
}

.coord-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
}

#pin-lat-display,
#pin-lon-display {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    color: var(--text-main);
    font-weight: 500;
    min-width: 100px;
}

.form-help-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* Company Status Bar */
.company-status-bar {
    display: flex;
    gap: 16px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 12px;
}

.company-status-bar .status-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.company-status-bar label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 14px;
}

.company-status-bar .info-value {
    font-weight: 500;
    color: var(--text-main);
}

/* Graphics Section */
.graphics-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.subsection-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 12px;
}

.subsection-title i {
    color: var(--primary-color);
}

/* Upload Area */
.upload-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    transform: scale(1.02);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-align: center;
}

.upload-placeholder i {
    font-size: 36px;
    color: var(--primary-color);
    opacity: 0.8;
}

.upload-placeholder span {
    font-size: 14px;
    font-weight: 500;
}

.upload-placeholder small {
    font-size: 12px;
    opacity: 0.7;
}

/* Image Preview Container */
.image-preview-container {
    position: relative;
    display: inline-block;
    max-width: 300px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.image-preview {
    display: block;
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
    border-radius: 12px;
}

.btn-remove-image {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(220, 38, 38, 0.9);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-remove-image:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* Gallery Preview */
.gallery-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.gallery-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    background: #f1f5f9;
}

.gallery-item.pending {
    border: 2px solid var(--primary-color);
}

.gallery-item.existing {
    border: 2px solid #e5e7eb;
}

.gallery-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-remove-thumbnail {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: rgba(220, 38, 38, 0.9);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    opacity: 0;
    transition: all 0.2s ease;
}

.gallery-item:hover .btn-remove-thumbnail {
    opacity: 1;
}

.btn-remove-thumbnail:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* Large Save Button */
.btn-large {
    padding: 14px 32px;
    font-size: 16px;
}

.btn-large i {
    font-size: 18px;
}

/* Dark theme dashboard */
[data-theme="dark"] .dashboard-container {
    background: #0f172a;
    color: #f1f5f9;
}

[data-theme="dark"] .dashboard-header,
[data-theme="dark"] .dashboard-tabs,
[data-theme="dark"] .dashboard-section,
[data-theme="dark"] .modal-content {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .dashboard-header {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea {
    background: #0f172a;
    color: #f1f5f9;
    border-color: #334155;
}

[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group select:focus,
[data-theme="dark"] .form-group textarea:focus {
    border-color: var(--primary-color);
}

[data-theme="dark"] .info-value {
    background: #0f172a;
    border-color: #334155;
}

[data-theme="dark"] .pins-table thead {
    background: #334155;
}

[data-theme="dark"] .pins-table tbody tr:hover {
    background: #334155;
}

[data-theme="dark"] .company-status-bar {
    background: #1e293b;
}

[data-theme="dark"] .pin-map-picker-container {
    border-color: #334155;
    background: #0f172a;
}

[data-theme="dark"] .pin-location-info {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] #pin-lat-display,
[data-theme="dark"] #pin-lon-display {
    color: #f1f5f9;
}

[data-theme="dark"] .upload-area {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-color: #334155;
}

[data-theme="dark"] .upload-area:hover {
    background: linear-gradient(135deg, #134e4a 0%, #0f172a 100%);
}

[data-theme="dark"] .gallery-item {
    background: #1e293b;
}

/* Contrast theme dashboard */
[data-theme="contrast"] .dashboard-container {
    background: #000000;
    color: #ffffff;
}

[data-theme="contrast"] .dashboard-header {
    background: #000000;
    border-bottom: 2px solid #ffffff;
}

[data-theme="contrast"] .dashboard-brand {
    color: #ffffff;
}

[data-theme="contrast"] .dashboard-brand i {
    color: #ffff00;
}

[data-theme="contrast"] .dashboard-tabs {
    background: #000000;
    border-bottom-color: #ffffff;
}

[data-theme="contrast"] .dashboard-tab {
    background: #000000;
    color: #ffffff;
    border-bottom-color: transparent;
}

[data-theme="contrast"] .dashboard-tab:hover {
    color: #ffff00;
}

[data-theme="contrast"] .dashboard-tab.active {
    color: #ffff00;
    border-bottom-color: #ffff00;
}

[data-theme="contrast"] .dashboard-section {
    background: #000000;
    border: 2px solid #ffffff;
}

[data-theme="contrast"] .company-status-bar {
    background: #000000;
    border: 2px solid #ffffff;
}

[data-theme="contrast"] .company-status-bar label {
    color: #ffffff;
}

[data-theme="contrast"] .company-status-bar .info-value {
    color: #ffff00;
}

[data-theme="contrast"] .form-group input,
[data-theme="contrast"] .form-group select,
[data-theme="contrast"] .form-group textarea {
    background: #000000;
    color: #ffffff;
    border: 2px solid #ffffff;
}

[data-theme="contrast"] .info-value {
    background: #000000;
    border: 2px solid #ffffff;
}

[data-theme="contrast"] .pins-table thead {
    background: #000000;
    border-bottom: 2px solid #ffffff;
}

[data-theme="contrast"] .pins-table th {
    color: #ffffff;
}

[data-theme="contrast"] .pins-table td {
    border-bottom-color: #ffffff;
}

[data-theme="contrast"] .modal-content {
    background: #000000;
    border: 2px solid #ffffff;
}

/* Responsive styles for pin modal */
@media (max-width: 768px) {
    /* Dashboard mobile layout - compact horizontal header */
    .dashboard-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        height: 56px;
        padding: 12px 16px;
        gap: 12px;
        position: sticky;
        top: 0;
        z-index: 100;
    }

    /* Tabs stick right below the header on mobile (header = 56px) */
    .dashboard-tabs {
        position: sticky;
        top: 56px;
        z-index: 99;
    }
    
    .dashboard-brand {
        font-size: 16px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .dashboard-user-info {
        flex-direction: row;
        gap: 8px;
        align-items: center;
        justify-content: flex-end;
        flex: 1;
    }
    
    .user-email {
        font-size: 12px;
        display: none;
    }
    
    .btn-logout {
        padding: 6px 12px;
        font-size: 12px;
        white-space: nowrap;
    }
    
    /* Pin modal: flex sticky-footer — reliable on mobile WebKit */
    .modal-content-large {
        max-width: 100%;
        max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 40px);
        max-height: calc(100svh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 40px);
        display: flex;
        flex-direction: column;
    }

    .pin-form {
        position: relative;
        flex: 1;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .pin-form .form-actions {
        flex-shrink: 0;
        position: sticky;
        bottom: 0;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)) 16px;
        border-top: 2px solid var(--border-color);
        background: white;
        z-index: 101;
        justify-content: stretch;
        gap: 8px;
    }

    .pin-form .form-actions .btn-primary {
        flex: 1;
    }

    /* Single-scroll model on mobile: body scrolls, tab-content flows naturally */
    .dashboard-tab-content {
        max-height: none;
        overflow-y: visible;
        padding-bottom: 80px;
    }
    
    .company-edit-form {
        position: relative;
    }
    
    /* Company edit form: sticky buttons within body-level scroll */
    .company-edit-form .form-actions {
        position: sticky;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)) 16px;
        border-top: 2px solid var(--border-color);
        background: white;
        z-index: 101;
        justify-content: stretch;
        gap: 8px;
    }
    
    .company-edit-form .form-actions .btn-primary {
        flex: 1;
    }
    
    .pin-map-picker {
        height: 200px;
    }
    
    .pin-location-info {
        flex-direction: column;
        gap: 8px;
    }
    
    .location-coords {
        justify-content: space-between;
    }
    
    /* Pins table responsiveness */
    .pins-table-wrapper {
        border-radius: 8px;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .pins-table {
        font-size: 12px;
        min-width: 600px;
    }
    
    .pins-table th,
    .pins-table td {
        padding: 8px 6px;
    }
    
    .pins-table th {
        font-size: 11px;
        white-space: nowrap;
    }
    
    .table-actions {
        gap: 4px;
    }
    
    .table-action-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    /* Responsive layout for description and logo */
    .description-logo-wrapper {
        display: block;
        gap: 0;
    }

    .description-section {
        grid-column: auto;
        margin-bottom: 24px;
    }

    .description-section textarea {
        max-width: 100%;
        width: 100%;
    }

    .logo-section {
        grid-column: auto;
        min-width: 100%;
    }
}

@media (max-width: 600px) {
    .pins-table {
        font-size: 11px;
        min-width: auto;
    }
    
    .pins-table th,
    .pins-table td {
        padding: 6px 4px;
    }
    
    .pins-table th {
        font-size: 10px;
    }
    
    /* Hide columns on mobile: keep only Title and Actions */
    .pins-table th:nth-child(2),
    .pins-table td:nth-child(2),
    .pins-table th:nth-child(3),
    .pins-table td:nth-child(3),
    .pins-table th:nth-child(4),
    .pins-table td:nth-child(4),
    .pins-table th:nth-child(5),
    .pins-table td:nth-child(5) {
        display: none;
    }
    
    .table-actions {
        gap: 24px;
    }
    
    .table-action-btn {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   FULLSCREEN LIGHTBOX GALLERY
   ========================================== */

.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

/* Główny obraz */
.lightbox-image-wrapper {
    position: relative;
    width: 100%;
    height: 85%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.1);
    animation: lightboxImageIn 0.3s ease;
}

@keyframes lightboxImageIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Nawigacja strzałkami */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
    z-index: 10001;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* Licznik zdjęć */
.lightbox-counter {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 8px 16px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    backdrop-filter: blur(8px);
    z-index: 10001;
}

/* Przycisk zamknięcia */
.lightbox-close {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
    z-index: 10001;
    padding: 0;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.1);
}

.lightbox-close:active {
    transform: scale(0.95);
}

/* Panel miniatur u dołu */
.lightbox-thumbs-panel {
    width: 100%;
    height: 15%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    overflow-x: auto;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    backdrop-filter: blur(8px);
}

.lightbox-thumbs-panel::-webkit-scrollbar {
    height: 6px;
}

.lightbox-thumbs-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.lightbox-thumbs-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 3px;
}

.lightbox-thumb {
    min-width: 80px;
    width: 80px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    flex-shrink: 0;
}

.lightbox-thumb:hover {
    opacity: 0.85;
    border-color: rgba(255, 255, 255, 0.4);
}

.lightbox-thumb.active {
    opacity: 1;
    border-color: #e1a202;
    box-shadow: 0 0 12px rgba(52, 199, 89, 0.5);
}

/* Responsywność */
@media (max-width: 768px) {
    .lightbox-overlay {
        padding: 12px;
    }

    .lightbox-nav {
        width: 48px;
        height: 48px;
        font-size: 24px;
    }

    .lightbox-prev {
        left: 12px;
    }

    .lightbox-next {
        right: 12px;
    }

    .lightbox-counter {
        top: 12px;
        right: 12px;
        font-size: 13px;
        padding: 6px 12px;
    }

    .lightbox-close {
        top: 12px;
        left: 12px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .lightbox-thumbs-panel {
        height: 12%;
    }

    .lightbox-thumb {
        min-width: 70px;
        width: 70px;
        height: 52px;
    }
}

@media (max-width: 480px) {
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .lightbox-prev {
        left: 8px;
    }

    .lightbox-next {
        right: 8px;
    }

    .lightbox-thumb {
        min-width: 60px;
        width: 60px;
        height: 45px;
    }
}

/* Pin Description Textarea */
.pin-description-textarea {
    font-size: 16px !important;
    line-height: 1.7 !important;
    color: #333 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
    resize: vertical;
}

/* ============================================
   Legal Documents
   ============================================ */

/* Lift the legal modal above the auth overlay (z-index: 9999) */
#legal-modal {
    z-index: 10000;
}

/* Scrollable legal document content area */
.legal-content {
    max-height: 420px;
    overflow-y: auto;
    white-space: pre-wrap;
    font-size: 14px;
    line-height: 1.7;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-body);
    color: var(--text-main);
    word-break: break-word;
}

/* Document metadata: version + effective date */
.legal-doc-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* Checkbox groups inside the registration form */
.legal-checkbox-group {
    margin-top: 4px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-main);
}

.checkbox-label input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

/* Inline link inside checkbox label (e.g. "przeczytaj regulamin") */
.legal-inline-link {
    color: var(--primary-color);
    text-decoration: underline;
}

.legal-inline-link:hover {
    opacity: 0.8;
}

/* ============================================
   Legal Modal — footer button layout
   ============================================ */

#legal-modal .modal-footer {
    display: flex;
    justify-content: flex-end;
    padding: 16px 24px 24px;
}

#legal-modal .modal-footer .btn-primary,
#legal-modal .modal-footer .btn-secondary {
    min-width: 140px;
}

/* ============================================
   Pricing / Plans Component
   ============================================ */

/* --- Section wrapper --- */
.pricing-section {
    padding: 24px 0 8px;
}

.pricing-section__header {
    text-align: center;
    margin-bottom: 20px;
}

.pricing-section__title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 6px;
}

.pricing-section__subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* --- Cards row --- */
.pricing-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}

/* --- Individual plan card --- */
.plan-card {
    position: relative;
    background: var(--bg-card, #ffffff);
    border: 2px solid var(--border-color, #e5e7eb);
    border-radius: var(--radius-md, 12px);
    padding: 20px;
    flex: 1 1 220px;
    max-width: 300px;
    min-width: 200px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: box-shadow 0.2s;
}

.plan-card:hover {
    box-shadow: var(--shadow-md);
}

.plan-card--highlight {
    border-color: var(--primary-color, #e1a202);
}

/* "Popularne" badge on highlighted card */
.plan-card__badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color, #e1a202);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 999px;
    white-space: nowrap;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* --- Card header (name + pin count) --- */
.plan-card__header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.plan-card__tier {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--text-main);
}

.plan-card__pins {
    font-size: 13px;
    color: var(--primary-color, #e1a202);
    font-weight: 600;
}

.plan-card__pins i {
    margin-right: 4px;
}

/* --- Price row --- */
.plan-card__price-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.plan-card__price {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-main);
}

.plan-card__price-sub {
    font-size: 12px;
    color: var(--text-secondary);
}

/* --- Description text --- */
.plan-card__desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0;
}

/* --- Contact details (email / phone) --- */
.plan-card__contact {
    border-top: 1px solid var(--border-color, #e5e7eb);
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.plan-card__contact-title {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.plan-card__contact-title i {
    color: var(--primary-color, #e1a202);
    width: 14px;
}

.plan-card__contact-title a {
    color: var(--primary-color, #e1a202);
    text-decoration: none;
    word-break: break-all;
}

.plan-card__contact-title a:hover {
    text-decoration: underline;
}

/* --- Payment flow steps --- */
.plan-card__flow {
    background: color-mix(in srgb, var(--primary-color, #e1a202) 8%, transparent);
    border-radius: var(--radius-sm, 8px);
    padding: 10px 12px;
    font-size: 12px;
}

.plan-card__flow-title {
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.plan-card__flow-title i {
    color: var(--primary-color, #e1a202);
}

.plan-card__flow-list {
    padding-left: 18px;
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ─── Blur overlay (logged-out users) ─── */

.plan-blur-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-sm, 8px);
}

.plan-card--blurred {
    filter: blur(5px);
    pointer-events: none;
    user-select: none;
}

.plan-lock-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(2px);
    cursor: pointer;
    text-align: center;
    padding: 12px;
    border-radius: inherit;
}

.plan-lock-overlay__icon {
    font-size: 26px;
    color: var(--accent-color, #002F34);
    opacity: 0.8;
}

.plan-lock-overlay__title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

.plan-lock-overlay__hint {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.plan-lock-overlay__btn {
    margin-top: 4px;
    padding: 7px 18px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 999px;
    cursor: pointer;
    border: none;
    background: var(--primary-color, #e1a202);
    color: #fff;
    transition: opacity 0.2s;
}

.plan-lock-overlay__btn:hover {
    opacity: 0.85;
}

/* ─── Login layout: pricing above, form below ─── */

.auth-login-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 100%;
    max-width: 960px;
    padding: 24px 24px 28px;
    box-sizing: border-box;
}

/* Pricing panel: full width */
.auth-login-layout .auth-pricing-section {
    width: 100%;
    margin: 0;
    padding: 0;
}

.auth-login-layout .pricing-section {
    padding-top: 0;
}

.auth-login-layout .pricing-section__header {
    margin-bottom: 20px;
}

.auth-login-layout .pricing-cards {
    gap: 10px;
    flex-wrap: nowrap;
}

/* Cards equal 1/3 each, compact height */
.auth-login-layout .plan-card {
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
    padding: 12px 14px;
    gap: 6px;
}

.auth-login-layout .plan-card__tier {
    font-size: 14px;
}

.auth-login-layout .plan-card__price {
    font-size: 16px;
}

.auth-login-layout .plan-card__desc {
    font-size: 11px;
    line-height: 1.4;
}

.auth-login-layout .plan-card__contact {
    padding-top: 6px;
}

.auth-login-layout .plan-card__contact-title {
    font-size: 11px;
}

.auth-login-layout .plan-card__pins {
    font-size: 12px;
}

/* Login form: compact, centered */
.auth-login-layout .auth-box {
    flex-shrink: 0;
    width: 100%;
    max-width: 400px;
    padding: 28px 32px;
}

/* Section title/subtitle legible on gradient bg */
.auth-pricing-section .pricing-section__title,
.auth-pricing-section .pricing-section__subtitle {
    color: #ffffff;
}

/* On the login screen hide only the login button inside the lock overlay */
#auth-pricing-container .plan-lock-overlay__btn {
    display: none;
}

/* Mobile/tablet: login form on top, pricing below */
@media (max-width: 900px) {
    .auth-login-layout {
        gap: 16px;
        padding: 16px 12px 20px;
    }

    .auth-login-layout .auth-pricing-section {
        order: 2;
    }

    .auth-login-layout .auth-box {
        order: 1;
        padding: 24px 20px;
    }

    .auth-login-layout .pricing-cards {
        flex-wrap: wrap;
    }

    .auth-login-layout .plan-card {
        flex: 1 1 160px;
    }
}

/* ─── Dashboard pricing section (above dashboard header) ─── */

.dashboard-pricing-section {
    background: linear-gradient(135deg, var(--primary-color, #e1a202), #1e40af);
    padding: 16px 20px;
    margin: 16px 20px;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
}

.dashboard-pricing-section .pricing-section {
    padding: 0;
}

.dashboard-pricing-section .pricing-section__header {
    margin-bottom: 12px;
}

.dashboard-pricing-section .pricing-section__title {
    font-size: 16px;
    color: #ffffff;
}

.dashboard-pricing-section .pricing-section__subtitle {
    font-size: 12px;
    color: rgba(255,255,255,0.8);
}

.dashboard-pricing-section .pricing-cards {
    gap: 12px;
    flex-wrap: nowrap;
}

.dashboard-pricing-section .plan-card {
    flex: 1 1 0;
    width: calc(33.333% - 8px);
    max-width: none;
    min-width: 0;
    padding: 14px 16px;
    gap: 6px;
}

.dashboard-pricing-section .plan-card__tier {
    font-size: 15px;
}

.dashboard-pricing-section .plan-card__price {
    font-size: 17px;
}

.dashboard-pricing-section .plan-card__desc {
    font-size: 11px;
    line-height: 1.45;
}

.dashboard-pricing-section .plan-card__flow {
    font-size: 11px;
    padding: 7px 10px;
}

.dashboard-pricing-section .plan-card__contact-title {
    font-size: 11px;
}

/* ─── Dashboard pricing: desktop/mobile split ─── */

.dashboard-pricing-mobile {
    display: none;
}

.dashboard-pricing-desktop {
    display: block;
}

/* Mobile toggle button */
.dashboard-pricing-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1.5px solid rgba(255,255,255,0.4);
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.dashboard-pricing-toggle:hover {
    background: rgba(255,255,255,0.25);
}

.dashboard-pricing-toggle .fa-chevron-down {
    transition: transform 0.25s;
    font-size: 12px;
}

.dashboard-pricing-toggle .fa-chevron-down.rotated {
    transform: rotate(180deg);
}

/* Pricing modal */
.dashboard-pricing-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10001;
    align-items: flex-end;
    justify-content: center;
}

.dashboard-pricing-modal.open {
    display: flex;
}

.dashboard-pricing-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
}

.dashboard-pricing-modal__box {
    position: relative;
    background: linear-gradient(135deg, var(--primary-color, #e1a202), #1e40af);
    border-radius: 16px 16px 0 0;
    padding: 20px 16px 28px;
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    z-index: 1;
}

.dashboard-pricing-modal__close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dashboard-pricing-modal__close:hover {
    background: rgba(255,255,255,0.35);
}

.dashboard-pricing-modal__box .pricing-section__title,
.dashboard-pricing-modal__box .pricing-section__subtitle {
    color: #ffffff;
}

/* On mobile modal: cards stack vertically */
.dashboard-pricing-modal__box .pricing-cards {
    flex-wrap: wrap;
}

.dashboard-pricing-modal__box .plan-card {
    flex: 1 1 100%;
}

@media (max-width: 768px) {
    .dashboard-pricing-desktop {
        display: none;
    }

    .dashboard-pricing-mobile {
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }

    /* Shrink the gradient bar to just the toggle button */
    .dashboard-pricing-section {
        padding: 10px 16px;
        margin: 8px 12px;
    }

    /* Keep the pricing sheet and close control above the sticky dashboard header. */
    .dashboard-pricing-modal {
        z-index: 10002;
        padding-top: calc(56px + env(safe-area-inset-top, 0px));
    }

    .dashboard-pricing-modal__box {
        max-height: calc(100dvh - 56px - env(safe-area-inset-top, 0px));
        padding-top: calc(60px + env(safe-area-inset-top, 0px));
    }

    .dashboard-pricing-modal__close {
        top: calc(12px + env(safe-area-inset-top, 0px));
        z-index: 2;
    }
}

/* ─── Admin sidebar compact view ─── */

#admin-pricing-section {
    padding: 16px;
    border-bottom: 1px solid #ddd;
    background: #fafafa;
}

#admin-pricing-section .pricing-section__title {
    font-size: 16px;
}

#admin-pricing-section .pricing-section__subtitle {
    font-size: 12px;
}

#admin-pricing-section .pricing-cards {
    flex-direction: column;
    gap: 10px;
}

#admin-pricing-section .plan-card {
    max-width: 100%;
    min-width: 0;
    padding: 14px;
    gap: 8px;
}

#admin-pricing-section .plan-card__price {
    font-size: 18px;
}

#admin-pricing-section .plan-card__tier {
    font-size: 15px;
}

#admin-pricing-section .plan-card__flow {
    font-size: 11px;
    padding: 8px 10px;
}

/* Responsive: on small screens stack auth pricing cards */
@media (max-width: 600px) {
    .auth-pricing-section .pricing-cards {
        flex-direction: column;
        align-items: stretch;
    }

    .auth-pricing-section .plan-card {
        max-width: 100%;
    }
}

/* ============================================ */
/* DSA COMPLAINT FORM STYLES */
/* ============================================ */

/* Report Button Styling */
.listing-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-start;
    padding: 16px 0;
}

#btn-report-dsa {
    /* Dziedziczy ogólne style category-pill, a specyficzne nadpisujemy poniżej, by zgadzały się z życzeniem */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#btn-report-dsa:hover {
    transform: translateY(-2px);
}

#btn-report-dsa:active {
    transform: translateY(0);
}

/* DSA Complaint Form */
.dsa-complaint-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dsa-complaint-form .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.dsa-complaint-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dsa-complaint-form .form-group.full-width {
    grid-column: 1 / -1;
}

.dsa-complaint-form label {
    font-weight: 500;
    color: var(--text-main);
    font-size: 14px;
}

.dsa-complaint-form input,
.dsa-complaint-form select,
.dsa-complaint-form textarea {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.dsa-complaint-form input:focus,
.dsa-complaint-form select:focus,
.dsa-complaint-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(225, 162, 2, 0.1);
}

.dsa-complaint-form textarea {
    resize: vertical;
    min-height: 120px;
    font-family: 'Inter', sans-serif;
}

/* Character Counter */
.char-count {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: normal;
    margin-left: 4px;
}

.char-count.warning {
    color: #f59e0b;
}

.char-count.error {
    color: #dc2626;
}

/* Checkbox Group */
.legal-checkbox-group {
    gap: 8px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-label span {
    font-size: 14px;
    color: var(--text-main);
    line-height: 1.4;
}

.checkbox-label a {
    color: var(--primary-color);
    text-decoration: none;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

/* Form Error Messages */
.dsa-complaint-form .form-error {
    color: #dc2626;
    font-size: 12px;
    display: none;
}

.dsa-complaint-form .form-error:not(:empty) {
    display: block;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

#btn-submit-complaint {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#btn-submit-complaint:hover:not(:disabled) {
    background: #c28502;
    transform: translateY(-2px);
}

#btn-submit-complaint:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner.hidden {
    display: none;
}

/* Responsive: stack form grid on mobile */
@media (max-width: 768px) {
    .dsa-complaint-form .form-grid {
        grid-template-columns: 1fr;
    }
    
    #btn-report-dsa {
        width: 100%;
        justify-content: center;
    }
}
