/* === STYLE PODSTAWOWE === */
body {
    font-size: 13px;
    line-height: 1.4;
    background-color: #f4f4f9;
    margin: 0;
    padding: 10px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
}

.system-header h1 {
    font-size: 1.4em;
    margin: 0 0 15px 0;
    text-align: center;
    color: #2c3e50;
    letter-spacing: 1px;
}

/* === ZAKŁADKI (TABS) === */
.tabs-container {
    display: flex;
    padding-left: 10px;
    margin-bottom: -1px;
    position: relative;
    z-index: 10;
}

.tab-btn {
    padding: 8px 25px;
    background: #dce4ec;
    border: 1px solid #bdc3c7;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    margin-right: 5px;
    cursor: pointer;
    font-weight: bold;
    color: #7f8c8d;
    transition: all 0.2s;
    position: relative;
    top: 1px;
}

.tab-btn:hover {
    background: #ecf0f1;
    color: #3498db;
}

.tab-btn.active {
    background: #fff;
    color: #2c3e50;
    border-bottom: 1px solid #fff;
    z-index: 12;
    padding-bottom: 9px;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.05);
}

/* === GŁÓWNY KONTENER === */
.main-panel {
    background: #fff;
    border: 1px solid #bdc3c7;
    border-radius: 0 4px 4px 4px;
    padding: 15px;
    min-height: 80vh;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: relative;
    z-index: 5;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === FILTRY I UI === */
.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #eee;
    flex-wrap: wrap;
}

.filter-select {
    padding: 5px;
    border: 1px solid #3498db;
    border-radius: 3px;
    background: white;
}

/* === KARTY (PLANET CARDS) === */
.planet-card {
    border-left: 4px solid #ccc;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #eee;
    border-left-width: 4px;
    border-radius: 4px;
}

/* Kolory kategorii */
.hot { border-left-color: #e74c3c; }       /* Walka */
.cold { border-left-color: #3498db; }      /* Hacking */
.habitable { border-left-color: #2ecc71; } /* Społeczne */
.gas { border-left-color: #f39c12; }       /* Magia/Pojazdy */
.neutral { border-left-color: #95a5a6; }   /* Talenty */

/* === TABELE OGÓLNE === */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table td {
    padding: 4px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}

.cost-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    text-align: center;
    line-height: 18px;
    border-radius: 50%;
    background: #eee;
    border: 1px solid #ccc;
    font-size: 11px;
    font-weight: bold;
}

.c-1 { background: #ebf5fb; color: #3498db; border-color: #3498db; }
.c-2 { background: #fcf3cf; color: #f39c12; border-color: #f1c40f; }
.c-3 { background: #fadbd8; color: #c0392b; border-color: #e74c3c; }

/* === TABELA MAGII === */
.magic-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.magic-table th {
    background: #2c3e50;
    color: #fff;
    text-align: left;
    padding: 8px;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.magic-table th.center-header { text-align: center; }

.magic-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

.magic-table tr:nth-child(even) { background-color: #f9fbfd; }
.magic-table tr:hover { background-color: #f1f4f8; }

/* Kostki Trudności */
.dice-container { display: flex; align-items: center; gap: 3px; margin-top: 2px; }
.diff-square {
    width: 14px; height: 14px;
    background-color: #8e44ad;
    border-radius: 2px;
    border: 1px solid #6c3483;
    box-shadow: inset 0 0 2px rgba(255,255,255,0.3);
}
.diff-label { font-size: 11px; color: #666; margin-left: 6px; font-weight: 600; }

/* Grid Dostępności */
.avail-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; text-align: center; color: #777; }
.avail-item span { display: block; font-size: 16px; margin-top: 2px; }
.avail-header { font-weight: bold; color: #7f8c8d; margin-bottom: 2px; font-size: 9px; text-transform: uppercase; white-space: nowrap; }

.magic-desc { line-height: 1.5; }
.magic-desc b { color: #2c3e50; }
.mod-header { color: #c0392b; font-weight: bold; font-size: 11px; display: block; margin-top: 4px; }

/* === TALENTY === */
.talent-header {
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid #eee; padding-bottom: 6px; margin-bottom: 6px;
}
.talent-name { font-weight: bold; color: #2c3e50; font-size: 1.1em; }
.talent-meta { font-size: 0.85em; color: #7f8c8d; }
.talent-desc { font-size: 0.95em; color: #333; padding: 4px 0; line-height: 1.5; }

.talent-example {
    margin-top: 8px;
    background-color: #f8f9fa;
    border-left: 3px solid #f1c40f;
    padding: 8px;
    font-size: 0.9em;
    color: #555;
    border-radius: 0 4px 4px 0;
}
.talent-example strong { color: #d35400; }

.ranked-badge { color: #fff; background: #27ae60; padding: 2px 6px; border-radius: 3px; font-size: 0.75em; text-transform: uppercase; margin-left: 8px; vertical-align: middle; }
.not-ranked { color: #95a5a6; border: 1px solid #bdc3c7; padding: 1px 5px; border-radius: 3px; font-size: 0.75em; text-transform: uppercase; margin-left: 8px; vertical-align: middle; }

.category-header {
    background: #ecf0f1; color: #7f8c8d; padding: 5px 10px; 
    font-weight: bold; font-size: 0.85em; text-transform: uppercase; 
    margin-top: 15px; margin-bottom: 5px; border-radius: 4px; letter-spacing: 1px;
}

.tag-badge { font-size: 0.75em; padding: 1px 4px; border-radius: 3px; margin-left: 5px; text-transform: uppercase; }
.tag-scifi { background: #d6eaf8; color: #2980b9; }
.tag-fantasy { background: #fadbd8; color: #c0392b; }
/* === STYLE EKWIPUNKU I SYSTEMÓW === */

.system-selector-bar {
    padding: 10px;
    background: #ecf0f1;
    border-bottom: 1px solid #bdc3c7;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Lepki pasek z podsumowaniem kosztów */
.total-bar {
    position: sticky;
    top: 0;
    background: #2c3e50;
    color: #fff;
    padding: 10px 15px;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 4px;
    margin-bottom: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    font-size: 1.1em;
}

.total-bar span {
    font-weight: bold;
}

.total-price { color: #f1c40f; } /* Złoty kolor dla ceny */
.total-encum { color: #3498db; } /* Niebieski dla obciążenia */

/* Pola ilości w tabeli */
.qty-input {
    width: 50px;
    padding: 4px;
    text-align: center;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
}

/* Specyficzne dla tabeli ekwipunku */
.inventory-table th {
    background: #34495e;
    color: white;
    padding: 8px;
    text-align: left;
}

.inventory-table td {
    padding: 8px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.item-desc-small {
    display: block;
    font-size: 0.85em;
    color: #7f8c8d;
    margin-top: 2px;
}

/* Grupy w Select */
optgroup {
    font-weight: bold;
    color: #2c3e50;
}

/* === STYLE DLA OKNA KOSZYKA (MODAL) === */

/* Tło przyciemniające */
.modal-overlay {
    display: none; /* Domyślnie ukryte */
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s;
}

/* Białe okno */
.modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* Przycisk zamknięcia (X) */
.close-btn {
    position: absolute;
    top: 10px; right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #e74c3c;
    font-weight: bold;
}

/* Styl przycisku "POKAŻ LISTĘ" */
.cart-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    height: 38px; /* Dopasowanie do selectów */
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}
.cart-btn:hover { background: #219150; }

/* Lista w modalu */
.cart-list-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.cart-list-table th { background: #eee; text-align: left; padding: 8px; border-bottom: 2px solid #ddd; }
.cart-list-table td { padding: 8px; border-bottom: 1px solid #eee; vertical-align: top; }
.cart-desc { font-size: 0.85em; color: #7f8c8d; display: block; margin-top: 3px; font-style: italic; }
.cart-summary { margin-top: 15px; padding-top: 10px; border-top: 2px solid #333; font-weight: bold; text-align: right; font-size: 1.1em; }