body { 
		margin: 0; 
		font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
		background: #000; 
		color: #fff; 
		overflow: hidden; 
		height: 100vh; 
		display: flex; 
		flex-direction: column; 
}

/* Header & Footer share similar structural properties */
.widget-header, .widget-footer {
		height: 45px;
		padding: 0 15px;
		background: #111;
		display: flex;
		align-items: center;
		flex-shrink: 0;
		z-index: 20;
}

.widget-header {
		justify-content: space-between;
		border-bottom: 1px solid #333;
}

.widget-footer {
		justify-content: flex-start;
		border-top: 1px solid #333;
}

.event-title { margin: 0; font-size: 14px; font-weight: 600; color: #3490dc; }
.photo-counter { font-size: 12px; color: #aaa; }

/* Footer Branding */
.footer-logo-link {
		display: flex;
		align-items: center;
		text-decoration: none;
		color: #fff;
		transition: opacity 0.2s;
}
.footer-logo-link:hover { opacity: 0.8; }
.footer-logo { height: 20px; margin-right: 8px; }
.footer-brand-name { font-size: 13px; font-weight: 500; letter-spacing: 0.5px; }

/* The central area that shrinks/grows based on image orientation */
.slider-wrapper { 
		flex-grow: 1; 
		position: relative; 
		width: 100%; 
		display: flex; 
		align-items: center; 
		justify-content: center;
		overflow: hidden; 
}

.slide { 
		display: none; 
		width: 100%; 
		height: 100%; 
		align-items: center; 
		justify-content: center; 
}
.slide.active { display: flex; }

/* Ensures portrait photos stay within the bounds of header and footer */
.slide img { 
		max-width: 100%; 
		max-height: 100%; 
		object-fit: contain; 
}

.nav-btn { 
		position: absolute; 
		top: 50%; 
		transform: translateY(-50%); 
		background: rgba(255, 255, 255, 0.15); 
		color: white; 
		border: none; 
		width: 40px;
		height: 40px;
		cursor: pointer; 
		border-radius: 50%; 
		z-index: 10; 
		display: flex;
		align-items: center;
		justify-content: center;
}
.prev { left: 10px; }
.next { right: 10px; }

/* 新增：左側文字容器，強制上下排列並靠左 */
.header-left-group {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: flex-start;
	flex: 1;
}

/* 修改：移除 h1 預設邊距 */
.event-title {
	margin: 0;
	padding: 0;
	font-size: 14px;
	line-height: 1.2;
}

/* 確保連結顏色 */
.event-title a, 
.event-title a:visited {
	color: #ffffff !important;
	text-decoration: none;
}

/* 修改：日期樣式（縮小、靠左、取消粗體） */
.event-date {
	margin: 2px 0 0 0; /* 與標題保持微小間距 */
	padding: 0;
	font-size: 11px; /* 縮小尺寸 */
	font-weight: normal; /* 取消粗體以區分層次 */
	color: #aaaaaa; /* 使用灰色 */
	text-align: left;
}

/* 右側計數器：取消 flex:1 以免擠壓左側 */
.photo-counter {
	font-size: 12px;
	color: #aaa;
	text-align: right;
}
.icon-white {
	/* 將黑色/深色 SVG 強制轉換為純白色 */
	filter: brightness(0) invert(1);
	height: 18px; /* 根據你的 Header 高度調整 */
	width: auto;
	margin-right: 5px;
	vertical-align: middle;
}

/* Modified Footer with Search */
.widget-footer { height: 45px; padding: 0 15px; background: #111; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #333; flex-shrink: 0; z-index: 20; }

.footer-left { flex: 1; display: flex; align-items: center; }
.footer-logo-link { display: flex; align-items: center; text-decoration: none; color: #fff; }
.footer-logo { height: 20px; margin-right: 8px; }
.footer-brand-name { font-size: 13px; font-weight: 500; }

/* New Bib Search Styles */
.footer-search { flex: 2; display: flex; justify-content: center; align-items: center; }
.bib-search-form { display: flex; background: rgba(255, 255, 255, 0.1); border-radius: 20px; overflow: hidden; border: 1px solid #444; width: 180px; transition: width 0.3s; }
.bib-search-form:focus-within { width: 220px; border-color: #3490dc; background: rgba(255, 255, 255, 0.15); }
.bib-input { background: transparent; border: none; padding: 6px 12px; color: #fff; font-size: 12px; width: 100%; outline: none; }
.bib-submit { background: transparent; border: none; color: #aaa; cursor: pointer; padding: 6px 12px 6px 0; font-size: 14px; }
.bib-submit:hover { color: #fff; }

.footer-right { flex: 1; text-align: right; color: #666; font-size: 11px; }

/* Loading Spinner */
.loader { display: none; border: 3px solid rgba(255, 255, 255, 0.1); border-top: 3px solid #3490dc; border-radius: 50%; width: 20px; height: 20px; animation: spin 1s linear infinite; margin-left: 10px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.reset-btn {
		background: transparent;
		border: none;
		color: #888;
		cursor: pointer;
		padding: 0 5px;
		font-size: 14px;
		outline: none;
}
.reset-btn:hover {
		color: #fff;
}


/* MovePic Green Theme */
:root {
		--movepic-green: #38c172; /* Adjust this hex to match your exact brand green */
		--movepic-green-hover: #218838;
}

/* Photo Action Button */
.download-btn {
		position: absolute;
		bottom: 15px;
		right: 15px;
		background: var(--movepic-green);
		color: white;
		border: none;
		padding: 6px 12px;
		border-radius: 20px;
		cursor: pointer;
		z-index: 15;
		font-size: 11px;
		font-weight: 500;
		display: flex;
		align-items: center;
		box-shadow: 0 2px 4px rgba(0,0,0,0.3);
		transition: background 0.2s;
}

.download-btn:hover {
		background: var(--movepic-green-hover);
}

.download-btn.added {
		background: #ffffff;
		color: var(--movepic-green);
		font-weight: bold;
}

/* Checkout Button in Footer */
.checkout-link {
		background: var(--movepic-green);
		color: white !important;
		padding: 5px 14px;
		border-radius: 18px;
		text-decoration: none;
		margin-left: 10px;
		font-size: 12px;
		font-weight: 600;
		transition: opacity 0.2s;
}

.checkout-link:hover {
		opacity: 0.9;
		color: white !important;
}

#cart-count {
		background: rgba(255, 255, 255, 0.2);
		padding: 0 6px;
		border-radius: 10px;
		margin-left: 4px;
}

/* 初始狀態：MovePic 綠色 */
.download-btn {
		background-color: #28a745;
		color: white;
		border: 1px solid #28a745;
}

/* 已加入狀態：變為白色背景或反白 */
.download-btn.added {
		background: #ffffff !important;
		color: #28a745 !important;
		border-color: #ffffff !important;
		box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

/* 你要求的漸層 Hover 效果 */
.download-btn:hover {
		border-color: #58f3a7 !important;
		background: linear-gradient(270deg, rgb(137 249 194) 0%, rgb(131 243 209) 86%);
		color: #000000 !important;
}



.fullscreen-btn {
		position: absolute;
		top: 15px;
		right: 15px;
		z-index: 1000;
		background: rgba(0, 0, 0, 0.5);
		border: none;
		border-radius: 4px;
		padding: 8px;
		cursor: pointer;
		transition: background 0.3s;
		display: flex;
		align-items: center;
		justify-content: center;
}

.fullscreen-btn:hover {
		background: rgba(0, 0, 0, 0.8);
}

/* Adjust button appearance when in full-screen mode */
:fullscreen .fullscreen-btn {
		top: 20px;
		right: 20px;
}


/* The floating +1 element */
.plus-one-anim {
	position: fixed;
	color: #ff4d4d; /* Match your brand color */
	font-weight: bold;
	font-size: 20px;
	pointer-events: none;
	z-index: 9999;
	animation: floatUpAndFade 0.8s ease-out forwards;
}

@keyframes floatUpAndFade {
	0% {
			transform: translateY(0);
			opacity: 1;
	}
	100% {
			transform: translateY(-50px);
			opacity: 0;
	}
}

/* Subtle bounce for the cart itself when updated */
.cart-bounce {
	animation: bounce 0.3s ease-in-out;
}

@keyframes bounce {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.2); }
}


.clear-cart-btn {
	background: none;
	border: none;
	font-size: 18px;
	cursor: pointer;
	margin-right: 8px;
	padding: 5px;
	transition: transform 0.2s, opacity 0.3s;
	opacity: 0.5;
}

.clear-cart-btn:hover {
	transform: scale(1.2);
	opacity: 1;
}

/* Optional: hide or dim if cart is empty */
.clear-cart-btn.empty {
	pointer-events: none;
	opacity: 0.2;
}



// 在 CSS 中加入
.is-ios-fullscreen {
	position: fixed !important;
	top: 0 !important;
	left: 0 !important;
	width: 100vw !important;
	height: 100vh !important;
	z-index: 999999 !important;
	background: #000;
}



.thumbnail-wrapper {
	width: 100%;
	overflow-x: auto;
	background: rgba(0, 0, 0, 0.05);
	padding: 10px 0;
	/* 隱藏捲動條但保留功能 (Chrome/Safari) */
	-webkit-overflow-scrolling: touch;
}
.thumbnail-wrapper::-webkit-scrollbar {
	display: none;
}

.thumbnail-container {
	display: flex;
	gap: 8px;
	padding: 0 15px;
	width: max-content; /* 確保容器寬度隨圖片增加 */
}

.thumb {
	width: 60px;
	height: 60px;
	flex: 0 0 60px;
	border: 2px solid transparent;
	border-radius: 4px;
	overflow: hidden;
	cursor: pointer;
	transition: all 0.2s ease;
	opacity: 0.6;
}

.thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.thumb.active {
	border-color: #27cfc3; /* 配合你主題的綠色 */
	opacity: 1;
	transform: scale(1.05);
}


@media (max-width: 480px) {
    /* 1. 縮短 Footer 整體高度以適應螢幕 */
    .widget-footer {
        padding: 0 8px;
        justify-content: space-between;
    }

    /* 2. 隱藏品牌名稱節省空間 */
    .footer-brand-name, #bib-label {
        display: none;
    }

    /* 3. 調整搜尋框寬度 */
    .footer-search {
        flex: 1; /* 讓它自動伸縮 */
        margin: 0 5px;
        justify-content: flex-start;
    }
    
    .bib-search-form {
        width: 100% !important; /* 在手機版使用自動寬度 */
        max-width: 130px;        /* 限制最大寬度防止擠壓按鈕 */
    }

    .bib-input {
        padding: 6px 8px;
        font-size: 13px;
    }

    /* 4. 右側按鈕組：確保不換行 */
    .footer-right {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
    }

    .checkout-link {
        padding: 5px 8px;
        font-size: 11px;
        margin-left: 5px;
        white-space: nowrap; /* 重要：防止文字換行 */
    }

    .clear-cart-btn {
        font-size: 16px;
        margin-right: 2px;
    }
    
    /* 5. 縮小縮圖大小以節省垂直空間 */
    .thumb {
        width: 50px;
        height: 50px;
        flex: 0 0 50px;
    }
}

/* 1. 基本狀態：強制保持深色背景與白色文字 */
.bib-input {
    background: #333333 !important; /* 或者使用你原本的 rgba(255, 255, 255, 0.1) */
    color: #ffffff !important;      /* 強制輸入文字為白色 */
    border: none;
    outline: none;
}

/* 2. 關鍵：處理自動填充 (Autofill) 導致的背景變色 */
/* 當瀏覽器記住號碼並自動填入時，會強制變成淺藍色，這段代碼可以解決它 */
.bib-input:-webkit-autofill,
.bib-input:-webkit-autofill:hover, 
.bib-input:-webkit-autofill:focus, 
.bib-input:-webkit-autofill:active {
    -webkit-text-fill-color: #ffffff !important; /* 自動填充時的文字顏色 */
    -webkit-box-shadow: 0 0 0px 1000px #333333 inset !important; /* 用內陰影蓋掉自動填充的背景色 */
    transition: background-color 5000s ease-in-out 0s;
}

/* 3. 確保表單容器在輸入時不會變色過度 */
.bib-search-form {
    background: #333333 !important; 
    border: 1px solid #444;
}

/* 修正搜尋按鈕與重置按鈕的背景 */
.bib-submit, .reset-btn {
    background: transparent !important;
}


/* 自動播放按鈕：移至左側 */
.autoplay-btn {
    position: absolute;
    bottom: 15px;
    left: 15px; /* 改為左側 15px */
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: 1px solid #666;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    z-index: 15;
    font-size: 11px;
    display: flex;
    align-items: center;
    transition: all 0.2s;
}

.autoplay-btn.playing {
    background: #ff4d4d; /* 播放時變成紅色 */
    border-color: #ff4d4d;
}

/* 手機版微調 */
@media (max-width: 480px) {
    .autoplay-btn {
        left: 10px;
        bottom: 15px;
        padding: 5px 10px;
    }
}

.header-right-group {
    display: flex;
    align-items: center;
}

#share-btn {
    padding: 5px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

#share-btn:hover {
    opacity: 1;
}

@media (max-width: 480px) {
    .photo-counter {
        font-size: 11px; /* 手機版縮小一點計數器，為分享按鈕騰位子 */
    }
}


.share-photo-btn {
    position: absolute;
    bottom: 15px;
    left: 125px; /* 放在自動播放按鈕 (100px寬 + 15px邊距) 的右邊 */
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 15;
    transition: all 0.2s;
}

.share-photo-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

@media (max-width: 480px) {
    .share-photo-btn {
        left: 105px; /* 手機版對應自動播放按鈕位置 */
        width: 28px;
        height: 28px;
    }
}
/* 整合後的搜尋框容器 */
.search-combined-container {
    display: flex;
    align-items: center;
    background: #333333 !important; /* 強制保持深色背景 */
    border-radius: 20px;
    padding: 0 12px;
    border: 1px solid #444;
    height: 36px;
    transition: border-color 0.3s;
}

.search-combined-container:focus-within {
    border-color: #38c172; /* 當點擊輸入框時，整個大框變綠色 */
}

/* 內部表單重置 */
.search-part {
    display: flex;
    align-items: center;
    margin: 0;
}

/* 人臉搜尋圖標樣式 */
.btn_face {
    color: #888;
    display: flex;
    align-items: center;
    padding-right: 8px;
    margin-right: 8px;
    border-right: 1px solid #555; /* 在兩者之間加一條細分界線 */
    transition: color 0.2s;
}

.btn_face:hover {
    color: #38c172;
}

/* Bib 搜尋表單填滿剩餘空間 */
.bib-main-form {
    flex: 1;
}

.bib-input {
    width: 100%;
    background: transparent !important;
    color: white !important;
    border: none !important;
    outline: none !important;
    font-size: 13px;
    padding: 6px 0;
}

.bib-submit, .reset-btn {
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 0 5px;
}

/* 手機版 iPhone 適配 */
@media (max-width: 480px) {
    .search-combined-container {
        max-width: 160px; /* 防止佔用過多 footer 空間 */
    }
    .btn_face svg { width: 16px; height: 16px; }
}

/* 人臉搜尋掃描中的高亮狀態 */
.btn_face.active-scan {
    color: #38c172 !important; /* 變為主題綠色 */
    filter: drop-shadow(0 0 5px rgba(56, 193, 114, 0.5)); /* 增加發光感 */
    animation: pulse-green 1.5s infinite;
}

@keyframes pulse-green {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}







/* 1. 強制修正 Footer 容器 */
.widget-footer {
    display: flex !important;
    flex-direction: row !important; /* 確保橫向排列 */
    align-items: center !important; /* 垂直居中 */
    justify-content: space-between !important;
    height: 50px !important; /* 固定高度，防止內容溢出 */
    padding: 0 10px !important;
    background: #1a1a1a !important; /* 確保背景顏色一致 */
    position: relative !important;
    z-index: 100;
}

/* 2. 移除那個會亂跑的標籤 */
#bib-label {
    display: none !important; /* 在桌機和手機都建議隱藏，或放入搜尋框內 */
}

/* 3. 修正右側區域，防止它向上漂浮 */
.footer-right {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    height: 100% !important; /* 跟隨父容器高度 */
    margin: 0 !important;
    padding: 0 !important;
    flex-shrink: 0 !important; /* 防止被擠壓 */
}

/* 4. 修正查看按鈕樣式 */
.checkout-link {
    background: #38c172 !important;
    color: white !important;
    padding: 5px 12px !important;
    border-radius: 20px !important;
    font-size: 12px !important;
    text-decoration: none !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    white-space: nowrap !important;
}

/* 5. 確保中間搜尋框不會擠壓兩側 */
.footer-search {
    flex: 1 !important;
    max-width: 300px !important; /* 限制最大寬度，避免壓迫右側 */
    margin: 0 15px !important;
}


/* 針對手機版 (Mobile View) 優化 Facesearch 與輸入框位置 */
@media (max-width: 480px) {
    /* 1. 將中間容器改為靠左對齊，並給予固定邊距 */
    .footer-search {
        flex: 1 !important;
        display: flex !important;
        justify-content: flex-start !important; /* 從 center 改為 flex-start */
        margin-left: 5px !important; /* 根據 Logo 位置微調，讓它更靠左 */
        margin-right: 0 !important;
        max-width: none !important; /* 解除之前的寬度限制 */
    }

    /* 2. 縮小搜尋容器的寬度，確保不會擠壓到右側的「查看」按鈕 */
    .search-combined-container {
        max-width: 150px !important; /* 縮小一點以留出空間給右側 */
        margin-left: 0 !important;
        padding: 0 8px !important; /* 減少內部左右邊距 */
    }

    /* 3. 確保 Logo 區塊不要佔用太多空間，讓搜尋框能靠得更左 */
    .footer-left {
        flex: 0 0 auto !important; /* 不要撐開空間 */
        margin-right: 5px !important;
    }

    /* 4. 縮小人臉搜尋圖標的間距，讓整體更緊湊 */
    .btn_face {
        padding-right: 5px !important;
        margin-right: 5px !important;
    }

    /* 5. 確保輸入框文字大小適中 */
    .bib-input {
        font-size: 12px !important;
    }
}


/* Share Button: TOP‑LEFT, same vertical position as fullscreen */
.share-btn {
  position: absolute;
  top: 20px;
  left: 20px; /* Left side, same top‑margin as fullscreen */
  background: rgba(0,0,0,0.4);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  z-index: 99;
  transition: background 0.2s;
}
.share-btn:hover {
  background: rgba(0,0,0,0.6);
}

/* Fullscreen Button (keep your original right‑side position) */
.fullscreen-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0,0,0,0.4);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  z-index: 99;
}
