/* =========================================
   1. GLOBAL BASE & RESET (Baseline: index.html)
   ========================================= */
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    min-height: 100vh;
    font-family: 'Rajdhani', sans-serif;
    background-color: #0b0f19;
    color: #e2e8f0;
    letter-spacing: 0.5px;
    overflow-x: hidden;
}

/* Standard map view overflow handling */
body.map-view, html.map-view {
    overflow: hidden;
}

/* Subpage Grid Background Pattern (ToS & Twórcy) */
.bg-grid-pattern {
    background-image:
        linear-gradient(rgba(17, 24, 39, 0.9), rgba(11, 15, 25, 0.95)),
        linear-gradient(#1f2937 1px, transparent 1px),
        linear-gradient(90deg, #1f2937 1px, transparent 1px);
    background-size: 100% 100%, 40px 40px, 40px 40px;
}

#map {
    height: 100vh;
    width: 100%;
    transition: width 0.3s ease;
    background-color: #0b0f19;
}

/* =========================================
   2. NAVIGATION & HEADERS
   ========================================= */
#top-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 90px;
    background: linear-gradient(to bottom, rgba(11, 15, 25, 0.95) 0%, rgba(11, 15, 25, 0.5) 60%, rgba(11, 15, 25, 0) 100%);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 15px 30px;
    box-sizing: border-box;
    pointer-events: none;
}

.header-title {
    color: #e2e8f0;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 2px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-title::before {
    content: "●";
    color: #003cff;
    font-size: 14px;
    animation: blink 2s infinite;
    text-shadow: 0 0 10px rgba(255, 171, 0, 0.8);
}

.header-clocks {
    display: flex;
    gap: 25px;
    font-family: 'Roboto Mono', monospace;
    font-size: 15px;
    font-weight: 500;
    background: rgba(17, 24, 39, 0.6);
    padding: 6px 15px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
}

.clock-label {
    color: #6b7280;
    font-size: 12px;
    margin-right: 6px;
}

.top-nav {
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 229, 255, 0.2);
    background: rgba(11, 15, 25, 0.8);
    backdrop-filter: blur(5px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #00e5ff;
    color: #00e5ff;
    text-decoration: none;
    font-family: 'Roboto Mono', monospace;
    font-size: 14px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-back:hover {
    background: #00e5ff;
    color: #0b0f19;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.4);
}

/* =========================================
   3. SIDEBAR PANEL
   ========================================= */
#sidebar {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    height: 100vh;
    height: 100dvh;
    background: linear-gradient(145deg, rgba(17, 24, 39, 0.95) 0%, rgba(11, 15, 25, 0.85) 100%);
    backdrop-filter: blur(8px);
    border-left: 1px solid rgba(255,255,255,0.05);
    box-shadow: -10px 0 30px rgba(0,0,0,0.6);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
    padding: 25px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

#sidebar.open { right: 0; }

.close-btn {
    align-self: flex-end;
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    line-height: 1;
    transition: color 0.2s, transform 0.2s;
}

.close-btn:hover {
    color: #f8fafc;
    transform: scale(1.1);
}

#sidebar-content {
    overflow-y: auto;
    flex-grow: 1;
    padding-top: 10px;
    padding-bottom: 40px;
}

.hex-title {
    font-size: 16px;
    margin: 0 0 15px 0;
    color: #f8fafc;
    font-weight: 700;
    text-transform: uppercase;
    border-bottom: 1px solid #1f2937;
    padding-bottom: 15px;
}

.hex-data-table {
    border-collapse: collapse;
    width: 100%;
    margin-top: 15px;
}

.hex-data-table th {
    text-align: left;
    padding: 0 0 12px 0;
    font-size: 13px;
    border-bottom: 2px solid #374151;
    text-transform: uppercase;
    color: #9ca3af;
    letter-spacing: 1px;
}

.hex-data-table td {
    padding: 18px 6px;
    font-size: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    vertical-align: top;
    line-height: 1.6;
}

.hex-data-table td.label-cell {
    font-weight: 600;
    color: #fefefe;
    width: 50%;
}

.label-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.label-icon {
    width: 18px;
    height: 18px;
    opacity: 0.7;
    flex-shrink: 0;
}

.hex-data-table td.val {
    font-family: 'Roboto Mono', monospace;
    font-size: 13px;
    text-align: left;
    padding-bottom: 6px;
}

.hex-data-table td.time {
    font-family: 'Roboto Mono', monospace;
    font-size: 11px;
    color: #4b5563;
    margin-top: 4px;
    display: block;
}

.disclaimer {
    font-size: 11px;
    color: rgba(254, 254, 254, 0.76);
    text-align: center;
    margin-top: 35px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.05);
    line-height: 1.5;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =========================================
   4. MAP CONTROLS & OVERLAYS (Leaflet)
   ========================================= */
.leaflet-top { top: 60px !important; }

/* Location Control */
.leaflet-control-locate {
    background-color: rgba(17, 24, 39, 0.9);
    border: 1px solid #00e5ff;
    border-radius: 4px;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 22px;
    color: #00e5ff;
    backdrop-filter: blur(4px);
    transition: all 0.2s;
    margin-left: 15px !important;
    margin-top: 15px !important;
    box-sizing: border-box;
}

.leaflet-control-locate:hover { background-color: #1f2937; color: #fff; }
.leaflet-control-locate.loading { animation: pulse 1s infinite alternate; }

/* Search Control */
.leaflet-control-search {
    position: relative;
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    box-sizing: border-box;
    margin-left: 15px !important;
    margin-top: 15px !important;
}

.leaflet-control-search:not(.collapsed) {
    width: 400px;
    border: 2px solid #00e5ff;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.2);
}

.leaflet-control-search.collapsed {
    width: 50px;
    height: 50px;
    border: 1px solid #00e5ff;
    border-radius: 4px;
    cursor: pointer;
    justify-content: center;
    align-items: center;
}

.leaflet-control-search.collapsed:hover { background-color: #1f2937; }

.search-toggle-icon { display: none; color: #00e5ff; }
.leaflet-control-search.collapsed .search-toggle-icon { display: block; }
.search-input-wrapper { display: flex; align-items: center; padding: 0 15px; width: 100%; box-sizing: border-box; }
.leaflet-control-search.collapsed .search-input-wrapper { display: none; }
.leaflet-control-search.collapsed .search-results-dropdown { display: none !important; }

.search-icon { color: #00e5ff; width: 22px; height: 22px; margin-right: 12px; flex-shrink: 0; }

#photon-input {
    width: 100%; background: transparent; border: none; color: #ffffff; padding: 16px 0;
    font-family: 'Rajdhani', sans-serif; font-size: 16px; font-weight: 600; outline: none;
}
#photon-input::placeholder { color: #9ca3af; font-weight: 500; font-style: italic; }

.btn-search-close {
    background: none; border: none; color: #9ca3af; font-size: 24px; cursor: pointer;
    padding: 0; margin-left: 10px; transition: color 0.2s; line-height: 1;
}
.btn-search-close:hover { color: #00e5ff; }

.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: -2px;
    width: calc(100% + 4px);
    background: rgba(17, 24, 39, 0.98);
    border: 2px solid #00e5ff;
    border-top: 1px solid #374151;
    border-radius: 0 0 8px 8px;
    max-height: 280px;
    overflow-y: auto;
    display: none;
    box-sizing: border-box;
    box-shadow: 0 10px 30px rgba(0,0,0,0.7);
}

.search-result-item {
    padding: 14px 18px; font-size: 14px; color: #9ca3af; cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.05); transition: all 0.2s; line-height: 1.4;
}
.search-result-item:hover { background: #1f2937; color: #00e5ff; padding-left: 22px; }
.search-result-item:last-child { border-bottom: none; }
.search-result-item .search-name { font-weight: 700; color: #e2e8f0; display: block; font-size: 15px; }
.search-result-item .search-context { font-size: 12px; }

/* Layer Controls */
#layer-controls {
    background: rgba(17, 24, 39, 0.95);
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
    overflow: hidden;
    box-sizing: border-box;
    margin-top: 100px !important;
    margin-right: 30px !important;
}

#layer-controls:not(.collapsed) { padding: 15px 20px; width: 270px; }

#layer-controls.collapsed {
    width: 50px; height: 50px; padding: 0; cursor: pointer; display: flex;
    justify-content: center; align-items: center; border: 2px solid #00e5ff;
}
#layer-controls.collapsed:hover { background-color: #1f2937; }

#layer-toggle-icon { display: none; color: #00e5ff; }
#layer-controls.collapsed #layer-toggle-icon { display: block; }
#layer-controls.collapsed #layer-content { display: none; }

.layer-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; border-bottom: 1px solid #374151; padding-bottom: 5px; }
.layer-header h4 { margin: 0; color: #f8fafc; text-transform: uppercase; font-size: 14px; letter-spacing: 1px; }

.btn-minimize { background: none; border: none; color: #9ca3af; font-size: 24px; cursor: pointer; padding: 0; line-height: 1; margin-top: -4px; transition: color 0.2s; }
.btn-minimize:hover { color: #00e5ff; }

/* Zoom Control */
.leaflet-control-zoom {
    margin-left: 15px !important;
    margin-top: 15px !important;
    border: none !important;
    box-shadow: none !important;
}

.leaflet-control-zoom a {
    background-color: rgba(17, 24, 39, 0.9) !important;
    width: 40px !important;
    height: 40px !important;
    font-size: 24px !important;
    font-weight: 600 !important;
    color: #00e5ff !important;
    backdrop-filter: blur(4px);
    transition: all 0.2s;
    display: flex !important;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    margin-bottom: 0 !important;
    border-left: 1px solid #00e5ff !important;
    border-right: 1px solid #00e5ff !important;
}

.leaflet-control-zoom a:hover {
    background-color: #1f2937 !important;
    color: #ffffff !important;
}

.leaflet-control-zoom-in {
    border-top: 1px solid #00e5ff !important;
    border-bottom: 1px solid rgba(0, 229, 255, 0.3) !important;
    border-radius: 4px 4px 0 0 !important;
}

.leaflet-control-zoom-out {
    border-bottom: 1px solid #00e5ff !important;
    border-top: none !important;
    border-radius: 0 0 4px 4px !important;
}

/* =========================================
   5. CONTENT PAGES & LAYOUT CONTAINERS
   ========================================= */
.container {
    max-width: 800px;
    margin: 40px auto;
    padding: 40px;
    background: linear-gradient(145deg, rgba(17, 24, 39, 0.95) 0%, rgba(11, 15, 25, 0.95) 100%);
    border: 1px solid #374151;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
}

.page-header {
    text-align: center;
    margin-top: 120px;
    padding: 0 20px;
}

.page-title {
    font-size: 42px;
    color: #f8fafc;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(0, 229, 255, 0.3);
}

.page-subtitle {
    color: #9ca3af;
    font-size: 18px;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.5;
    font-family: 'Roboto Mono', monospace;
}

h1 {
    color: #ffffff;
    font-size: 32px;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 0;
    padding-bottom: 20px;
    border-bottom: 1px solid #374151;
    display: flex;
    align-items: center;
    gap: 15px;
}

.tos-page h1::before {
    content: "§";
    color: #ffab00;
    font-family: 'Roboto Mono', monospace;
}

.creators-page h1::before {
    content: "</>";
    color: #00e5ff;
    font-family: 'Roboto Mono', monospace;
    font-size: 22px;
}

h2 {
    color: #00e5ff;
    font-family: 'Roboto Mono', monospace;
    font-size: 18px;
    margin-top: 40px;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

p, li {
    font-size: 16px;
    line-height: 1.8;
    color: #9ca3af;
    margin-bottom: 15px;
}

.creators-page p {
    font-size: 18px;
    margin-bottom: 25px;
    text-align: justify;
}

ul { padding-left: 20px; }
li { margin-bottom: 8px; }
strong { color: #e2e8f0; font-weight: 600; }

.last-updated {
    font-family: 'Roboto Mono', monospace;
    font-size: 12px;
    color: #6b7280;
    text-align: right;
    margin-bottom: 30px;
}

/* FAQ Section (ToS) */
.faq-section {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px dashed #4b5563;
}

.faq-placeholder {
    padding: 20px;
    background: rgba(255, 171, 0, 0.05);
    border-left: 4px solid #ffab00;
    font-style: italic;
    color: #6b7280;
}

/* Partner Cards (Creators) */
.partner-cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 40px;
}

.card {
    background: rgba(31, 41, 55, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 20px;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: rgba(0, 229, 255, 0.3);
    background: rgba(31, 41, 55, 0.6);
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 10px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-link {
    font-family: 'Roboto Mono', monospace;
    font-size: 13px;
    color: #00e5ff;
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 229, 255, 0.2);
    padding-bottom: 2px;
    transition: all 0.2s;
}

.card-link:hover {
    color: #ffffff;
    border-color: #ffffff;
}

.badge-tech {
    font-family: 'Roboto Mono', monospace;
    font-size: 11px;
    background: rgba(255, 171, 0, 0.1);
    color: #ffab00;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 171, 0, 0.2);
}

/* =========================================
   6. PRICING & OFFER CARDS
   ========================================= */
.pricing-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    padding: 50px 20px 100px;
    max-width: 1300px;
    margin: 0 auto;
}

.offer-card {
    background: linear-gradient(145deg, rgba(17, 24, 39, 0.95) 0%, rgba(11, 15, 25, 0.85) 100%);
    border: 1px solid rgba(0, 229, 255, 0.3);
    border-top: 4px solid #00e5ff;
    border-radius: 8px;
    width: 360px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(8px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.offer-card:not(.inactive):hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 229, 255, 0.15);
}

.offer-card.premium {
    border-top: 4px solid #ffab00;
    border-color: rgba(255, 171, 0, 0.3);
}

.offer-card.enterprise {
    border-top: 4px solid #e11d48;
    border-color: rgba(225, 29, 72, 0.3);
}

.offer-card.inactive {
    opacity: 0.35;
    pointer-events: none;
}

.offer-card.inactive .offer-features,
.offer-card.inactive .offer-price {
    filter: blur(3px);
    user-select: none;
}

.offer-title {
    font-size: 26px;
    font-weight: 700;
    text-transform: uppercase;
    color: #f8fafc;
    margin: 0 0 15px 0;
    border-bottom: 1px solid #1f2937;
    padding-bottom: 15px;
}

.offer-price {
    font-family: 'Roboto Mono', monospace;
    font-size: 32px;
    font-weight: 700;
    color: #00e5ff;
    margin: 20px 0;
    display: flex;
    align-items: baseline;
    gap: 5px;
    transition: filter 0.3s;
}

.offer-price span {
    font-size: 16px;
    color: #6b7280;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
}

.premium .offer-price { color: #ffab00; }
.enterprise .offer-price { color: #e11d48; }

.offer-features {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
    transition: filter 0.3s;
}

.offer-features li {
    padding: 12px 0;
    font-size: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    line-height: 1.5;
    color: #d1d5db;
}

.offer-features li:last-child { border-bottom: none; }

.offer-features li::before {
    content: "▸";
    color: #00e5ff;
    font-weight: bold;
    font-size: 18px;
    line-height: 1;
    margin-top: 2px;
}

.premium .offer-features li::before { color: #ffab00; }
.enterprise .offer-features li::before { color: #e11d48; }

.btn-contact {
    margin-top: 25px;
    padding: 12px 0;
    width: 100%;
    background: transparent;
    border: 1px solid #00e5ff;
    color: #00e5ff;
    font-family: 'Rajdhani', sans-serif;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.btn-contact:not(:disabled):hover {
    background: rgba(0, 229, 255, 0.1);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.3);
}

.premium .btn-contact { border-color: #ffab00; color: #ffab00; }
.enterprise .btn-contact { border-color: #e11d48; color: #e11d48; }

.btn-contact:disabled {
    border-color: #4b5563;
    color: #4b5563;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.02);
    filter: none !important;
}

/* =========================================
   7. UTILITY & TEXT CLASSES
   ========================================= */
.text-danger { color: #ffab00; font-weight: 700; text-shadow: 0 0 8px rgba(255, 171, 0, 0.4); }
.text-safe { color: #00e5ff; text-shadow: 0 0 8px rgba(0, 229, 255, 0.4); }
.text-muted { color: #6b7280; }
.text-highlight { color: #ffffff; font-family: 'Roboto Mono', monospace; font-size: 14px; }
.highlight-warning { color: #ffab00; font-weight: 700; }

/* =========================================
   8. ANIMATIONS
   ========================================= */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes pulse {
    0% { background-color: rgba(17, 24, 39, 0.9); }
    100% { background-color: #374151; }
}

/* =========================================
   9. RESPONSIVE BREAKPOINTS
   ========================================= */
@media (max-width: 768px) {
    #sidebar {
        width: 100%;
        right: -100%;
        padding-bottom: env(safe-area-inset-bottom, 25px);
    }
    #sidebar.open { right: 0; }
    .header-title { font-size: 14px; }
    .header-clocks { flex-direction: column; gap: 5px; font-size: 12px; }

    .leaflet-control-search:not(.collapsed) { width: calc(100vw - 80px); }

    #layer-controls { margin-top: 90px !important; margin-right: 15px !important; }
    #layer-controls:not(.collapsed) { width: calc(100vw - 30px); }

    .pricing-container { flex-direction: column; align-items: center; }
    .offer-card { width: 100%; max-width: 400px; box-sizing: border-box; }
    .page-title { font-size: 32px; }

    .container { margin: 20px; padding: 20px; }
    h1 { font-size: 24px; }
    .top-nav { padding: 15px 20px; }
}
