body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
}

header {
    background-color: #333;
    color: white;
    padding: 10px 20px;
    text-align: center;
}

header nav ul {
    list-style: none;
    padding: 0;
}

header nav ul li {
    display: inline-block;
    margin-right: 20px;
}

header nav ul li a {
    color: white;
    text-decoration: none;
}

:focus {
    outline: 2px solid #333;
    outline-offset: 2px;
}

/* ---- Fő blokkok ---- */
#foglalas {
    max-width: 1000px;
    margin: 20px auto;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

#foglalas h2 {
    text-align: center;
    color: #333;
}

#hirdetotabla {
    background: url("parafa.jpg") repeat;
    background-color: #c49e73;
    background-size: 300px;
    border: 8px solid #8b5a2b;
    border-radius: 12px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3), 0 8px 20px rgba(0, 0, 0, 0.2);
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    max-width: 1200px;
    margin: 20px auto;
    gap: 20px;
    justify-items: center;
}

.board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
}

/* ---- Hirdetés cetlik ---- */
.note {
    position: relative;
    width: 250px;
    min-height: 200px;
    background: #fff8dc;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s;
}

.note::before {
    content: "📌";
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%) rotate(-10deg);
    font-size: 22px;
}

.note:hover {
    transform: scale(1.02);
}

.note:hover .delete-btn {
    display: block;
}

.note h3 {
    margin-top: 0;
    color: #333;
}

.note p {
    color: #555;
    line-height: 1.5;
}

.note:nth-child(odd) {
    transform: rotate(-1.5deg);
}

.note:nth-child(even) {
    transform: rotate(1.5deg);
}

/* ---- Foglalási naptár ---- */
#foglalas .calendar {
    display: grid;
    grid-template-columns: 100px repeat(7, 1fr);
    grid-auto-rows: 50px;
    gap: 2px;
    border: 1px solid #ddd;
    background: white;
    width: 100%;
}

.calendar>div {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    text-align: center;
    padding: 10px;
    font-size: 14px;
}

.calendar .time-slot {
    background: #f9f9f9;
    font-weight: bold;
}

.calendar .day-header {
    background: #333;
    color: white;
    font-weight: bold;
}

.calendar .available {
    background: #28a745;
    color: white;
    cursor: pointer;
}

.calendar .available:hover {
    background: #218838;
}

.calendar .booked {
    background: #ff5c5c;
    color: white;
}

.calendar .partial {
    background: yellow;
    color: black;
}

.disabled {
    background-color: #f5f5f5;
    color: #888;
    pointer-events: none;
    text-decoration: line-through;
}

.day-header.currentDay {
    color: #f9eb6bf4;
    font-weight: bold;
}

.day-block {
    display: block;
}



/* ---- Gombok ---- */
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

.btn-green {
    background-color: #4CAF50;
    color: white;
}

.btn-red {
    background-color: #f44336;
    color: white;
}

.uj-hirdetes-btn {
    display: block;
    margin: 30px auto 20px auto;
    font-size: 1.1rem;
    padding: 12px 24px;
    background-color: #007bff;
    color: white;
    border-radius: 8px;
    border: none;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.uj-hirdetes-btn:hover {
    background-color: #0056b3;
    transform: scale(1.03);
}

.download-btn {
    margin-top: 20px;
    background-color: #4caf50;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    transition: background-color 0.3s, transform 0.2s;
    line-height: 1;
}

.download-btn:hover {
    background-color: #66bb6a;
    transform: scale(1.05);
}

.download-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.download-icon svg {
    width: 20px;
    height: 20px;
    display: block;
    transform: translateY(1px);
}

.edit-btn {
    background: linear-gradient(135deg, #43a047, #66bb6a);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.edit-btn:hover {
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.week-navigation {
    display: flex;
    justify-content: center;
    /* középre rakja az egészet */
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.week-navigation button {
    width: 140px;
    height: 60px;
    text-align: center;
    font-weight: bold;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0.5rem 1.2rem;
    font-size: 1rem;
    border: none;
    border-radius: 6px;
    background-color: #007bff;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.week-navigation button:hover {
    background-color: #0056b3;
    transform: scale(1.05);
}

#weekLabel,
#hetValaszto {
    text-align: center;
    display: block;
    font-weight: bold;
    font-size: 1.2rem;
    margin: 0 auto 1rem auto;
}

/* ---- Modal ---- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 100px;
    inset: 0;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: white;
    margin: auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.3s ease-in-out;
    position: relative;
    text-align: center;
}

.modal-content h2,
.modal-content h3 {
    margin-bottom: 1rem;
    text-align: center;
}

.modal-content label {
    display: block;
    margin-top: 10px;
    font-weight: bold;
}

.modal-content select {
    width: 100%;
    padding: 5px;
    margin-top: 5px;
}

.modal-buttons {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.modal-buttons button {
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background-color: #28a745;
    color: white;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

.modal-buttons button:hover {
    background-color: #218838;
    transform: scale(1.05);
}

.modal-content input[type="password"],
.modal-content input[type="text"],
.modal-content textarea {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    font-size: 16px;
    border-radius: 5px;
    border: 1px solid #ccc;
    box-sizing: border-box;
    margin-bottom: 10px;
}

.modal-content textarea {
    min-height: 100px;
    resize: vertical;
}

.close {
    position: absolute;
    right: 10px;
    top: 10px;
    font-size: 20px;
    cursor: pointer;
}

.close:hover {
    color: black;
}

/* ---- Egyéb ---- */
.settings-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em auto;
}

.settings-table th,
.settings-table td {
    border: 1px solid #ccc;
    padding: 8px;
    text-align: center;
}

.settings-table input {
    width: 60px;
    text-align: center;
}

.calendar-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.tab-btn {
    padding: 8px 16px;
    border: none;
    background: #eee;
    cursor: pointer;
    border-radius: 6px;
    transition: 0.2s;
}

.tab-btn:hover {
    background: #ddd;
}

.tab-btn.active {
    background: #4CAF50;
    color: white;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.tab-header {
    display: flex;
    justify-content: center;
    gap: 1em;
    border-bottom: 2px solid #ccc;
    margin-bottom: 1em;
    cursor: pointer;
}

.tab {
    padding: 0.5em 1em;
    font-weight: bold;
    border-bottom: 3px solid transparent;
    transition: border-bottom 0.3s, color 0.3s;
}

.tab-btn {
    padding: 0.5em 1em;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: bold;
}

.tab.active {
    border-bottom: 3px solid #4CAF50;
    color: #4CAF50;
}

.tab-content.hidden {
    display: none;
}

.user-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
}

.user-card {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-width: 180px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.user-card span {
    font-weight: 500;
}

.user-card .btn-red {
    border: none;
    background: #e74c3c;
    color: white;
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.user-card .btn-red:hover {
    background: #c0392b;
}

.delete-btn {
    display: none;
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: red;
}

/* ---- Reszponzivitás ---- */
@media (max-width: 768px) {
    #foglalas .calendar {
        display: block;
        padding: 0 10px;
    }

    .day-block {
        border: 1px solid #e0e0e0;
        border-radius: 10px;
        margin-bottom: 12px;
        background: #fff;
        overflow: hidden;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
        display: flex;
        flex-direction: column;
    }

    .day-header-mobile {
        display: block;
        width: 100%;
        text-align: left;
        padding: 14px 16px;
        font-weight: 700;
        font-size: 1rem;
        background: linear-gradient(90deg, #007bff, #0056b3);
        color: #fff;
        border: none;
        cursor: pointer;
        box-sizing: border-box;
        order: 1;
    }

    .day-header-mobile.currentDay {
        background: linear-gradient(90deg, #0056b3, #003f7f);
    }

    .day-slots {
        display: none;
        padding: 12px;
        gap: 8px;
        box-sizing: border-box;
        order: 2;
    }

    .day-block.open .day-slots {
        display: flex;
        flex-direction: column;
        padding: 12px;
        gap: 8px;
    }

    /* egy slot stílusa */
    .slot {
        width: 100%;
        max-width: 250px;
        min-width: 200px;
        height: auto;
        line-height: 50px;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        flex-shrink: 0;
        padding: 6px 4px;
        border-radius: 8px;
        text-align: center;
        font-weight: 600;
        box-sizing: border-box;
        min-height: 45px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 6px;
        align-items: center;
    }

    .slot .slot-meta {
        display: none;
        font-size: 0.85rem;
        font-weight: 500;
        opacity: 0.95;
    }

    .slot.available {
        background: #28a745;
        color: white;
        cursor: pointer;
    }

    .slot.available:hover {
        background: #218838;
    }

    .slot.booked {
        background: #dc3545;
        color: white;
    }

    .slot.disabled {
        background: #f5f5f5 !important;
        color: #9b9b9b !important;
        text-decoration: line-through;
        cursor: not-allowed;
        opacity: 0.6;
    }

    .slot.partial {
        background: #ffd54f;
        /* sárga */
        color: #222;
    }

    .slot.booked,
    .slot.partial {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        color: #fff;
        border-radius: 8px;
        padding: 4px;
        font-size: 0.9rem;
        line-height: normal;
    }

    .slot-time {
        font-weight: 700;
        font-size: 0.9rem;
        margin-bottom: 2px;
    }

    .slot-names {
        font-size: 0.8rem;
        opacity: 0.95;
        overflow: hidden;
        text-overflow: ellipsis;
        word-break: break-word;
        white-space: nowrap;
        max-width: 95%;
        text-align: center;
        line-height: 1.2;
    }

    .day-slots div {
        padding: 8px;
        margin: 4px 0;
        border-radius: 5px;
        text-align: center;
    }

    .available {
        background: #28a745;
        color: white;
        cursor: pointer;
    }

    .available:hover {
        background: #218838;
    }

    .booked {
        background: #dc3545;
        color: white;
    }

    .disabled {
        background: #f0f0f0;
        color: #aaa;
        text-decoration: line-through;
    }

    #hirdetotabla {
        grid-template-columns: 1fr;
    }

    .note {
        width: 100%;
        min-height: 200px;
    }

    .settings-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 10px;
        font-size: 14px;
    }

    .modal-buttons button {
        width: 100%;
        margin-bottom: 10px;
    }
}

/* 💻 Desktopon ne látszódjon az időpont a foglalt cellákban */
@media (min-width: 769px) {
    .slot-time {
      display: none;
    }
  }  

/* ---- Animáció ---- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}