/* style.css */

/* Dla przyszłego dynamicznego dodawania elementów */
.excluded-area-item {
    border: 1px solid #c0392b; /* Czerwona ramka */
    padding: 15px;
    margin-bottom: 15px;
    background-color: #fce4e4; /* Jasnoczerwone tło */
    border-radius: 5px;
}
.excluded-area-item h3 {
    margin-top: 0;
    color: #c0392b;
}

/* General Body and Main Layout */
body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
    display: flex; 
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex-grow: 1;
    max-width: 1200px; 
    width: 90%; 
    margin: 20px auto; /* KLUCZ DO CENTROWANIA */
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    box-sizing: border-box; 
}

/* Header */
header {
    background-color: #2c3e50;
    color: #fff;
    padding: 20px 0;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header h1 {
    margin: 0;
    font-size: 2.2em;
    font-weight: 600;
    display: flex; 
    justify-content: center;
    align-items: center;
    gap: 10px; 
}

.pro-tag {
    background-color: #e74c3c;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.6em; 
    font-weight: bold;
    vertical-align: middle; 
}

/* Sections */
section {
    background-color: #fcfcfc;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 25px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

section h2 {
    color: #2980b9;
    font-size: 1.8em;
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

/* Form Styling */
form {
    padding: 0; 
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: bold;
    margin-bottom: 8px;
    color: #555;
    display: block; 
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    width: calc(100% - 20px); 
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s ease;
    box-sizing: border-box; 
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group select:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
}

.help-text {
    font-size: 0.9em;
    color: #777;
    margin-top: 5px;
    font-style: italic;
}

/* Radio Buttons & Checkboxes (General) */
.radio-group, .checkbox-group {
    display: flex;
    flex-wrap: wrap; 
    gap: 15px; 
    align-items: center;
    margin-top: 5px;
    margin-bottom: 15px; 
}

.radio-group input[type="radio"],
.checkbox-group input[type="checkbox"] {
    margin-right: 5px; 
}

.radio-group label,
.checkbox-group label {
    font-weight: normal; 
    margin-bottom: 0; 
    display: inline-flex; 
    align-items: center;
    cursor: pointer;
}

/* Specific for Unit Select Radio Buttons */
.form-group > label[for="unitSelect"] { 
    margin-bottom: 8px; 
}

.form-group .radio-group { 
    justify-content: flex-start; 
    gap: 25px; 
}


/* Cable Method Sections (Generate/Predefined) */
.cable-method-section {
    margin-top: 20px;
    border-top: 1px dashed #ddd;
    padding-top: 20px;
}

.cable-method-section.hidden {
    display: none;
}

/* Wall Offsets Fieldset */
fieldset.wall-offsets {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

fieldset.wall-offsets legend {
    font-weight: bold;
    color: #2980b9;
    padding: 0 10px;
    font-size: 1.1em;
}

.wall-offset-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    gap: 15px;
    margin-top: 10px;
}

.wall-offset-inputs .form-group {
    margin-bottom: 0; 
}

/* Cable Identification Details */
fieldset#cable-identification-details {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    margin-top: 25px;
    margin-bottom: 20px;
}

fieldset#cable-identification-details legend {
    font-weight: bold;
    color: #2980b9;
    padding: 0 10px;
    font-size: 1.1em;
}


/* Buttons */
.form-actions {
    text-align: center;
    margin-top: 30px;
}

button {
    background-color: #27ae60; /* Zmieniono na zielony */
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin: 5px; 
}

button:hover {
    background-color: #229954; /* Ciemniejszy zielony na hover */
    transform: translateY(-2px);
}

button:active {
    background-color: #1e8449; /* Jeszcze ciemniejszy zielony na active */
    transform: translateY(0);
}

/* Error Message */
.error-message {
    color: #e74c3c;
    background-color: #fbecec;
    border: 1px solid #e74c3c;
    padding: 10px 15px;
    border-radius: 5px;
    margin-top: 20px;
    text-align: center;
    font-weight: bold;
    display: none; 
}

/* Results Section */
#results p {
    font-size: 1.1em;
    margin-bottom: 10px;
}

#results p span {
    font-weight: bold;
    color: #27ae60;
}

/* Canvas for Plan */
#planCanvas {
    display: block;
    width: 100%; 
    height: 500px; 
    max-width: 800px; 
    border: 2px solid #3498db; 
    background-color: #ffffff; 
    margin: 20px auto; 
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); 
}

.plan-actions {
    text-align: center;
    margin-top: 20px;
}

/* Footer */
footer {
    background-color: #2c3e50;
    color: #fff;
    text-align: center;
    padding: 15px 0;
    margin-top: 30px;
    font-size: 0.9em;
}

/* Responsive Design */
@media (max-width: 768px) {
    main {
        margin: 10px;
        padding: 15px;
    }

    header h1 {
        font-size: 1.8em;
    }

    section h2 {
        font-size: 1.5em;
    }

    .form-group input[type="text"],
    .form-group input[type="number"],
    .form-group select {
        width: 100%; 
    }

    .wall-offset-inputs {
        grid-template-columns: 1fr; 
    }

    button {
        padding: 10px 20px;
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5em;
    }
    .pro-tag {
        font-size: 0.5em;
    }
    section {
        padding: 15px;
    }
    button {
        display: block; 
        width: calc(100% - 10px); 
        margin: 5px auto;
    }
}
