/* ------------------------------------------------------------------- */
/* Ogólne style dla headera */

.view {
  display: contents;
  height: auto;
}


body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background-color: #f4f4f4;
}

.header {
    background-color: rgb(0, 0, 0);
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    width: calc(100% - 40px);
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.header .logo img {
    height: 30px;
    width: auto;
}

.buttons {
    display: flex;
    gap: 10px;
}

.header button {
    background-color: rgb(222, 144, 0);
    color: white;
    border: none;
    padding: 7px 10px;
    cursor: pointer;
    font-size: 14px;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.header button:hover {
    background-color: rgb(171, 113, 4);
}

/* Przycisk menu (domyślnie ukryty na dużych ekranach) */
.menu-toggle {
    display: none;
    background-color: rgb(222, 144, 0);
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 16px;
    border-radius: 5px;
    font-weight: bold;
}

/* Kontener dla "designer" i "parametry" */
main {
    display: flex;
    flex-direction: row;
    min-height: calc(100vh - 60px); /* 🔑 zamiast height */
    height: auto;                  /* 🔑 */
}

.designer,
.parametry {
    background-color: white;
    border: 1px solid #ccc;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* Designer - główny obszar */
.designer {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    width: 70%;
    margin: 10px;
    min-height: 0;   /* 🔑 BARDZO WAŻNE */
    overflow: hidden;
}

/* Parametry - boczny panel */
.parametry {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    width: 30%;
    height: auto;        /* 🔑 */
    max-height: none;    /* 🔑 */
    margin: 10px;
}



/* wyłączenie dolnego menu na duych ekranach */
#bottomNav {
  display: none;
}





/* ------------------------------------------------------------------- */
/* Projekt (SVG) */
#rysunek {
    width: 100%;
    height: 100%;
    min-height: 0;      /* 🔑 */
    background: #ddd;
    overflow: visible;
}

#rysunekSvg {
    width: 100%;
    height: 100%;
    display: block;
}

#komunikat {
    font-size: 16px;
    color: red;
    text-align: center;
}

/* Domyślne style dla elementów ramy */
#rysunekSvg path {
    stroke: black;
    stroke-width: 1px;
}

/* Parametry */
.parametry label {
    display: block;
    margin-bottom: 10px;
    font-size: 16px;
}

.parametry input[type="number"],
.parametry select {
    width: 100%;
    padding: 1px;
    margin-top: 2px;
    margin-bottom: 3px;
    font-size: 14px;
}

.parametry button {
    background-color: rgb(222, 144, 0);
    color: white;
    border: 1px;
    padding: 4px;
    cursor: pointer;
    font-size: 14px;
    /* font-weight: bold; */
    border-radius: 3px;
    margin: 4px;
    
}

.parametry button:hover {
    background-color: orange;
}

.parametry p {
    font-size: 14px;
    margin-top: 5px;
    margin-bottom: 3px;
    font-weight: bold;
}

.parametry p span {
    font-weight: bold;
}

/* Menu kontekstowe */
#menu, #elementMenu {
    position: absolute;
    display: none;
    background-color: #fff;
    border: 1px solid #ccc;
    padding: 3px;
    margin: 3px;
    font-size: 8px;
    z-index: 300;
}

.menu button, .elementMenu button {
    display: block;
    background-color: rgb(222, 144, 0);
    color: white;
    cursor: pointer;
    width: 90%;
 
}

.elementMenu button:hover {
    background-color: #555;
}

/* Stopka */
.footer {
    background-color: black;
    color: white;
    text-align: center;
    padding: 10px;
    font-size: 14px;
    width: 100%;
    margin: auto;
}

/* --------------------adminPanel---------------------------------- */

#crudSection {
    display: none;
}



/* Styl dla kontenera dataTable -  lista elementów*/
/* Styl dla sekcji #crudSection */
#crudSection,
#produkcjaSection,
#ofertySection {
    background-color: #ffffff;
    border: 1px solid #ccc;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin: 10px;
    width: 100%;
    /* overflow-x: auto */; /* Przewijanie w poziomie na małych ekranach */
}





/* OFERTY – identyczny układ jak BAZA DANYCH */
#ofertyControls {
    display: flex;
    justify-content: flex-end; /* wyszukiwarka po prawej */
    align-items: center;
    margin-bottom: 15px;
}

#ofertySearch {
    width: 50%;
    padding: 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* PRODUKCJA – wyszukiwarka jak w CRUD */
#produkcjaControls {
    display: flex;
    justify-content: flex-end; /* po prawej */
    align-items: center;
    margin-bottom: 15px;
}

#searchProdukcja {
    width: 50%;
    padding: 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
}


#produkcjaSection {
    display: none;
    background-color: #ffffff;
    border: 1px solid #ccc;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin: 10px;
    width: 100%;
}




/* Styl dla tabeli w crudSection */
#dataTable, #packageTable, #constructionTable, #glassTable, #koloryTable, #systemyTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

/* Komórki tabeli */
#dataTable th, #packageTable th, #constructionTable th, #glassTable th, #koloryTable th, #systemyTable th,
#dataTable td, #packageTable td, #constructionTable td, #glassTable td, #koloryTable td, #systemyTable td {
    border: 1px solid #ccc;
    text-align: left;
    padding: 8px;
    font-size: 14px;
}

/* Nagłówki tabeli */
#dataTable th {
    background-color: #f2f2f2;
    font-weight: bold;
    cursor: pointer;
}

/* Zmiana koloru przy najechaniu na nagłówki */
#dataTable th:hover {
    background-color: #ddd;
}

/* Wiersze tabeli */
#dataTable tbody tr:nth-child(even) {
    background-color: #f9f9f9; /* Kolor dla parzystych wierszy */
}

#dataTable tbody tr:hover {
    background-color: #eaeaea; /* Podświetlenie wiersza przy najechaniu */
}

/* Styl dla wyszukiwarki w crudControls */
#crudControls, #packageControls, #constructionsControls, #szybyControls, #koloryControls, #systemyControls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

#searchElementy, #searchPakiety, #searchKonstrukcje, #searchSzyby, #searchKolory, #searchSystemy {
    width: 50%;
    padding: 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

#addElementBtn, #addPackageBtn, #addConstructionBtn, #addGlassBtn, #addKoloryBtn, #addSystemyBtn {
    background-color: rgb(222, 144, 0);
    color: white;
    border: none;
    padding: 7px 10px;
    cursor: pointer;
    font-size: 14px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

#addElementBtn:hover, #addPackageBtn:hover, #addConstructionBtn:hover, #addGlassBtn:hover, #addKoloryBtn:hover, #addSystemyBtn:hover{
    background-color: rgb(171, 113, 4);
}

.editBtn, .viewElementsBtn, .editPackageBtn, .editElementBtn, .editConstructionBtn, .editGlassBtn, .editKoloryBtn, .editSystemyBtn {
    background-color: rgb(222, 144, 0);
    color: white;
    border: none;
    padding: 6px;
    cursor: pointer;
    font-size: 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.editBtn:hover, .viewElementsBtn:hover, .editPackageBtn:hover, .editElementBtn:hover, .editConstructionBtn:hover, .editGlassBtn:hover, .editKoloryBtn:hover, .editSystemyBtn:hover {
    background-color: rgb(171, 113, 4);
}

.deleteBtn, .deletePackageBtn, .deleteElementBtn, .deleteConstructionBtn, .deleteGlassBtn, .deleteKoloryBtn, .deleteSystemyBtn, .cancelAddPackageBtn {
    background-color: #7c7c7c;
    color: white;
    border: none;
    padding: 6px;
    cursor: pointer;
    font-size: 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.deleteBtn:hover, .deletePackageBtn:hover, .deleteElementBtn:hover, .deleteConstructionBtn:hover, .deleteGlassBtn:hover, .deleteKoloryBtn:hover, .deleteSystemyBtn:hover, .cancelAddPackageBtn:hover {
    background-color: rgb(171, 4, 4);
}


/* Styl dla kontenera dataTable -  dodaj element*/

#adminPanel {
    background-color: #ffffff;
    border: 1px solid #ccc;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin: 20px auto;
    width: 80%;
}

#adminPanel form {
    display: flex;
    flex-direction: column;
}

#adminPanel label,
#adminPanel input,
#adminPanel select {
    margin-bottom: 10px;
}

#adminMessage {
    margin-top: 10px;
    font-weight: bold;
    color: green;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th, td {
    border: 1px solid #ccc;
    text-align: left;
    padding: 8px;
}

th {
    background-color: #f2f2f2;
    cursor: pointer;
}

th:hover {
    background-color: #ddd;
}

tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* ---------------- popup----------------- */


/* Popup */
.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Przyciemnione tło */
    z-index: 1000;
}

/* Popup content */
.popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40%;
    max-height: 90%; /* Ograniczenie wysokości pop-upu */
    overflow-y: auto; /* Dodanie przewijania w osi pionowej */
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    padding: 20px;
    margin: 10px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* popup dodawania oferty */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-content {
    background: #fff;
    display: flex;
    flex-direction: column;
    padding: 20px;
    border-radius: 8px;
    min-width: 400px;
}

.modal-content form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}





.fraction-container {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.form-row label {
    
    text-align: left;
    font-weight: bold;
}

.form-row input,
.form-row select {
    width: 55%; /* Pola wejściowe po prawej stronie */
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

/* Nagłówek formularza */
.form-container h2 {
    text-align: center;
    margin: 20;
    color: #333;
}

/* Układ wiersza formularza */
.form-row {
    display: flex;
    gap: 10px;
    margin: 3px;
}







/* Kolumny formularza */
.form-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
}

.form-column label {
    font-weight: bold;
}

.form-column input,
.form-column select {
    padding: 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    width: 100%;
}

/* Przyciski */
.form-actions, .form-addPackage {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.btn-primary, .primary-button, .addPackageBtn, .addPackageBtn {
    background-color: rgb(222, 144, 0);
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.btn-primary:hover, .primary-button:hover, .addPackageBtn:hover {
    background-color: rgb(171, 113, 4);
}

.btn-secondary, .secondary-button, .cancelAddPackageBtn {
    background-color: #ccc;
    color: #333;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.btn-secondary:hover, .secondary-button:hover, .cancelAddPackageBtn:hover {
    background-color: #bbb;
}



/* zakładki w bazie danych */
#crudTabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.crud-tab {
    background-color: rgb(222, 144, 0);
    color: white;
    border: none;
    padding: 7px 10px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s;
}




.crud-tab:hover {
    background-color: rgb(171, 113, 4);
}


.crud-tab.active {
    background-color: #7c7c7c;
    color: #fff;
}

.crud-tab-content {
    display: none;
}

.crud-tab-content.active {
    display: block;
}






.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Przyciemnione tło */
    z-index: 1000;
}

.popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50%;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    padding: 20px;
}

.popup .form-container h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

.popup .form-container label {
    font-weight: bold;
}

.popup .form-container input,
.popup .form-container textarea {
    width: 100%;
    padding: 5px;
    font-size: 14px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.popup .form-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
}



/* kontener edycji pakietu - rysunek - wymiary */
#container {
    display: flex;
    flex-direction: row;
    gap: 20px; /* Odstęp między kolumnami */
    }

    #profilePreview {
    max-width: 200px;
    border: 1px solid #ccc;
    flex-direction: column;
    }

    #container label {
    display: inline-block;
    width: 250px; /* szerokość etykiety */
    }



/* kolor picker - do zakładania koloru ram w bazie danych */
#koloryRgbPicker, #koloryRgb, #editKoloryRgbPicker, #editKoloryRgb, #glassRgb, #glassRgbPicker, #editGlassRgb, #editGlassRgbPicker {
    padding: 0px;
    width: 27%;
    }




/* ================================ */
/* ZOOM – TOGGLE BUTTON */
/* ================================ */

/* DOMYŚLNIE: ZOOM WYŁĄCZONY */
.parametry_button.toggle.inactive {
    background-color: rgb(222, 144, 0);
    color: white;
}

/* hover gdy WYŁĄCZONY */
.parametry_button.toggle.inactive:hover {
    background-color: rgb(171, 113, 4);
}

/* ZOOM WŁĄCZONY (brak .inactive) */
.parametry_button.toggle:not(.inactive) {
    background-color: rgb(249, 97, 3);
    color: white;
}

/* hover gdy WŁĄCZONY */
.parametry_button.toggle:not(.inactive):hover {
    background-color: rgb(235, 175, 63);
}




/* ===== TOAST CONTAINER - popup znikające powiadomienia ===== */

/* ===== TOAST CONTAINER ===== */
#toastContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ===== TOAST ===== */
.toast {
    min-width: 250px;
    max-width: 400px;
    padding: 14px 18px;
    border-radius: 6px;
    color: #fff;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    transform: translateX(30px);
    animation: toastSlideIn 0.3s ease forwards;
}

/* Typy */
.toast-success {
    background-color: #2e7d32;
}

.toast-warning {
    background-color: #ef6c00;
}

.toast-error {
    background-color: #c62828;
}

/* Animacja wejścia */
@keyframes toastSlideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animacja wyjścia */
.toast.hide {
    animation: toastFadeOut 0.3s ease forwards;
}

@keyframes toastFadeOut {
    to {
        opacity: 0;
        transform: translateX(30px);
    }
}





/* ============================= */
/* EDIT OFERTA MODAL */
/* ============================= */




.oferta-edit-modal {
    width: 95%;
    max-width: 1400px;
    min-width: 900px;  
}



.oferta-edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.oferta-edit-meta {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
    font-size: 16px;
}

#editOfertaTable {
    width: 100%;
    border-collapse: collapse;
}

#editOfertaTable th {
    background: #cfcfcf;
    color: rgb(0, 0, 0);
    padding: 8px;
    text-align: left;
    font-weight: 600;
}

#editOfertaTable td {
    padding: 8px;
    border-bottom: 1px solid #ddd;
    vertical-align: middle;
}

/* co drugi wiersz szary */
#editOfertaTable tbody tr:nth-child(even) {
    background: #f3f4f6;
}

.miniatura {
    width: 120px;
    height: 120px;
}

/* nowa oferta - dokaj klienta */
.input-with-buttons{
display:flex;
gap:6px;
}

.btn-small{
padding:4px 10px;
font-size:14px;
}

.form-grid{
display:grid;
grid-template-columns:150px 1fr;
gap:8px;
}


/* uniwersalny popup wyboru elementu konstrukcji - rama skrzydło slupek z miniaturą SVG*/

/* =========================================
   Popup elementów konstrukcyjnych
   (skrzydła, słupki, przyszłe ramy)
========================================= */

.element-popup,
.constructionElementPopup{
    width:600px;
}

/* layout */
.element-layout,
.constructionElement-layout{
    display:flex;
    gap:20px;
    margin-top:10px;
}

/* preview SVG */
.element-preview,
.constructionElement-preview{
    flex:1;
    border:1px solid #ddd;
    background:#fff;
    display:flex;
    justify-content:center;
    align-items:center;
}

/* lista elementów */
.element-list,
.constructionElement-list{
    flex:1;
    max-height:300px;
    overflow-y:auto;
}

/* UL */
.element-list ul,
.constructionElement-list ul{
    list-style:none;
    padding:0;
    margin:0;
}

/* LI */
.element-list li,
.constructionElement-list li{
    padding:8px 10px;
    border-bottom:1px solid #eee;
    cursor:pointer;
}

.element-list li:hover,
.constructionElement-list li:hover{
    background:#f0f0f0;
}

.element-list li.active,
.constructionElement-list li.active{
    background:#0078d4;
    color:white;
}

/* przyciski */
.element-actions,
.constructionElement-actions{
    margin-top:15px;
    display:flex;
    justify-content:flex-end;
    gap:10px;
}