/* ==========================================================================
   Rooms Page Styles - 房型設施頁面樣式
   ========================================================================== */

/* Hero Section - 使用 core.css 的基礎樣式，只覆寫必要部分 */
.hero-section {
    padding: 6rem 0 4rem;
}





/* Main Content */
.rooms-main {
    padding: 4rem 0;
}

/* Rooms Section */
.rooms-section {
    margin-bottom: 6rem;
}

.rooms-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.room-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(124, 155, 181, 0.1);
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
    border: 1px solid rgba(184, 199, 214, 0.3);
    will-change: transform, box-shadow;
}

.room-card.animated {
    will-change: auto;
}

.room-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 48px rgba(124, 155, 181, 0.15);
}

/* 優化圖片載入 */
.gallery-item img.lazyload {
    opacity: 0;
    filter: blur(5px);
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.gallery-item img.lazyloaded {
    opacity: 1;
    filter: blur(0);
}

/* Lightbox 優化樣式 */
.lightbox-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: white;
    display: none;
}

.lightbox-image {
    transition: opacity 0.3s ease;
}

.lightbox-counter {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* 禁用的導航按鈕 */
.lightbox-prev:disabled,
.lightbox-next:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.room-card.featured {
    border: 2px solid var(--primary-color);
}

.room-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

/* Room Gallery */
.room-gallery {
    position: relative;
    height: 280px;
    overflow: hidden;
}

.gallery-item {
    display: none;
}

.gallery-item:first-child {
    display: block;
}

.room-main-image {
    width: 100%;
    height: 100%;
    position: relative;
}

.room-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.room-card:hover .room-main-image img {
    transform: scale(1.05);
}

.room-thumbnails {
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    gap: 0.5rem;
    z-index: 5;
}

.room-thumbnails img {
    width: 60px;
    height: 40px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid white;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.room-thumbnails img:hover,
.room-thumbnails img:focus {
    transform: scale(1.1);
    opacity: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Room Content */
.room-content {
    padding: 1.5rem;
}

.room-header {
    margin-bottom: 1rem;
}

.room-number {
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.room-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.room-title-en {
    color: var(--accent-color);
    font-size: 1rem;
    font-style: italic;
    margin-bottom: 1rem;
}

/* Room Features */
.room-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
}

.feature-tag {
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-light));
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Room Facilities */
.room-facilities {
    margin-bottom: 1.5rem;
}

.room-facilities h4 {
    font-family: 'Playfair Display', serif;
    font-size: 1.125rem;
    color: var(--text-dark);
    margin-bottom: 0.8rem;
    border-bottom: 2px solid var(--accent-light);
    padding-bottom: 0.4rem;
}

.room-facilities ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.room-facilities li {
    padding: 0.3rem 0;
    position: relative;
    padding-left: 1.5rem;
    color: var(--text-color);
    line-height: 1.5;
    font-size: 0.9rem;
}

.room-facilities li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

/* Amenities Section */
.amenities-section {
    background: linear-gradient(135deg, #f8f9fb, #ffffff);
    padding: 4rem 0;
    margin-bottom: 4rem;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    text-align: center;
    color: var(--text-dark);
    margin-bottom: 3rem;
    position: relative;
}

.section-title:after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.amenities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.amenity-item {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(124, 155, 181, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(184, 199, 214, 0.2);
}

.amenity-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(124, 155, 181, 0.15);
}

.amenity-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 2rem;
}

.amenity-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.amenity-description {
    color: var(--text-color);
    line-height: 1.6;
}

/* CTA Section */
.cta-section {
    position: relative;
    padding: 6rem 0;
    text-align: center;
    overflow: hidden;
}

.cta-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.cta-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(124, 155, 181, 0.85), rgba(168, 184, 200, 0.75));
}

.cta-content {
    position: relative;
    z-index: 2;
    color: white;
}

.cta-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.cta-description {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Responsive Design */
@media (max-width: 992px) {
    .rooms-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .room-card {
        margin-bottom: 0;
    }
    
    .room-gallery {
        height: 240px;
    }
    
    .room-content {
        padding: 1.5rem;
    }
    
    .room-title {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .cta-title {
        font-size: 2rem;
    }
    
    .amenities-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 4rem 0 3rem;
    }
    
    .rooms-main {
        padding: 2rem 0;
    }
    
    .rooms-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .room-gallery {
        height: 220px;
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE 10+ */
        position: relative;
    }
    
    .room-gallery::-webkit-scrollbar {
        display: none; /* Webkit */
    }
    
    .gallery-item {
        display: block;
        flex: 0 0 100%;
        width: 100%;
        height: 100%;
        scroll-snap-align: start;
        position: relative;
    }
    
    .gallery-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    /* 滑動指示器容器 */
    .room-gallery .gallery-indicators {
        position: absolute;
        bottom: 15px;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        gap: 6px;
        z-index: 5;
        pointer-events: none;
    }
    
    .room-gallery .gallery-indicator {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background-color: rgba(255, 255, 255, 0.5);
        transition: background-color 0.3s ease;
    }
    
    .room-gallery .gallery-indicator.active {
        background-color: rgba(255, 255, 255, 0.9);
    }
    
    /* 圖片導航按鈕 - 手機版隱藏 */
    .room-gallery .gallery-nav {
        display: none;
    }
    
    .room-content {
        padding: 1rem;
    }
    
    .room-title {
        font-size: 1.25rem;
    }
    
    .room-title-en {
        font-size: 0.875rem;
    }
    
    .room-facilities h4 {
        font-size: 1.125rem;
    }
    
    .room-facilities li {
        font-size: 0.875rem;
        padding: 0.4rem 0;
        padding-left: 1.2rem;
    }
    
    .room-facilities li:before {
        font-size: 0.875rem;
    }
    
    .feature-tag {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
    
    .room-thumbnails {
        bottom: 10px;
        left: 10px;
        gap: 0.25rem;
    }
    
    .room-thumbnails img {
        width: 50px;
        height: 35px;
    }
    
    .room-badge {
        top: 15px;
        right: 15px;
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .amenities-section {
        padding: 3rem 0;
    }
    
    .amenities-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .amenity-item {
        padding: 1.5rem;
    }
    
    .amenity-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .amenity-title {
        font-size: 1.25rem;
    }
    
    .cta-section {
        padding: 4rem 0;
    }
    
    .cta-title {
        font-size: 1.75rem;
    }
    
    .cta-description {
        font-size: 1.125rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .rooms-grid {
        gap: 1rem;
    }
    
    .room-gallery {
        height: 200px;
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .room-gallery::-webkit-scrollbar {
        display: none;
    }
    
    .gallery-item {
        display: block;
        flex: 0 0 100%;
        width: 100%;
        height: 100%;
        scroll-snap-align: start;
    }
    
    .gallery-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .room-thumbnails {
        display: none;
    }
    
    .room-badge {
        top: 10px;
        right: 10px;
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .cta-title {
        font-size: 1.5rem;
    }
    
    .cta-description {
        font-size: 1rem;
    }
    
    .room-facilities li {
        font-size: 0.8rem;
        padding-left: 1.1rem;
    }
    
    .room-facilities li:before {
        font-size: 0.8rem;
    }
}

/* Animation Enhancements */
.room-card {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
}

.room-card:nth-child(1) { animation-delay: 0.1s; }
.room-card:nth-child(2) { animation-delay: 0.2s; }
.room-card:nth-child(3) { animation-delay: 0.3s; }
.room-card:nth-child(4) { animation-delay: 0.4s; }
.room-card:nth-child(5) { animation-delay: 0.5s; }
.room-card:nth-child(6) { animation-delay: 0.6s; }

/* 當頁面載入時有房間錨點，確保目標房間立即可見 */
.room-card:target {
    animation: none;
    opacity: 1;
    transform: none;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Gallery Interaction */
.room-gallery {
    cursor: pointer;
}

.room-gallery img {
    transition: all 0.3s ease;
}

.room-gallery:focus,
.room-gallery img:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

.room-gallery:focus img,
.room-gallery img:focus {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(124, 155, 181, 0.3);
}

.room-gallery::after {
    content: '查看更多圖片';
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.room-gallery:hover::after,
.room-gallery:focus::after {
    opacity: 1;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .room-card {
        animation: none;
        opacity: 1;
        transform: none;
    }
    
    .room-card:hover {
        transform: none;
    }
    
    .amenity-item:hover {
        transform: none;
    }
}

/* Room Highlight Effect - 房間高亮效果 */
.room-card.highlighted {
    animation: roomHighlight 1s ease-in-out;
    animation-fill-mode: both;
    border: 3px solid var(--primary-color);
    box-shadow: 0 8px 32px rgba(124, 155, 181, 0.3), 
                0 0 0 4px rgba(124, 155, 181, 0.1);
}

@keyframes roomHighlight {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 16px rgba(124, 155, 181, 0.1);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 12px 40px rgba(124, 155, 181, 0.4), 
                    0 0 0 8px rgba(124, 155, 181, 0.15);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 8px 32px rgba(124, 155, 181, 0.3), 
                    0 0 0 4px rgba(124, 155, 181, 0.1);
    }
}

/* 手機版響應式優化 - 禁用所有動畫和過渡效果 */
@media (max-width: 768px) {
    /* 禁用房間卡片入場動畫 - 必須放在最後確保優先級 */
    .room-card {
        animation: none;
        opacity: 1;
        transform: none;
        transition: none; /* 禁用過渡效果，防止閃爍 */
    }
    
    .room-card:nth-child(1),
    .room-card:nth-child(2),
    .room-card:nth-child(3),
    .room-card:nth-child(4),
    .room-card:nth-child(5),
    .room-card:nth-child(6) {
        animation: none;
        animation-delay: 0s;
        opacity: 1;
        transform: none;
        transition: none;
    }
    
    /* 禁用房間卡片內部元素的過渡效果 */
    .room-main-image img {
        transition: none;
    }
    
    .room-thumbnails img {
        transition: none;
    }
    
    .room-gallery img {
        transition: none;
    }
    
    .room-gallery::after {
        transition: none;
    }
    
    .room-gallery .gallery-indicator {
        transition: none;
    }
    
    .room-card.highlighted {
        /* 禁用高亮動畫，僅保留視覺效果 */
        animation: none;
        border: 2px solid var(--primary-color);
        box-shadow: 0 6px 24px rgba(124, 155, 181, 0.3), 
                    0 0 0 3px rgba(124, 155, 181, 0.1);
        transform: none;
        transition: none; /* 關鍵：禁用高亮狀態變化的過渡 */
    }
} 