/* ==========================================================================
    Admin - Dropdown Lenyíló Menu
   ========================================================================== */
:root { 
    --container-bg: #383838;  /*  Lenyíló Menu háttérszíne */
    --container-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    --border-color-dark: #444;  /*  Lenyíló Menu border  */
    --text-color: #e0e0e0;  /*  Lenyíló szövege */
    --section-bg: #2c2c2c; /*  Lenyíló Menu Select sötétebb antracit */
    --blue-gradient: linear-gradient(to right, #8ab4f8, #5f94f1);  /* kék button */
    --blue-light: #8ab4f8;  /* minden ami kék, linkek, szövegek */ 
    --green-light: #92af7f;  /* minden ami zöld, linkek, szövegek */ 

}
/* ==========================================================================
   Alapbeállítások és Törzs
   ========================================================================== */

body { /* color: #b0b0b0;  background-color: #2c2c2c; */  /*  ANTRACIT BG kiiktatva */
          color: #888;     background-color: #1a1a1a;  /* SÖTÉTEBB ANTRACIT BG */
   

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 0.9em; line-height: 1.3; margin: 0; padding-top: 80px; /* Hely a fix fejlécnek */
    text-align: center; }

 h1 {   /* cím */
        font-size: 1.5em;  letter-spacing: 0.1em;   
        text-align: center; margin: 20px 0; font-weight:normal;   
        color: #92af7f; /* zöld */  }



/* ==========================================================================
   Fejléc és Navigáció
   ========================================================================== */

.fixed-header {
    background-color: #383838; /* HEADER */ /* világosabb antracit */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 10px;
    border-bottom: 1px solid #383838;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
}

.toplinks {
    display: flex;
    gap: 10px;
    align-items: center;
}

.toplink {
    font-size: 1em;
    text-decoration: none;
    color: var(--blue-light);
}


.kek {
    font-size: 1em;
    text-decoration: none;
    color: var(--blue-light);
}

.zold {
    font-size: 1em;
    text-decoration: none;
    color: var(--green-light);
}




.dropdown {
    position: relative;
    display: inline-block;
}


.dropdown-toggle {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.dropdown-toggle img,
.dropdown-menu img {
    width: 20px;
    height: 20px;
    border: 0;
  /*  filter: invert(1); */ /* ikonok inverz - fehérek */
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 5px); /* Elhelyezés a gomb alatt egy kis réssel */
    background-color: var(--container-bg);
    min-width: 180px;
    box-shadow: var(--container-shadow);
    border-radius: 4px;
    z-index: 101; /* Legyen a fejléc többi eleme felett */
    border: 1px solid var(--border-color-dark);
    padding: 5px 0;
    margin: 0;
}
.dropdown-menu img {
    margin-right: 10px;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu .dropdown-item {
    color: var(--text-color);
    padding: 8px 15px;
    text-decoration: none;
    display: block;
    white-space: nowrap;
    text-align: left;
    font-size: 0.9em;
}

.dropdown-menu .dropdown-item:hover {
    background-color: var(--section-bg);
}

/* ==========================================================================
   Űrlapok és Kereső
   ========================================================================== */

/* .filter-form a fejlécben van, ezért a .fixed-header stílusai vonatkoznak rá */
.filter-form, .filter-forma {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
    width: 100%; /* Kitölti a rendelkezésre álló helyet, hogy a jobb oldali elemek a szélre kerüljenek */
}

.search-form {
    display: flex;
    gap: 10px;
    flex-grow: 1;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    padding: 6px 30px 6px 6px;
    border: 1px solid #555;
    border-radius: 4px;
    font-size: 1em;
    background-color: #333;
    color: #e0e0e0;
}

.search-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #aaa;
}

.search-button {
    padding: 6px 10px;
    background: #eee;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
}




/* ==========================================================================
   Polc Mátrix - Temető Zóna - Polcról való levételhez húzd a fóliát ide!
   ========================================================================== */
.cemetery-zone {   padding: 5px; margin: 10px auto;  }
/* .cemetery-zone.drag-over {  } */
.cemetery-text { font-size: 1em;  }



/* ==========================================================================
   Rendezés select option
   ========================================================================== */
.sort-input { /* Rendezés alap (mobil) stílusa - Mobilon a Rendezés select option helyett egy rendezés ikon jelenik meg */
    width: 45px;
    height: 32px;
    padding: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%238ab4f8" viewBox="0 0 16 16"><path d="M3.5 2.5a.5.5 0 0 0-1 0v8.793l-1.146-1.147a.5.5 0 0 0-.708.708l2 2a.5.5 0 0 0 .708 0l2-2a.5.5 0 0 0-.708-.708L3.5 11.293V2.5zm3.5 1a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zM7 6.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5zm0 3a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5zm0 3a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 0 1h-1a.5.5 0 0 1-.5-.5z"/></svg>') no-repeat center;
    background-color: #333;
    border: 1px solid #555;
    color: transparent;
    border-radius: 4px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
}
.sort-input::-webkit-calendar-picker-indicator {    /* Az eredeti inputot teljesen átlátszóvá tesszük, de kattintható marad */
        opacity: 0;   cursor: pointer;  width: 100%;  height: 100%; }

.sort-input::-ms-expand {   display: none; /* Remove default arrow in IE */ }

@media (min-width: 601px) { /* Nagyobb képernyőn (PC-n) a rendezés ikon átalakul rendezés select optionná */
    .sort-input {  transition: width 0.2s ease-in-out; }
    .sort-input:focus, .sort-input:hover {
        width: 140px;
        background-image: none;
        background-color: var(--container-bg);
        color: var(--blue-light);
        border-radius: 4px;
        font-size: 0.9em;
        padding: 0 8px;
        cursor: pointer;
    }
}


/* ==========================================================================
   Fő Adattábla
   ========================================================================== */

.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.data-table {
    border-collapse: collapse;
    overflow: hidden;
 
    margin: 20px auto 0;
    border-radius: 8px;
    box-shadow: 0 0 0 1px #444;
}

.data-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #444;
    white-space: normal;
    vertical-align: top;
    font-size: 1em;
}

.data-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05); /* Finom világosítás a hover effektért */
    transition: background-color 0.2s ease;
}



/* ==========================================================================
    Képes cellák 
   ========================================================================== */ 

.image-and-controls-cell {
    padding: 5px;
    vertical-align: middle;
    text-align: center;
}

.image-container {
    position: relative;
    display: inline-block;
    overflow: hidden;
    border: 1px solid #444;
    border-radius: 4px;
    width: 80px;
    height: 80px;
}

.image-container .thumbnail { width: 100%; height: 100%; object-fit: cover; display: block;}

.thumbnail { width: 120px; height: 120px; object-fit: cover;}


/*  "F" -upload-button  "A" rename-button*/

.image-container .upload-button, .image-container .rename-button  { position: absolute; 
    padding: 2px 4px; font-size: 10px;
    background-color: rgba(255, 255, 255, 0.8); /* Enyhe áttetszőség */
    border: 1px solid rgba(0, 0, 0, 0.2);  border-radius: 3px;  cursor: pointer; z-index: 2; }

.image-container .upload-button { bottom: 2px; right: 2px; }
.image-container .rename-button { bottom: 2px; right: 22px; }

.image-container .upload-button:hover, .image-container .rename-button:hover { background-color: #FFF; }



.image-id-overlay { position: absolute; top: 4px; right: 4px; background: rgba(0, 0, 0, 0.6);
    color: white;  padding: 2px 4px;  font-size: 12px;  border-radius: 3px; }



/* ==========================================================================
    Stílus cellák
   ========================================================================== */ 
.style-cell { width: 30px;  min-width: 30px;  padding: 0 !important;  position: relative;  text-align: center;}

.style-cell-id {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
    white-space: nowrap;
    width: 50px;
}

/* ==========================================================================
    Szerkeszthető mezők (Admin)
   ========================================================================== */ 
.editable-field {  padding: 1px 0;  cursor: pointer;  position: relative;  display: block;  min-height: 1.2em;}

.editable-field:hover::after {  content: '✏️';  position: absolute;  right: 0px;  top: 50%;  transform: translateY(-50%);
    opacity: 0.5;}

.editable-field[data-column="szin_hexakodja"]:hover::after {  content: '🎨✏️'; }

.data-table td.editing, .editable-field.editing {  padding: 0; }


/* Szerkeszthető mezők (Admin) */
.data-table td.editing input,
.editable-field.editing input {
    width: 100%;
    max-width: 250px;
    padding: 1px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 1.1em;
    border-width: 1px;
    border-style: solid;
    border-color: var(--blue-light);
    outline: none;
    background-color: #444;
    color: #e0e0e0;  /* szövegek vilszürke */
}

.info-cell { padding: 0; /* ADMIN/INDEX.PHP-ban a mezők */ }


/* ==========================================================================
    Speciális mezők (kategória, típus, dátum) 
   ========================================================================== */ 

.kategoria, .info-cell .editable-field[data-column="kategoria"] { font-style: italic;  display: inline-block; padding: 2px 0; color: var(--blue-light); }
.editable-field[data-column="kategoria"].editing { background-color: transparent;  display: block; padding: 0; }
.info-cell .editable-field[data-column="tipus"] {  font-style: normal; /* ADMIN/INDEX.PHP tipus mező */ }
.datum, .info-cell .editable-field[data-column="datum"] { color: var(--green-light); white-space: nowrap; /* zöld */ }


/* ==========================================================================
   darab és pozicio 
   ========================================================================== */

.zero-quantity-text {  /* darab amikor nulla - sárga alap  */
    background-color: #d4af37;
    color: black;
    padding: 1px 5px;
    border-radius: 4px;
}

.non-zero-quantity-text {   white-space: nowrap; /* darab amikor nem nulla*/ }

.pozicio {
    background: #ccb897;
    color: #000;
    padding: 1px 5px;
    border-radius: 4px;
    white-space: nowrap;
}

.pozicio2 { width: 150px; box-sizing: border-box; } /* editable pozició, amikor beleírunk */

/* Pozíció link az index.php listában */
.pozicio-link {
    text-decoration: none;
    color: inherit; /* Örökli a szülő színét, nem lesz kék */
}

.pozicio-link:hover .pozicio {
    box-shadow: 0 0 5px rgba(204, 184, 151, 0.8); /* Finom ragyogás a pozíció pilla körül */
}

/* ==========================================================================
   Polc Mátrix Tábla
   ========================================================================== */

.matrix-table {
    table-layout: fixed;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 12px;
}

.matrix-table th,
.matrix-table td {
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
   /* white-space: nowrap; */
}

.matrix-table td {
    border: 1px solid #444;
    padding: 0;
    /* A méretet a belső wrapperre helyezzük át a jobb reszponzív viselkedés érdekében */
    vertical-align: top; /* Fontos, hogy a belső div a cella tetejéhez igazodjon */
}

.cell-content-wrapper {
    width: 90px;
    height: 90px;
    position: relative; /* A belső elemek pozicionálásához */
    overflow: hidden; /* Megakadályozza, hogy a tartalom kilógjon, pl. szöveges nézetben */
}

.matrix-table td:not(.occupied):not(.row-header) { 
    background-color: #1f1f1f; }

/* A polc-matrix.php-ban az 'e1' cella */
.matrix-table td.entry-point-cell:not(.occupied) {
   border: 2px dashed var(--blue-light);  
}

.matrix-table td.occupied {
    background-color: #2c2c2c;  /* polc-matrix.php cella bg-ja, amiben van fólia  */
    line-height: 1.1;
    /* A wrapper miatt a position relative ide már nem feltétlenül kell, de nem árt */
    position: relative;
    /* A drag-and-drop élmény javítása: megakadályozza a szövegkijelölést és a kontext menüt (pl. kép mentése) hosszan nyomásra mobilon */
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none; /* IE 10+ */
    user-select: none; /* Standard */
    -webkit-touch-callout: none; /* iOS Safari */
}

/* 
 * Telefonos nézetben a cella tartalma (pl. kép) fölé egy átlátszó réteget teszünk.
 * Ennek a célja, hogy a "tap" (érintés) eseményt ez a réteg kapja el, ne pedig a kép alatti link (<a> tag).
 * Így egy rövid érintés nem nyitja meg a képet új lapon, hanem a felugroablak.js-ben definiált
 * felugró ablakot hozza elő. A hosszan nyomás pedig a polc_matrix_drag_telefonon.js-ben
 * lekezelt mozgatást indítja el. A réteg a hover-content alatt van, így az asztali nézetet nem zavarja.
*/
.matrix-table td.occupied::after {
    content: '';
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1;
}

.occupied .hover-content {  /*  matrix.php-ban a cellák amiben van fólia, hover */ 
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95);
    transition: opacity 0.10s ease-out, transform 0.15s ease-out, visibility 0s 0.15s;  /* átmenet gyorsasága */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
 background-color: #2c2c2c;  color: #b0b0b0;   font-size: 0.9em;  line-height: 1.2;

    padding: 5px;
    z-index: 2; /* A ::after réteg fölött kell lennie, hogy a hover működjön asztali nézetben */
    box-sizing: border-box;
}

.occupied:hover .hover-content {
     opacity: 1;
    visibility: visible;
    transform: scale(1);
    pointer-events: auto; /* Lehessen interakcióba lépni vele, ha látható */
    transition-delay: 0s;

}


.matrix-table th,
.matrix-table td.row-header {
    background-color: #3a4a5e;
    color: #e0e0e0;
    font-weight: bold;
}

.matrix-table th {
    border: none;
    height: 40px;
    padding: 0;
    /* A cellákkal megegyező fix szélességet adunk a fejlécnek is, ez stabilizálja a táblázatot. */
    width: 90px;
    min-width: 90px;
    max-width: 90px;
}

.matrix-table th:first-child,
.matrix-table th:last-child {
    /* A sorfejlécekkel megegyező szélesség a sarkoknak */
    width: 40px;
    min-width: 40px;
    max-width: 40px;
}

.matrix-table td.row-header {
    width: 40px;
    min-width: 40px; /* A sorfejléc összenyomódását is megakadályozza */
    max-width: 40px; /* A sorfejléc szélességét is fixálja */
}

.matrix-table tr.with-bottom-border td {
    border-bottom: 25px solid #3a4a5e;
}

.matrix-table td.selected-cell {
    outline-offset: -2px;
    box-sizing: border-box;
    border: 2px solid var(--blue-light);
}

.matrix-table td.highlight {  /*  polc.php-ban keresésre a találatnak körbe az arany kerete */
    box-sizing: border-box;
    border: 5px solid gold;
    box-shadow: none;
}

/* Amikor a keresés aktív, a nem-találat cellákat elsötétítjük */
.matrix-table.highlight-active > tbody > tr > td.occupied:not(.highlight) {
    opacity: 0.3;
    transition: opacity 0.3s ease-in-out;
}

.no-image-placeholder {
    width: 100%;
    height: 100%;
    border: 1px dashed #555;
    box-sizing: border-box;
}




/* Drag and drop styles for matrix */
.matrix-table td.dragging {
    opacity: 0.4;
}

.matrix-table td.drag-over {
    background-color: #4a4a4a !important; /* Use important to override inline styles */
    box-shadow: inset 0 0 10px #000;
}


/* ==========================================================================
   Fólia Temető modal box stílusai 
   ========================================================================== */

/* Custom Confirmation Modal */
.custom-modal-overlay {
    position: fixed; /* Stay in place */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Black w/ opacity */
    z-index: 3000; /* Sit on top */
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.custom-modal-content {
    background-color: #000;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border: 1px solid var(--border-color-dark);
    flex-direction: column;
    align-items: center;
}

#delete-animation-modal {
    width: 150px;
    height: 150px;
    background-image: url('../admin/img/box_anim.gif');
    filter: invert(1) opacity(85%);
    background-size: cover;
    background-position: center;
}

#custom-confirm-message {
    color: var(--text-color);
    font-size: 1.2em;
}

.custom-modal-buttons {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.label-pill {  display: inline-block;  background-color: #444;
    color: #e0e0e0;  border: 1px solid #666; border-radius: 10px; padding: 1px 8px; font-size: 12px; }

/* ==========================================================================
   Gombok és egyéb vezérlők
   ========================================================================== */



.icon-button-dark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 32px;
    padding: 0;
    background-color: #333;
    border: 1px solid #555;
    color: var(--blue-light); /* SVG color */
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    flex-shrink: 0; /* Megakadályozza az összenyomódást flex konténerben */
}

.icon-button-dark:hover:not(:disabled) {
    background-color: #444;
}

.icon-button-dark:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    color: #888;
}


    .print-button {
            padding: 8px 16px;
            font-size: 14px;
            cursor: pointer;
            background: var(--blue-gradient); /* css tetején megadva a kék szín */
            color: black;
            border: none;
            border-radius: 4px;
            transition: background-color 0.2s ease; /* Finom átmenet a hover effektnek */
            /* A pozícionálást a flexbox konténer (gap) kezeli, a margó nem szükséges. */
        }
        .print-button:hover {
            background-color: #8ab4f8; /* Sötétebb kék árnyalat hover-re */
        }

        .button-secondary {
            background: #5a5a5a;
            color: #e0e0e0;
        }

        .button-secondary:hover {
            background: #6b6b6b;
        }





.delete-button {
    background-color: transparent;
    color: #b0b0b0;
    border: none;
    padding: 5px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 1.8em;
    transition: color 0.2s ease, background-color 0.2s ease;
    vertical-align: middle;
}

.delete-button:hover {
    color: #e0e0e0;
    background-color: #444;
}
 
.back-button {
    flex-shrink: 0;
    padding: 8px;
    background-color: #f0f0f0;
    color: #333;
    text-decoration: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center; /* Középre igazítja az ikont */
    transition: background-color 0.2s ease;
}

.back-button:hover:not(:disabled) {
    background-color: #e0e0e0;
}

.back-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}



/* ==========================================================================
   Reszponzív Stílusok
   ========================================================================== */

@media (max-width: 600px) {
    body {
        padding: 80px 10px 10px;
        line-height: 1.4;
    }

    .data-table td {
        font-size: 1em;
        padding: 8px 6px;
    }

    .image-container {
        width: 70px;
        height: 70px;
    }

    .search-form {
        flex-grow: 0; /* Megakadályozza, hogy a kereső űrlapja elnyúljon mobilon */
    }

    .search-input {
        width: 100px; /* Fix szélességet ad a keresőmezőnek, hogy elférjenek a linkek */
    }

    /* Polc Mátrix reszponzív beállításai (kisebb cellák mobilon) */
    .cell-content-wrapper {
        width: 60px;
        height: 60px;
    }

    .matrix-table th {
        width: 60px;
        min-width: 60px;
        max-width: 60px;
    }

    .matrix-table th:first-child,
    .matrix-table th:last-child,
    .matrix-table td.row-header {
        width: 35px;
        min-width: 35px;
        max-width: 35px;
    }

    .occupied .hover-content {
        font-size: 0.6em; /* Kisebb betűméret mobilon */
        padding: 1px;     /* Kisebb padding, hogy több szöveg férjen el */
        line-height: 1.1; /* Kisebb sorköz */
    }

    /* A temető zóna megjelenítése mobilon */
    .cemetery-zone {
        display: block;
    }
}




/* ==========================================================================
   Képnézegető az index.php-ban
   ========================================================================== */
  .image-overlay {
            display: none; /* Alapból rejtett */
            position: fixed; /* Fix pozíció, a viewport-hoz igazodva */
            z-index: 1000; /* Legfelül legyen */
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.3); /* Fekete háttér átlátszósággal */
            -webkit-backdrop-filter: blur(4px); /* Safari */
            backdrop-filter: blur(4px); /* Modern böngészők */
            cursor: pointer; /* Kattintható kurzor */
            justify-content: center;
            align-items: center;
        }
        .image-overlay-content {
            display: block;
            max-width: 500px;
            max-height: 500px; /* Kisebb maximális magasság */
            margin: auto;
            border-radius: 8px; /* Lekerekített sarkok */
            box-shadow: 0 5px 15px rgba(0,0,0,0.3); /* Finom árnyék */
        }
