/* =================================================
   RESET + ZÁKLAD
   ================================================= */

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    font-family: Arial, sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #eee;
}

/* =================================================
   TOP BAR
   ================================================= */

.topbar {
    height: 60px;
    background: #3b1f2b;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    flex-shrink: 0;
}

.brand {
    font-size: 18px;
    font-weight: bold;
}

/* tlačidlá v topbare */
.topbar-center {
    display: flex;
    gap: 10px;
}

.top-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 6px;
}

.top-btn:hover {
    background: rgba(255,255,255,0.25);
}

.top-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.top-btn.danger {
    background: #8b0000;
}

.top-btn.danger:hover {
    background: #a80000;
}

.file-btn {
    cursor: pointer;
}

/* =================================================
   HLAVNÝ LAYOUT
   ================================================= */

.main-layout {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
}

/* =================================================
   SIDEBAR – DEFINITÍVNA VERZIA
   ================================================= */

.sidebar {
    width: 300px;
    background: #f5f5f5;
    border-right: 1px solid #ccc;
    display: flex;
    flex-direction: column;
    transition: width 0.25s ease;
    position: relative;
    z-index: 20;
}

.sidebar.collapsed {
    width: 44px;
}

/* hlavička sidebaru */
.sidebar-header {
    height: 44px;
    background: #e6e6e6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px;
    font-weight: bold;
    flex-shrink: 0;
    position: relative;
}

/* text v hlavičke */
.sidebar-header span {
    white-space: nowrap;
}

/* v zbalenom stave skry text, NIE tlačidlo */
.sidebar.collapsed .sidebar-header span {
    display: none;
}

/* toggle tlačidlo – vždy klikateľné */
#toggleSidebar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #d0d0d0;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    position: relative;
}

#toggleSidebar:hover {
    background: #c0c0c0;
}

/* centrovanie tlačidla v zbalenom stave */
.sidebar.collapsed .sidebar-header {
    justify-content: center;
}

/* otočenie šípky */
.sidebar.collapsed #toggleSidebar {
    transform: rotate(180deg);
}

/* obsah sidebaru */
.sidebar-content {
    padding: 10px;
    overflow-y: auto;
    flex: 1;
}

.sidebar.collapsed .sidebar-content {
    display: none;
}

/* =================================================
   ZOZNAM ĽUDÍ
   ================================================= */

.person {
    padding: 8px 10px;
    margin-bottom: 6px;
    background: #fff;
    border: 1px solid #ddd;
    cursor: grab;
    font-size: 14px;
    border-radius: 4px;
}

.person:active {
    cursor: grabbing;
}

/* =================================================
   CONTENT / SEATING
   ================================================= */

.content {
    flex: 1;
    background: #eee;
    overflow: hidden;
    position: relative;
}

/* scroll + pohyb layoutu */
.layout-scroll {
    width: 100%;
    height: 100%;
    overflow: auto;
    padding: 20px;
}

/* =================================================
   SEATING WRAPPER
   ================================================= */

.wrapper {
    width: 1430px;
    height: 1040px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fff;
    border-radius: 12px;
    border: 2px solid #ddd;
    position: relative;
}

.container {
    width: 1430px;
    height: 1040px;
    position: relative;
    background: #eee;
}

.grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(0,0,0,.15) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0,0,0,.15) 1px, transparent 1px);
    background-size: 130px 130px;
    z-index: 1;
}

/* =================================================
   STOLY A STOLIČKY
   ================================================= */

.table {
    width: 85px;
    height: 85px;
    background: white;
    border: 3px solid #3b1f2b;
    border-radius: 50%;
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 22px;
    color: #3b1f2b;
    font-weight: bold;
    z-index: 4;
}

.seat {
    width: 20px;
    height: 20px;
    background: #3b1f2b;
    color: white;
    border-radius: 50%;
    font-size: 10px;
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 5;
}

.seat.assigned {
    background: #f8e9f0;
    color: #3b1f2b;
    font-weight: bold;
}

.seat.drag-over {
    outline: 2px dashed orange;
}

/* =================================================
   MAPOVÉ PRVKY
   ================================================= */

.parket {
    width: 330px;
    height: 330px;
    background: rgba(200,160,80,.55);
    border: 3px solid #3b1f2b;
    position: absolute;
    font-size: 28px;
    color: #3b1f2b;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

.stage {
    width: 260px;
    height: 90px;
    background: #3b1f2b;
    color: white;
    border-radius: 10px;
    position: absolute;
    font-size: 26px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3;
}

.fence {
    width: 130px;
    height: 130px;
    background: repeating-linear-gradient(
        90deg,
        #444,
        #444 6px,
        transparent 6px,
        transparent 12px
    );
    opacity: 0.7;
    position: absolute;
    z-index: 3;
}

/* =================================================
   MODAL (PRESADENIE)
   ================================================= */

.seat-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.seat-modal-box {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    width: 260px;
    text-align: center;
}

.seat-modal-box h3 {
    margin-top: 0;
}

.seat-modal-box button {
    width: 100%;
    margin-top: 10px;
    padding: 8px;
    cursor: pointer;
}
