

/* === FEATURE TABLE === */
.feature-table-container {
    position: fixed;
    background: #152a47;
    color: #e2e8f0;
    
    /* FORCED CENTERING */
    bottom: 20px;
    
    width: 90vw;
    max-width: 1400px;
    max-height: 100vh;
    
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    z-index: 990;
    border-radius: 8px;
    overflow: hidden;
    
    display: none;
    flex-direction: column;
    
    transition: transform 0.3s ease, width 0.3s ease;
}

.feature-table-container.active {
    display: flex;
}

.feature-table-container.dragging {
    transition: none;
}

/* === HEADER TABELI === */
.feature-table-header {
    padding: 10px 20px;
    background: #1a305a;
    border-bottom: 1px solid #203759;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1;
    cursor: move;
    user-select: none;
    flex-shrink: 0;
}

.feature-table-title {
    font-size: 1.1em;
    color: #6b9fff;
    font-weight: 500;
}

.feature-table-close {
    background: none;
    border: none;
    color: #e2e8f0;
    cursor: pointer;
    font-size: 20px;
    padding: 0 10px;
    z-index: 2;
    position: relative;
}

.feature-table-close:hover {
    color: #f87171;
}

/* === PRZYCISKI EXPORT === */
.export-buttons {
    display: flex;
    gap: 10px;
    margin-right: 20px;
}

.export-btn {
    background: #3b6ef6;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9em;
    transition: background-color 0.2s;
}

.export-btn:hover {
    background: #184bb8;
}

.show-all-btn {
    background: #3b6ef6;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9em;
    transition: background-color 0.2s;
}

.show-all-btn:hover {
    background: #184bb8;
}

/* === TABLE WRAPPER (with sliders) === */
.table-wrapper {
    flex: 1;
    overflow: auto;
    margin: 0;
}

.table-wrapper::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: #1a305a;
    border-radius: 6px;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: #3b6ef6;
    border-radius: 6px;
    border: 2px solid #1a305a;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #184bb8;
}

.table-wrapper::-webkit-scrollbar-corner {
    background: #1a305a;
}

.table-wrapper {
    scrollbar-width: auto;
    scrollbar-color: #3b6ef6 #1a305a;
}

/* === TABLE === */
.feature-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
    table-layout: auto;
}

.feature-table th,
.feature-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #203759;
    font-size: 0.9em;
    white-space: nowrap;
}

.feature-table th {
    background: #1a305a;
    color: #6b9fff;
    font-weight: 500;
    position: sticky;
    top: 0;
    z-index: 10;
}

.feature-table tr:hover {
    background: #1a305a;
}

.feature-table-title {
    font-size: 1.1em;
    color: #6b9fff;
    font-weight: 500;
}

.feature-table-close {
    background: none;
    border: none;
    color: #e2e8f0;
    cursor: pointer;
    font-size: 20px;
    padding: 0 10px;
    z-index: 2;
    position: relative;
}

.feature-table-close:hover {
    color: #f87171;
}

.export-buttons {
    display: flex;
    gap: 10px;
    margin-right: 20px;
}

.export-btn {
    background: #3b6ef6;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9em;
    transition: background-color 0.2s;
}

.export-btn:hover {
    background: #184bb8;
}

.tab-button {
    padding: 12px 20px;
    color: #94a3b8;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.tab-button:hover {
    color: #e2e8f0;
}

.tab-button.active {
    color: #60a5fa;
    border-bottom-color: #3b82f6;
}

.feature-table .link-button {
    background: #1e58d7;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.8em;
    display: inline-block;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.feature-table .link-button:hover {
    background: #184bb8;
}

.feature-table td.no-data {
    color: #a3b8da;
    font-style: italic;
}

.feature-table-container th:last-child,
.feature-table-container td:last-child {
    width: 120px;
    text-align: center;
}

.link-button {
    width: 40%;
}

.add-collaborator-button {
    width: 100%;
}

.feature-table-container button {
    min-width: 30px;
    padding: 4px 8px;
    margin: 0 2px;
}

/* === NAVIGATION TABS === */
.table-navigation-tabs {
    display: flex;
    background-color: #1a305a;
    border-bottom: 1px solid #203759;
    overflow-x: auto;
    white-space: nowrap;
    padding: 0; /* USUNIĘTY PADDING */
    flex-shrink: 0;
}

.tab-button {
    padding: 12px 20px;
    color: #94a3b8;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.tab-button:hover {
    color: #e2e8f0;
}

.tab-button.active {
    color: #60a5fa;
    border-bottom-color: #3b82f6;
}

/* === TOGGLE SWITCHES === */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #2d3748;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #3b82f6;
}

input:focus + .slider {
    box-shadow: 0 0 1px #3b82f6;
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

.visibility-toggle {
    display: flex;
    align-items: center;
}

.visibility-label {
    margin-left: 10px;
    font-size: 0.85em;
    color: #94a3b8;
}

/* === LOADING INDICATOR === */
.map-loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(21, 42, 71, 0.9);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1500;
    display: none;
    flex-direction: column;
    align-items: center;
    color: white;
}

.spinner {
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #3b82f6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 14px;
    color: #e2e8f0;
}

/* Dodaj do pliku tables.css */

.button-container {
    padding: 20px;
    border-top: 1px solid #203759;
    background: #1a305a;
    flex-shrink: 0;
}

.save-button {
    width: 100%;
    background: #3b6ef6;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.2s;
}

.save-button:hover {
    background: #184bb8;
}

/* === RESPONSYWNOŚĆ I RESIZE === */

/* Płynne przejścia podczas resize */
.feature-table-container {
    transition: transform 0.3s ease, width 0.3s ease, left 0.3s ease, top 0.3s ease;
}

/* Wyłącz przejścia podczas przeciągania */
.feature-table-container.dragging {
    transition: none !important;
}

/* Zapewnienie że tabela nigdy nie wyjdzie poza ekran podczas resize */
.feature-table-container.active {
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 40px);
}

/* Specjalne zachowanie podczas resize w trybie edycji */
.feature-table-container.edit-mode {
    max-width: calc(100vw - 420px); /* 400px panel + 20px margines */
}

@media (max-width: 1024px) {
    .feature-table-container.edit-mode {
        max-width: calc(100vw - 40px);
    }
}

@media (max-width: 768px) {
    .feature-table-container.active {
        width: calc(100vw - 20px) !important;
        left: 10px !important;
        max-height: calc(100vh - 40px);
    }
}

@media (max-width: 480px) {
    .feature-table-container.active {
        width: calc(100vw - 10px) !important;
        left: 5px !important;
        max-height: calc(100vh - 20px);
        top: 10px !important;
        bottom: 10px !important;
    }
}

/* === RESPONSIVITY === */
@media (max-width: 768px) {
    .feature-table-container {
        width: 95vw;
        height: 85vh;
    }
    
    .feature-table th,
    .feature-table td {
        padding: 6px 8px;
        font-size: 0.8em;
    }
    
    .table-wrapper {
        margin: 0 10px 10px 10px;
    }
    
    /* Lepszy close button na tabletach */
    .feature-table-close {
        font-size: 24px;
        padding: 5px 15px;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Zmniejsz export buttons żeby zrobić miejsce */
    .export-btn {
        padding: 6px 10px;
        font-size: 0.8em;
    }
    
    .feature-table-header {
        padding: 8px 15px;
    }
}

@media (max-width: 480px) {
    .feature-table-container {
        width: 98vw;
        height: 90vh;
    }
    
    .feature-table th,
    .feature-table td {
        padding: 4px 6px;
        font-size: 0.75em;
    }
    
    .table-wrapper {
        margin: 0 5px 5px 5px;
    }
    
    /* Duży, łatwy do kliknięcia close button na telefonach */
    .feature-table-close {
        font-size: 28px;
        padding: 8px;
        min-width: 48px;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(239, 68, 68, 0.1);
        border-radius: 4px;
        margin-left: 10px;
    }
    
    .feature-table-close:hover {
        background: rgba(239, 68, 68, 0.2);
        color: #fca5a5;
    }
    
    /* Reorganizuj header na małych ekranach */
    .feature-table-header {
        padding: 10px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .feature-table-title {
        font-size: 1em;
        flex: 1;
        min-width: 200px;
    }
    
    .export-buttons {
        margin-right: 0;
        order: 3;
        width: 100%;
        justify-content: space-between;
    }
    
    .export-btn {
        flex: 1;
        padding: 8px 4px;
        font-size: 0.75em;
        margin: 0 2px;
    }
    
    .feature-table-close {
        order: 2;
        flex-shrink: 0;
    }
}