﻿/* 宿舍環境 (Environment UI) 改版樣式 */

.env-page-container {
    width: 72%;
    max-width: 1440px;
    /* 避免被頂部 fixed-top 導覽列 (桌面版高 7rem) 遮蔽，計算保留導覽列下方間距 (已扣除 body 內建的 padding-top: 50px) */
    margin: calc(7rem - 50px + 28px) auto 40px auto;
    padding: 0 15px;
}

@media (max-width: 1200px) {
    .env-page-container {
        width: 82%;
        /* 平板與手機版導覽列 height 為 auto (約 56px)，縮小頂部間距 */
        margin-top: 24px;
    }
}

@media (max-width: 992px) {
    .env-page-container {
        width: 90%;
        padding: 0 10px;
    }
}

@media (max-width: 768px) {
    .env-page-container {
        width: 96%;
        padding: 0 5px;
    }
}

.env-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.env-header h2 {
    font-size: 1.85rem;
    font-weight: 800;
    color: #2D3748;
    margin: 0;
    letter-spacing: 0.5px;
}

/* 暖色系/淡米黃卡片背景框 */
.env-card {
    background: #FAF7F2;
    border: 1px solid #EDE6DC;
    border-radius: 16px;
    padding: 24px 28px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
}

/* 三層選籤切換區 */
.env-nav-section {
    margin-bottom: 22px;
}

.env-tier {
    margin-bottom: 12px;
    border-bottom: 1px solid #E8DFD3;
    padding-bottom: 4px;
}

.env-tier:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.env-tier-label {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #8C7B6D;
    text-transform: uppercase;
    margin-right: 12px;
    vertical-align: middle;
}

.env-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.env-tab-btn {
    background: transparent;
    border: none;
    outline: none;
    padding: 8px 18px;
    font-size: 1rem;
    font-weight: 600;
    color: #555555;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease-in-out;
    position: relative;
    text-decoration: none;
    white-space: nowrap;
}

.env-tab-btn:hover {
    color: #2E7D32;
    background-color: rgba(46, 125, 50, 0.08);
}

/* 第一層：校區 */
.env-tier-campus .env-tab-btn {
    font-size: 1.15rem;
    font-weight: 700;
    padding: 8px 22px;
}

.env-tier-campus .env-tab-btn.active {
    color: #1B5E20;
    font-weight: 800;
    background-color: #E8F5E9;
    box-shadow: 0 2px 4px rgba(46, 125, 50, 0.12);
}

.env-tier-campus .env-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 15%;
    width: 70%;
    height: 3px;
    background-color: #2E7D32;
    border-radius: 2px;
}

/* 第二層：宿舍棟別 */
.env-tier-dorm .env-tab-btn {
    font-size: 1.02rem;
    font-weight: 600;
    padding: 6px 18px;
}

.env-tier-dorm .env-tab-btn.active {
    color: #2E7D32;
    font-weight: 700;
    border-bottom: 2px solid #2E7D32;
    border-radius: 4px 4px 0 0;
    background-color: rgba(46, 125, 50, 0.06);
}

/* 第三層：空間類別（個人區域 / 公共區域） */
.env-tier-space .env-tab-btn {
    font-size: 0.95rem;
    font-weight: 600;
    padding: 5px 16px;
    border-radius: 20px;
    background-color: #EFE9DF;
    color: #665C54;
}

.env-tier-space .env-tab-btn.active {
    background-color: #2E7D32;
    color: #FFFFFF;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(46, 125, 50, 0.25);
}

/* 中心輪播區 (Slideshow) */
.env-slideshow-wrapper {
    position: relative;
    background: #FFFFFF;
    border-radius: 14px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.05);
    padding: 16px;
    margin-top: 10px;
}

.env-slideshow-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    max-height: min(650px, 68vh);
    min-height: 280px;
    background-color: #1A1A1A;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-in;
}

.env-slide-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: opacity 0.35s ease-in-out, transform 0.3s ease;
    user-select: none;
}

.env-slideshow-viewport:hover .env-slide-img {
    transform: scale(1.015);
}

/* 輪播導航箭頭按鈕 (綠色按鈕) */
.env-arrow-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.92);
    border: 1.5px solid #A5D6A7;
    color: #2E7D32;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
    transition: all 0.2s ease;
    z-index: 10;
    outline: none;
}

.env-arrow-btn:hover {
    background-color: #2E7D32;
    color: #FFFFFF;
    border-color: #2E7D32;
    transform: translateY(-50%) scale(1.08);
}

.env-arrow-left {
    left: 14px;
}

.env-arrow-right {
    right: 14px;
}

/* 相片張數標籤 */
.env-photo-badge {
    position: absolute;
    top: 12px;
    right: 14px;
    background-color: rgba(0, 0, 0, 0.65);
    color: #FFFFFF;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    backdrop-filter: blur(4px);
    z-index: 5;
}

/* 底部相片標題 */
.env-photo-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2D3748;
    text-align: center;
    margin: 16px 0 10px 0;
    min-height: 1.8rem;
    letter-spacing: 0.3px;
}

/* 底部指示圓點 (Dots Indicator) */
.env-dots-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.env-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #4CAF50; /* 預設綠色 */
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.25s ease;
}

.env-dot:hover {
    transform: scale(1.2);
    background-color: #66BB6A;
}

.env-dot.active {
    background-color: #FF7A00; /* 當前為橘色 */
    transform: scale(1.3);
    box-shadow: 0 2px 6px rgba(255, 122, 0, 0.4);
}

/* 空狀態提示 */
.env-empty-notice {
    text-align: center;
    padding: 60px 20px;
    color: #8C7B6D;
}

.env-empty-notice i {
    font-size: 3rem;
    margin-bottom: 12px;
    color: #C2B5A5;
}

/* 燈箱 (Lightbox Modal) */
.env-lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.env-lightbox-overlay.active {
    display: flex;
}

.env-lightbox-close {
    position: absolute;
    top: 20px;
    right: 25px;
    background: transparent;
    border: none;
    color: #FFFFFF;
    font-size: 2.2rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.2s;
    z-index: 100001;
}

.env-lightbox-close:hover {
    opacity: 1;
    color: #FF7A00;
}

.env-lightbox-img-wrap {
    position: relative;
    max-width: 90vw;
    max-height: 82vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.env-lightbox-img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.6);
}

.env-lightbox-title {
    color: #FFFFFF;
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 14px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.env-lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #FFFFFF;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 100000;
}

.env-lightbox-nav-btn:hover {
    background: #2E7D32;
    border-color: #2E7D32;
}

.env-lightbox-prev {
    left: 20px;
}

.env-lightbox-next {
    right: 20px;
}

/* 響應式優化 */
@media (max-width: 768px) {
    .env-card {
        padding: 16px 14px;
    }

    .env-tier-campus .env-tab-btn {
        font-size: 1rem;
        padding: 6px 14px;
    }

    .env-slideshow-wrapper {
        padding: 10px;
    }

    .env-slideshow-viewport {
        min-height: 200px;
    }

    .env-arrow-btn {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }

    .env-photo-title {
        font-size: 1.1rem;
        margin: 12px 0 8px 0;
    }

    .env-dot {
        width: 10px;
        height: 10px;
    }
}
