/**
 * Стили модального окна просмотра номера
 * 
 * @package Hotel_Booking_System
 */

/* === МОДАЛЬНОЕ ОКНО === */
.room-details-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

.room-details-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(3px);
}

.room-details-modal .modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.room-details-modal .modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.room-details-modal .modal-close:hover {
    background: rgba(0,0,0,0.8);
}

.room-details-modal .modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 30px;
}

/* === ГАЛЕРЕЯ === */
.room-gallery {
    position: sticky;
    top: 20px;
}

.room-gallery .main-image {
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
    position: relative;
}

.room-gallery .main-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.room-gallery .image-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    pointer-events: none;
}

.room-gallery .image-nav button {
    pointer-events: auto;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s;
}

.room-gallery .image-nav button:hover {
    background: rgba(0,0,0,0.8);
}

.room-gallery .thumbnail-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.room-gallery .thumbnail-list img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.room-gallery .thumbnail-list img:hover,
.room-gallery .thumbnail-list img.active {
    border-color: #4CAF50;
}

/* === ИНФОРМАЦИЯ О НОМЕРЕ === */
.room-info {
    padding-right: 20px;
}

.room-title {
    font-size: 28px;
    margin: 0 0 15px 0;
    color: #333;
    font-weight: 700;
}

.room-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    color: #666;
    font-size: 14px;
    flex-wrap: wrap;
}

.room-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.room-description {
    color: #555;
    line-height: 1.6;
    margin-bottom: 25px;
    max-height: 200px;
    overflow-y: auto;
}

/* === ОСОБЕННОСТИ === */
.room-features {
    margin-bottom: 25px;
}

.room-features h3 {
    font-size: 18px;
    margin: 0 0 15px 0;
    color: #333;
    font-weight: 600;
}

.feature-group {
    margin-bottom: 20px;
}

.feature-group h4 {
    font-size: 14px;
    color: #666;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.feature-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-items li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 13px;
    color: #555;
    transition: background 0.2s;
}

.feature-items li:hover {
    background: #e8f5e9;
}

.feature-items li img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

/* === ТАРИФЫ === */
.room-tariffs {
    margin-bottom: 25px;
}

.room-tariffs h3 {
    font-size: 18px;
    margin: 0 0 15px 0;
    color: #333;
    font-weight: 600;
}

.tariff-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    cursor: pointer;
}

.tariff-card:hover {
    border-color: #4CAF50;
    box-shadow: 0 2px 10px rgba(76, 175, 80, 0.2);
}

.tariff-card.selected {
    border-color: #4CAF50;
    background: #f0fff4;
}

.tariff-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.tariff-description {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
    line-height: 1.4;
}

.tariff-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.tariff-price-per-night {
    font-size: 14px;
    color: #666;
}

.tariff-price-total {
    font-size: 20px;
    font-weight: 700;
    color: #4CAF50;
}

/* === КНОПКИ ДЕЙСТВИЙ === */
.modal-actions {
    display: flex;
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.modal-actions .button {
    flex: 1;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-actions .button-primary {
    background: #4CAF50;
    color: #fff;
    border: none;
}

.modal-actions .button-primary:hover {
    background: #45a049;
    transform: translateY(-1px);
}

.modal-actions .button-secondary {
    background: #fff;
    color: #666;
    border: 1px solid #ddd;
}

.modal-actions .button-secondary:hover {
    background: #f5f5f5;
}

/* === АДАПТИВНОСТЬ === */
@media (max-width: 768px) {
    .room-details-modal .modal-body {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 20px;
    }
    
    .room-gallery {
        position: static;
    }
    
    .room-gallery .main-image img {
        height: 250px;
    }
    
    .room-title {
        font-size: 22px;
    }
    
    .room-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .feature-items {
        grid-template-columns: 1fr;
    }
}

/* Loading overlay */
.modal-body.loading-state {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 8px;
}

.loading-spinner {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #666;
    font-size: 14px;
}

.loading-spinner::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #f0f0f0;
    border-top-color: #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}