.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    justify-items: center;
}

/* ОДНАКОВІ КАРТКИ */
.media-item {
    width: 100%;
    max-width: 320px;
    height: 260px;              /* фіксована висота */
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
    overflow: hidden;

    display: flex;
    align-items: center;        /* вертикальне центрування фото */
    justify-content: center;    /* горизонтальне центрування */
    position: relative;
}

/* ФОТО БЕЗ ОБРІЗАННЯ */
.media-item img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;        /* ключове */
}

/* ================= ROOMS PAGE ================= */

.rooms-page {
    padding: 60px 0;
    background: #f4f4f4;
}

/* Заголовок сторінки */
.rooms-title {
    text-align: center;
    font-size: 32px;
    margin-bottom: 40px;
    color: #0b3c6d;
}

/* Підзаголовки типів */
.rooms-type-title {
    font-size: 24px;
    margin: 40px 0 25px;
    color: #0b3c6d;
    border-left: 5px solid #f9b233;
    padding-left: 15px;
}

/* Сітка */
.rooms-list {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    justify-content: flex-start;
}

/* Картка приміщення */
.room-item {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
    padding: 20px;
    position: relative;
    flex: 1 1 calc(25% - 25px); /* 4 картки в ряд */
    max-width: calc(25% - 25px);
    transition: transform 0.3s ease;
}

.room-item:hover {
    transform: translateY(-5px);
}
 /* ===== ROOMS ADMIN BUTTONS (ALWAYS VISIBLE & NO OVERLAP) ===== */


/* окремий клас тільки для rooms */
.room-admin-buttons {
    position: static !important;   /* НЕ absolute */
    display: flex;
    justify-content: flex-end;     /* справа */
    gap: 8px;
    margin-bottom: 10px;           /* ВІДСТУП від заголовка */

    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* щоб заголовок не ліз під кнопки */
.room-name {
    clear: both;
}

/* іконки */
.room-admin-buttons .icon-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
}

/* Назва приміщення */
.room-name {
    font-size: 20px;
    color: #222;
    margin-bottom: 8px;
}

/* Тип приміщення */
.room-type {
    display: inline-block;
    font-size: 15px;
    font-weight: bold;
    color: #f9b233;
    margin-bottom: 12px;
}

/* Опис */
.room-description {
    font-size: 15px;
    color: #555;
    line-height: 1.5;
    margin-bottom: 12px;
}

/* Відповідальний */
.room-worker {
    font-size: 16px;
    color: #0b3c6d;
}

.room-worker span {
    font-weight: 600;
}

/* Повідомлення, якщо немає даних */
.rooms-empty {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #555;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    max-width: 600px;
    margin: 0 auto;
}
 /* Кнопка дій адміністратора */
.rooms-actions {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 30px;
}

.rooms-add-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;

    background: #f9b233;
    color: #000;
    text-decoration: none;
    font-weight: bold;
    border-radius: 8px;

    transition: background 0.3s ease, transform 0.2s ease;
}

.rooms-add-btn:hover {
    background: #f9b203;
    transform: translateY(-2px);
}

/* ===== FORM ADD ROOM ===== */

.room-form {
    max-width: 600px;
    margin: 0 auto;
    background: #ffffff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
}

.room-form-group {
    margin-bottom: 20px;
}

.room-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #0b3c6d;
}

.room-form-group input,
.room-form-group textarea,
.room-form-group select {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 14px;
}

.room-form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-start;
    margin-top: 25px;
}

.room-cancel-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    border-radius: 8px;
    background: #ccc;
    color: #333;
    text-decoration: none;
}

.room-cancel-btn:hover {
    background: #b5b5b5;
}


/* ================= ROOM VIEW (аналог profession-view) ================= */

.room-view {
    padding: 60px 0;
}

.room-title {
    font-size: 32px;
    margin-bottom: 25px;
    color: #0b3c6d;
}

.room-meta {
    margin-bottom: 15px;
    font-size: 20px;
    color: #0b3c6d;
}

.room-meta strong {
    font-weight: 600;
}

.room-description-box {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    line-height: 1.7;
    font-size: 20px;
}

/* Кнопки адміна як у profession */
.room-admin-actions {
    margin-bottom: 40px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

@media (max-width: 1200px) {
    .room-item {
        flex: 1 1 calc(33.333% - 25px); /* 3 в ряд */
        max-width: calc(33.333% - 25px);
    }
}

@media (max-width: 992px) {
    .room-item {
        flex: 1 1 calc(50% - 25px); /* 2 в ряд */
        max-width: calc(50% - 25px);
    }
}

/* ================= MOBILE ================= */

@media (max-width: 768px) {
    .rooms-list {
        justify-content: center;
    }

    .room-item {
        width: 100%;
        max-width: 400px;
    }

    .room-description,
    .room-worker {
        text-align: center;
    }

    .rooms-actions {
        justify-content: center;
    }
}
