/* ========================================================================
   CUSTOM CSS FOR BAAN DUANG KWAN DOI RESORT (REVISED & OPTIMIZED)
   ======================================================================== */

/* --- 1. Homepage: Animated Feature Box --- */
.animated-feature-box {
    position: relative;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); /* CORRECTED */
    overflow: hidden;
    color: #ffffff;
    
    background-size: cover; /* RECOMMENDED */
    background-position: center center; /* RECOMMENDED */
    background-attachment: fixed;
    background-image: 
        /* Layer 1: Vignette Effect */
        radial-gradient(ellipse at center, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0) 60%),
        /* Layer 2: Background Image */
        url('/images/bg001.webp');
}

.animated-feature-title h2 {
    margin-bottom: 30px;
    font-size: 2rem;
    color: #ffffff;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
    height: 100px; 
}

.feature-item {
    position: absolute;
    width: 100%;
    left: 0;
    top: 0;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    animation-name: fadeInOut;
    animation-duration: 16s;
    animation-iteration-count: infinite;
}

.feature-item h3 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.feature-item p {
    font-size: 1.2rem;
    color: #f0f0f0; 
    margin: 0;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

@keyframes fadeInOut {
    0%    { opacity: 0; }
    6.25% { opacity: 1; }
    25%   { opacity: 1; }
    31.25%{ opacity: 0; }
    100%  { opacity: 0; }
}

.feature-item:nth-child(1) { animation-delay: 0s; }
.feature-item:nth-child(2) { animation-delay: 4s; }
.feature-item:nth-child(3) { animation-delay: 8s; }
.feature-item:nth-child(4) { animation-delay: 12s; }


/* --- 2. Homepage: Featured Rooms Card (Pastel Green Theme) --- */
.room-card {
    position: relative;
    height: 400px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    cursor: pointer;
}

.room-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.room-card:hover .room-card-img {
    transform: scale(1.1);
}

.room-card-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    align-items: flex-end;
    padding: 25px;
    color: #1a4d2e;
    background: linear-gradient(to top, rgba(212, 230, 219, 0.8) 0%, rgba(240, 247, 242, 0.2) 50%, rgba(212, 230, 219, 0.8) 100%);
    transition: background 0.4s ease;
}

.room-card:hover .room-card-overlay {
    background: linear-gradient(to top, rgba(212, 230, 219, 0.95) 0%, rgba(240, 247, 242, 0.3) 100%);
}

.room-card-content { width: 100%; }
.room-card-title { font-size: 2rem; margin-bottom: 5px; font-weight: bold; }

.room-card-details {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, opacity 0.5s ease 0.1s;
}

.room-card:hover .room-card-details { max-height: 150px; opacity: 1; }
.room-card-details p { font-size: 0.9rem; line-height: 1.5; margin-bottom: 15px; }

.room-card .btn-light {
    background-color: #1a4d2e;
    color: #ffffff;
    border: none;
    transition: background-color 0.3s ease;
}

.room-card .btn-light:hover { background-color: #4f6f52; }


/* --- 3. Facilities Page Card Style --- */
/* This style was renamed from amenity-card to facility-card in HTML, but CSS is compatible */
.amenity-card, .facility-card {
    position: relative;
    height: 300px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
    cursor: pointer;
    background-color: #e9ecef;
}

.amenity-card-img, .facility-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.amenity-card:hover .amenity-card-img,
.facility-card:hover .facility-card-img {
    transform: scale(1.1);
}

.amenity-card-overlay, .facility-card-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    color: #ffffff;
    background-color: rgba(181, 192, 208, 0.3);
    transition: background-color 0.4s ease;
}

.amenity-card:hover .amenity-card-overlay,
.facility-card:hover .facility-card-overlay {
    background-color: rgba(94, 114, 145, 0.75);
}

.amenity-card-content, .facility-card-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.amenity-card-title, .amenity-card-details,
.facility-card-title, .facility-card-details {
    position: absolute;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.amenity-card-title, .facility-card-title {
    opacity: 1;
    transform: translateY(0);
    font-size: 1.8rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.amenity-card-details, .facility-card-details {
    opacity: 0;
    transform: translateY(20px);
}

.amenity-card:hover .amenity-card-title,
.facility-card:hover .facility-card-title {
    opacity: 0;
    transform: translateY(-20px);
}

.amenity-card:hover .amenity-card-details,
.facility-card:hover .facility-card-details {
    opacity: 1;
    transform: translateY(0);
}

.amenity-card-details i, .facility-card-details i { font-size: 3rem; margin-bottom: 15px; }
.amenity-card-details p, .facility-card-details p { margin: 0; font-size: 1rem; text-shadow: 1px 1px 3px rgba(0,0,0,0.7); }


/* --- 4. Building Showcase Page Style (Room List) --- */
.room-showcase-card-link { text-decoration: none; display: block; }

.room-showcase-card {
    height: 350px;
    border-radius: 15px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.room-showcase-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.2); }
.room-showcase-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 60%); display: flex; flex-direction: column; justify-content: flex-end; padding: 20px; text-align: left; }
.room-showcase-content { color: #fff; transform: translateY(10px); transition: transform 0.4s ease; }
.room-showcase-card:hover .room-showcase-content { transform: translateY(0); }
.room-showcase-content h3 { font-size: 1.8rem; margin-bottom: 5px; text-shadow: 2px 2px 4px rgba(0,0,0,0.7); }
.room-showcase-content p { margin-bottom: 15px; opacity: 0.8; }
.room-showcase-content .btn { opacity: 0; transition: opacity 0.4s ease; }
.room-showcase-card:hover .room-showcase-content .btn { opacity: 1; }


/* --- 5. Single Room Page: Expanding Gallery --- */
.expanding-gallery { display: flex; width: 100%; height: 500px; gap: 10px; }
.gallery-card { position: relative; flex: 0.5; border-radius: 15px; background-size: cover; background-position: center; cursor: pointer; overflow: hidden; transition: flex 0.7s ease-in-out; }
.gallery-card.active { flex: 5; }
.gallery-card h3 { position: absolute; bottom: 20px; left: 20px; color: white; font-size: 1.2rem; margin: 0; opacity: 0; text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8); transition: opacity 0.3s ease-in-out; writing-mode: vertical-rl; transform: rotate(180deg); }
.gallery-card.active h3 { opacity: 1; transition-delay: 0.5s; writing-mode: horizontal-tb; transform: rotate(0deg); }


/* --- 6. Single Room Page: Sidebar & Booking Form --- */
.price-tag-wrapper { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid #dee2e6; text-align: right; }
.price-tag { display: inline-block; }
.price-tag .price-amount { font-size: 2.5rem; font-weight: 700; color: #0d6efd; margin-right: 5px; }
.price-tag .price-unit { font-size: 1rem; color: #6c757d; font-weight: 500; }

.google-form-container { max-height: 0; opacity: 0; overflow: hidden; transition: all 0.6s ease-in-out; margin-top: 40px; }
.google-form-container.visible { max-height: 1200px; opacity: 1; }
.google-form-wrapper { position: relative; background-color: #f8f9fa; border: 1px solid #dee2e6; border-radius: 15px; padding: 30px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); text-align: center; }
.google-form-wrapper h3 { font-weight: bold; color: #333; }
.google-form-wrapper p { color: #6c757d; margin-bottom: 20px; }
.btn-close-form { position: absolute; top: 15px; right: 15px; background: #e9ecef; border: none; border-radius: 50%; width: 35px; height: 35px; font-size: 1.5rem; line-height: 1; color: #6c757d; cursor: pointer; transition: all 0.3s ease; }
.btn-close-form:hover { background: #dc3545; color: #fff; transform: rotate(90deg); }
.iframe-wrapper { border: 1px solid #ccc; border-radius: 10px; overflow: hidden; }


/* --- 7. Promotions Page: Flip Card --- */
.promo-card-flipper { perspective: 1000px; height: 350px; }
.promo-card { position: relative; width: 100%; height: 100%; transition: transform 0.8s; transform-style: preserve-3d; box-shadow: 0 10px 25px rgba(0,0,0,0.1); border-radius: 15px; }
.promo-card-flipper:hover .promo-card { transform: rotateY(180deg); }
.promo-card-front, .promo-card-back { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; border-radius: 15px; overflow: hidden; }
.promo-card-front img { width: 100%; height: 100%; object-fit: cover; }
.promo-badge { position: absolute; top: 15px; right: -25px; background-color: #ffc107; color: #333; padding: 5px 30px; font-weight: bold; transform: rotate(45deg); box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.promo-card-back { background-color: #fdfaf6; color: #5c554a; transform: rotateY(180deg); display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 20px; }
.promo-card-back h3 { font-size: 1.8rem; color: #b98f58; margin-bottom: 15px; }
.promo-validity { font-size: 0.8rem; font-style: italic; margin-top: 20px; opacity: 0.8; }
.promo-btn { background-color: #b98f58; color: #fff; padding: 10px 25px; border-radius: 50px; text-decoration: none; font-weight: bold; margin-top: 15px; transition: background-color 0.3s ease; }
.promo-btn:hover { background-color: #8c6d44; color: #fff; }


/* --- 8. Contact Page & Other Shared Styles --- */
.contact-details-box { background-color: #f8f9fa; padding: 30px; border-radius: 15px; height: 100%; box-shadow: 0 8px 15px rgba(0,0,0,0.05); }
.contact-details-box h4 { font-weight: 600; margin-bottom: 25px; }
.contact-details-box ul li { display: flex; align-items: center; margin-bottom: 20px; }
.contact-details-box .contact-icon { flex-shrink: 0; width: 50px; height: 50px; border-radius: 50%; background-color: #e9ecef; display: flex; justify-content: center; align-items: center; margin-right: 15px; font-size: 1.2rem; color: #495057; }
.contact-details-box ul li a { text-decoration: none; color: inherit; transition: color 0.3s ease; }
.contact-details-box ul li a:hover { color: #0d6efd; }
.map-container { border-radius: 15px; overflow: hidden; height: 100%; min-height: 450px; box-shadow: 0 8px 15px rgba(0,0,0,0.05); }

.faq-section .accordion-item { border: 1px solid #dee2e6; border-radius: 10px !important; margin-bottom: 15px; overflow: hidden; }
.faq-section .accordion-button { font-weight: 600; color: #343a40; }
.faq-section .accordion-button:not(.collapsed) { background-color: #e7f1ff; color: #0a58ca; box-shadow: none; }
.faq-section .accordion-button:focus { box-shadow: none; border: none; }


/* --- 9. Bedroom Showcase Card (Baan Phor Page) --- */
.bedroom-card { position: relative; height: 250px; border-radius: 15px; overflow: hidden; cursor: pointer; box-shadow: 0 5px 15px rgba(0,0,0,0.1); transition: all 0.4s ease; }
.bedroom-card:hover { transform: translateY(-10px); box-shadow: 0 15px 30px rgba(0,0,0,0.2); }
.bedroom-card img { width: 100%; height: 100%; object-fit: cover; }
.bedroom-card-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 70%); display: flex; flex-direction: column; justify-content: flex-end; padding: 20px; color: #fff; text-align: center; }
.bedroom-card-overlay h3 { margin: 0; font-size: 1.5rem; font-weight: bold; }
.bedroom-card-overlay p { margin: 0; opacity: 0; transition: opacity 0.4s ease; }
.bedroom-card:hover .bedroom-card-overlay p { opacity: 1; }

.modal-content { border-radius: 15px; overflow: hidden; }
.modal-body { padding: 0; }
.modal-xl .carousel-inner img { height: 80vh; object-fit: cover; }


/* --- 10. Global Animation on Scroll (Consolidated) --- */
.featured-rooms-section .room-card,
.facilities-section .facility-card,
.promotions-section .promo-card-flipper,
.contact-us-section .row, 
.contact-us-section .faq-section,
.bedroom-showcase .bedroom-card {
    opacity: 0;
    transform: translateY(50px);
    animation: fadeInUp 0.8s ease forwards;
}

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


/* --- 11. Responsive Fixes --- */
@media (max-width: 767px) {
    .animated-feature-box { padding: 30px; }
    .animated-feature-title h2 { font-size: 1.5rem; }
    .feature-list { height: 120px; }
    .feature-item h3 { font-size: 2rem; }
    .feature-item p { font-size: 1rem; }
}

/* --- Linkable Bedroom Card Style --- */
a.bedroom-card-link {
    text-decoration: none;
    display: block;
    color: inherit;
}


/* --- NEW: Hero Parallax Style for Villa Page สำหรับบ้านพ่อ --- */
.hero-parallax-wrapper {
    position: relative;
    height: 60vh; /* ความสูงของ Hero Image (60% ของความสูงหน้าจอ) */
    width: 100%;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.hero-parallax-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center center;
    /* The magic for parallax effect */
    background-attachment: fixed; 
}

.hero-parallax-overlay {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #fff;
    /* Gradient overlay for text readability */
    background: linear-gradient(to top, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.1) 50%);
}

.hero-parallax-content {
    animation: fadeInHeroText 1.5s ease-out forwards;
}

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

.hero-parallax-content h1 {
    font-size: 4rem; /* ปรับขนาดได้ตามชอบ */
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.8);
}

.hero-parallax-content p {
    font-size: 1.5rem; /* ปรับขนาดได้ตามชอบ */
    font-weight: 300;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.7);
}

/* Responsive adjustments for mobile */
@media (max-width: 667px) {
    .hero-parallax-wrapper {
        height: 40vh; /* ลดความสูงบนมือถือ */
    }
    .hero-parallax-content h1 {
        font-size: 2.5rem;
    }
    .hero-parallax-content p {
        font-size: 1.2rem;
    }
    /* Disable parallax on mobile for better performance */
    .hero-parallax-image {
        background-attachment: scroll;
    }
}
/* --- รายละเอียดห้องย่อย บ้านพ่อ Elegant Masonry Gallery Style --- */
.masonry-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    grid-auto-rows: 250px;
    grid-auto-flow: dense; /* Magic for filling gaps */
    gap: 15px;
}

.masonry-item {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.masonry-item.item-wide {
    grid-column: span 2;
}

.masonry-item.item-tall {
    grid-row: span 2;
}

.masonry-item a {
    display: block;
    width: 100%;
    height: 100%;
}

.masonry-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, filter 0.5s ease;
}

.masonry-item:hover img {
    transform: scale(1.05);
    filter: brightness(0.8);
}

.masonry-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    color: #fff;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.masonry-item:hover .masonry-item-overlay {
    opacity: 1;
    transform: translateY(0);
}

.masonry-item-overlay span {
    font-weight: 600;
    font-size: 1.1rem;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}



/* --- Elegant Floor Takeover Page Style --- */

/* 1. Video Hero Section */
.floor-takeover-hero {
    position: relative;
    height: 70vh; /* ความสูงของวิดีโอ */
    width: 100%;
    overflow: hidden;
}

.floor-takeover-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translateX(-50%) translateY(-50%);
    z-index: 1;
}

.floor-takeover-overlay {
    position: relative;
    z-index: 2;
    height: 100%;
    background: rgba(26, 77, 46, 0.4); /* สีเขียวเข้มโปร่งแสง (Emerald) */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
}

.floor-takeover-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
}
.floor-takeover-content p {
    font-size: 1.5rem;
    font-weight: 300;
}

/* 2. Feature Tabs Section */
.feature-tabs-section .nav-tabs {
    border-bottom: 2px solid #dee2e6;
}

.feature-tabs-section .nav-link {
    color: #495057;
    font-weight: 600;
    border: none;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.feature-tabs-section .nav-link.active,
.feature-tabs-section .nav-link:hover {
    color: #4f6f52; /* สีเขียวเข้ม (Emerald) */
    border-bottom: 2px solid #4f6f52;
}

.feature-tabs-section .tab-content {
    padding: 30px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 15px 15px;
}


/* --- Style for Floor Divider อาคาร C ชั้น 2 เหมาชั้น--- */
.floor-divider {
    border-bottom: 2px solid #eee;
    margin-bottom: 2rem !important;
    padding-bottom: 1rem;
}
.floor-divider h2 {
    font-size: 1.8rem;
    color: #495057;
}

/* --- Style for Takeover Promo Card --- */
.takeover-promo-card-link {
    text-decoration: none;
    display: block;
}
.takeover-promo-card {
    background: linear-gradient(135deg, #4f6f52 0%, #1a4d2e 100%); /* Emerald Green Gradient */
    color: #fff;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.takeover-promo-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}
.takeover-promo-card h3 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}
.takeover-promo-card p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}
.takeover-promo-card .btn-warning {
    font-weight: bold;
    padding: 12px 30px;
}