/* style.css */

/* --- 1. TŁO I CZCIONKA --- */
body { 
    font-family: 'Segoe UI', Verdana, sans-serif; 
    margin: 20px; 
    
    /* ZMIANY TŁA TUTAJ */
    background-image: url('generator_statki.jpeg'); /* Ścieżka do Twojego obrazka */
    background-size: cover;                        /* Skaluje obraz, by pokrył całe tło (może uciąć krawędzie) */
    /* LUB: background-size: contain; (wyświetla cały obraz, może zostawić puste miejsca) */
    background-repeat: no-repeat;                  /* Zapobiega powielaniu się obrazka */
    background-attachment: fixed;                  /* Obrazek jest nieruchomy przy przewijaniu */
    background-position: center center;            /* Centruje obrazek */
    
    background-color: #111 !important;              /* Kolor zastępczy na wypadek, gdy obraz się nie załaduje */
    color: white !important; 
    padding-left: 80px; /* Miejsce na menu boczne */
}

h1, h2, h3, h4 { 
    color: limegreen !important; 
    border-bottom: 1px solid green;
    padding-bottom: 5px;
}

/* --- 2. GŁÓWNE KONTENERY --- */
.container, .result-box { 
    max-width: 900px; 
    margin: 20px auto; 
    background-color: rgba(0,0,0,0.7) !important; /* Ciemne, półprzezroczyste */
    border: 1px solid green !important; 
    padding: 20px !important; 
    border-radius: 8px; 
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.1); 
    color: white !important;
}

/* Specjalne wyróżnienie dla wyników */
.result-box {
    border-left: 5px solid darkgreen !important;
    background-color: rgba(0,0,0,0.1) !important;
}

/* --- 3. SZYBKA NAPRAWA (OVERRIDE) DLA KROKÓW JS --- */
/* To jest kluczowa sekcja! 
   Wymusza przezroczystość na elementach tworzonych przez JS, 
   które mają wpisane "background: #fff" w kodzie.
*/
#drivesContainer > div,
#powerContainer > div,
#fuelContainer > div,
#bridgeContainer > div,
#sensorsContainer > div,
#weaponsContainer > div,
#screensContainer > div,
#systemsContainer > div,
#accomContainer > div,
#softwareContainer > div {
    background-color: transparent !important; /* Usuwa białe tło */
    border: none !important;                  /* Usuwa szarą ramkę z JS */
    color: white !important;                  /* Wymusza biały tekst */
    padding: 0 !important;                    /* Usuwa podwójny padding */
    margin: 0 !important;                     /* Usuwa podwójny margines */
}

/* Naprawa nagłówków wewnątrz kroków JS */
#drivesContainer h3, #powerContainer h3, #fuelContainer h3, 
#bridgeContainer h3, #sensorsContainer h3, #weaponsContainer h3, 
#screensContainer h3, #systemsContainer h3, #accomContainer h3, 
#softwareContainer h3 {
    margin-top: 0 !important;
    color: limegreen !important;
    border-bottom: 1px solid green !important;
}

/* --- 4. FORMULARZE --- */
.input-group, .checkbox-group { 
    margin-bottom: 15px; 
    padding: 10px; 
    background-color: rgba(255,255,255,0.05) !important; 
    border: 1px solid #444 !important; 
    border-radius: 4px; 
}

.row { display: flex; gap: 15px; }
.col { flex: 1; }

label { 
    display: block; 
    margin-bottom: 5px; 
    font-weight: bold; 
    color: #ddd !important;
}

/* --- 5. POLA TEKSTOWE I LISTY (Styl Retro) --- */
input[type="number"], select, input[type="text"] { 
    width: 100%; 
    padding: 8px; 
    box-sizing: border-box; 
    background-color: #444 !important; 
    color: white !important; 
    border: 1px solid limegreen !important; 
    border-radius: 4px; 
    font-family: Verdana, sans-serif;
    text-align: center;
}

input:focus, select:focus {
    background-color: #555 !important;
    border-color: #fff !important;
    outline: none;
    box-shadow: 0 0 5px limegreen;
}

/* --- 6. PRZYCISKI --- */
button, .nav-btn {
    background-color: #333 !important;
    color: white !important;
    border: 1px solid limegreen !important;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 8px 20px;
    font-weight: bold;
}

button:hover, .nav-btn:hover {
    background-color: darkgreen !important;
    color: gold !important;
    border-color: gold !important;
    transform: scale(1.05);
}

/* --- 7. MENU BOCZNE --- */
#side-nav {
    position: fixed;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
    background-color: rgba(0,0,0,0.9);
    padding: 10px;
    border: 1px solid green;
    border-radius: 10px;
}

.nav-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 14px;
    text-decoration: none;
    padding: 0;
}

.nav-btn.active {
    background-color: limegreen !important;
    color: black !important;
    box-shadow: 0 0 10px limegreen;
}

#btnQuickGen {
    background-color: #b35900 !important; /* Pomarańczowy */
    border-color: orange !important;
    font-size: 20px;
}

/* --- 8. OKNO MODALNE --- */
/* To jest właściwe okienko z formularzem */
#generatorModal > div {
    background-color: #1a1a1a !important; /* <--- Zmieniono na !important */
    border: 2px solid limegreen !important; 
    padding: 30px;
    border-radius: 8px;
    width: 400px;
    color: white !important;
    box-shadow: 0 0 30px rgba(0,255,0,0.3);
}

#generatorModal > div {
    background-color: #222;
    border: 2px solid limegreen;
    padding: 30px;
    border-radius: 8px;
    width: 400px;
    color: white;
    box-shadow: 0 0 30px rgba(0,255,0,0.3);
}

#generatorModal h2 { 
    text-align: center; 
    border-bottom: 1px solid gold; 
    color: gold !important; 
    margin-top: 0;
}

/* Ukrywanie komunikatów błędów wewnątrz inputów */
.error { color: #ff5555; }

/* --- 9. TABELE (PODSUMOWANIE) --- */
table {
    width: 100%;
    border-collapse: collapse;
    background-color: rgba(0,0,0,0.3) !important;
    margin-bottom: 10px;
}

th {
    background-color: rgba(0,100,0,0.5) !important; 
    color: gold !important;
    border-bottom: 1px solid limegreen !important;
    padding: 8px;
    text-align: left;
}

td {
    border-bottom: 1px solid #444 !important;
    padding: 8px;
    color: #ddd !important;
}

/* --- 10. DRUKOWANIE --- */
@media print {
    body { background-color: white !important; color: black !important; padding: 0; }
    
    /* Ukryj interfejs */
    #side-nav, #generatorModal, #btnPrint, #btnQuickGen { display: none !important; }
    
    /* Ukryj wszystko poza podsumowaniem */
    body > * { display: none !important; }
    body > #summaryContainerParent { 
        display: block !important; 
        visibility: visible !important;
        position: absolute;
        top: 0;
        left: 0;
        width: 100% !important;
    }

    /* Reset stylów kontenera do druku */
    .container, .result-box { 
        background-color: white !important; 
        color: black !important; 
        border: none !important; 
        box-shadow: none !important; 
        padding: 0 !important;
        margin: 0 !important;
    }
    
    table, th, td { 
        border: 1px solid #000 !important; 
        color: black !important; 
        background: none !important; 
    }
    
    h1, h2, h3 { color: black !important; border-bottom: 1px solid #000 !important; }
    
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}