/* Room Cards Styling for Regular Grid Layout */
.rooms-grid .room-card {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    background-color: #fff;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 650px; /* Extended height for better spacing */
    transform: translateY(0);
}

.rooms-grid .room-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.12);
}

.rooms-grid .room-images {
    position: relative;
    height: 250px;
    overflow: hidden;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    flex-shrink: 0;
}

.rooms-grid .room-images::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    z-index: 2;
    pointer-events: none;
}

.rooms-grid .room-images img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.8s ease, transform 1.2s ease;
    transform: scale(1.05);
}

.rooms-grid .room-images img.active {
    opacity: 1;
    transform: scale(1);
}

.rooms-grid .room-info {
    padding: 20px;
    position: relative;
    background: linear-gradient(to bottom, #fff, #f9f9f9);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.rooms-grid .room-info h3 {
    font-size: 1.6rem;
    margin-bottom: 12px;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 12px;
    letter-spacing: 0.5px;
}

.rooms-grid .room-info h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(to right, var(--secondary-color), transparent);
}

.rooms-grid .room-info p {
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 4; 
    line-clamp: 4; /* Standard property for compatibility */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
    height: 85px;
}

.rooms-grid .room-amenities {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    border-top: 1px solid rgba(0,0,0,0.05);
    padding-top: 15px;
}

.rooms-grid .room-amenities span {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 20, 64, 0.05);
    color: var(--primary-color);
    border-radius: 50%;
    font-size: 16px;
    transition: all 0.3s ease;
}

.rooms-grid .room-card:hover .room-amenities span {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    transform: scale(1.1);
}

/* Button styling for room cards */
.rooms-grid .room-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 20px; /* Equal spacing on top */
    padding-bottom: 20px; /* Equal spacing on bottom */
    margin-bottom: 10px; /* Add margin at bottom for more space */
    border-top: 1px dashed rgba(0,0,0,0.05);
    width: 100%;
}

.rooms-grid .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color);
    color: white;
    padding: 10px 16px;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.85rem;
    text-align: center;
    width: calc(50% - 5px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.rooms-grid .btn-secondary:hover {
    background-color: var(--secondary-color);
    color: var(--dark-bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.rooms-grid .whatsapp-room-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #25D366;
    color: white;
    padding: 10px 16px;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.85rem;
    text-align: center;
    width: 100%;
    margin-top: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
}

.rooms-grid .whatsapp-room-btn:hover {
    background-color: #20c15c;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.rooms-grid .whatsapp-room-btn i {
    margin-right: 8px;
    font-size: 16px;
}

/* Updated navigation buttons styling */
.room-nav-btn {
    position: fixed;
    top: 50%; /* Position in the middle of viewport */
    transform: translateY(-50%);
    background: rgba(0, 20, 64, 0.7);
    color: var(--secondary-color);
    border: 1px solid var(--secondary-color);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 18px;
    z-index: 100;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    opacity: 0.8; /* Start with slightly transparent buttons */
}

.prev-room {
    left: 20px; /* Position on the left edge of screen */
}

.next-room {
    right: 20px; /* Position on the right edge of screen */
}

.room-nav-btn:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    transform: translateY(-50%) scale(1.1); /* Keep vertical centering while scaling */
    opacity: 1; /* Full opacity on hover */
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3); /* Enhanced shadow on hover */
}

/* Responsive adjustments for grid layout */
@media (max-width: 1100px) {
    .rooms-grid .room-card {
        height: 630px;
    }
}

@media (max-width: 900px) {
    .rooms-grid .room-card {
        height: 650px;
    }
}

@media (max-width: 768px) {
    .rooms-grid .room-card {
        height: auto; /* Automatically adjust height based on content */
        min-height: 620px; /* Set minimum height */
    }
    
    .rooms-grid .room-images {
        height: 220px;
    }
    
    .rooms-grid .room-info h3 {
        font-size: 1.4rem;
    }
    
    .rooms-grid .room-info p {
        height: auto; /* Auto height */
        min-height: 85px; /* Minimum height to maintain design */
        -webkit-line-clamp: 4;
        line-clamp: 4;
    }
    
    .rooms-grid .room-buttons {
        flex-direction: column;
        gap: 10px; /* Increased gap between buttons */
        padding: 15px 0; /* Equal padding top and bottom */
    }
    
    .rooms-grid .btn-secondary, 
    .rooms-grid .whatsapp-room-btn {
        width: 100%;
        justify-content: center;
        text-align: center;
        margin-top: 0;
        padding: 10px 16px; /* Larger touch target for mobile */
    }
    
    .rooms-grid .whatsapp-room-btn {
        margin-top: 0; /* Remove extra margin as we have gap */
    }
    
    .room-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .prev-room {
        left: 10px;
    }
    
    .next-room {
        right: 10px;
    }
}

@media (max-width: 480px) {
    .rooms-grid .room-card {
        height: auto; /* Let content determine height for smallest screens */
        min-height: 620px; /* Minimum height to maintain design */
    }
    
    .rooms-grid .room-images {
        height: 180px; /* Slightly smaller images */
    }
    
    .rooms-grid .room-info h3 {
        font-size: 1.3rem;
    }
    
    .rooms-grid .room-info p {
        font-size: 0.85rem;
        height: auto; /* Allow text to determine height */
        max-height: 105px; /* Maximum height */
        -webkit-line-clamp: 5;
        line-clamp: 5;
    }
    
    .rooms-grid .room-buttons {
        flex-direction: column;
        gap: 10px; /* Increased gap between buttons */
        padding-top: 15px;
        padding-bottom: 15px;
    }
    
    /* Improved nav buttons for small screens */
    .room-nav-btn {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
}
