/* ✅ 整體樣式 */
body {
    font-family: Arial, sans-serif;
    background-color: #2e2e2e;
    color: white;
    text-align: center;
    margin: 0;
    padding: 20px;
}

/* ✅ 主要容器 */
.container {
    max-width: 90%;
    margin: auto;
    background: #333;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	overflow: hidden; /* ✅ 確保內部 `.dye-list` 可滾動 */
}

/* 🔎 搜尋框 */
.search-container {
    margin-bottom: 20px;
}

#search-box {
    width: 80%;
    padding: 10px;
    font-size: 16px;
    border-radius: 5px;
    border: none;
    background: #222;
    color: white;
}

/* ✅ 稱號清單 */
.dye-list {
    display: flex;
    flex-direction: column; /* ✅ 改為垂直排列 */
    gap: 10px; /* ✅ 每筆 list 之間有間距 */
}



/* ✅ 單個稱號展示（上下堆疊） */
/* ✅ 修正組合名稱顯示順序 */  
.dye-item {
    display: flex;
    align-items: center; /* ✅ 垂直置中 */
    justify-content: flex-start; /* ✅ 保持左對齊 */
    padding: 10px;
    border: 2px solid #666;
    border-radius: 8px;
    background: #333;
    width: 100%;
    max-width: 1050px; /* ✅ 限制最大寬度 */
    margin: 0 auto 20px auto; /* ✅ 讓整個 `.dye-item` 水平置中 */
}


/* ✅ 左側組合染色劑圖片 */
/* ✅ 綠色框的組合染色劑圖片 */

.dye-main {
	
    display: flex;
    flex-direction: column;  /* ✅ 讓內容垂直排列 */
    align-items: center;  /* ✅ 讓圖片 & 名稱置中 */
}

.dye-main-image {
    width: auto; /* ✅ 固定大小 */
    height: 100px;
	border: 2px solid #666;  /* ✅綠框容器 */
    margin-right: 15px; /* ✅ 確保與右側內容有間距 */
}


/* ✅ 組合名稱 */
.dye-group-title {
    font-size: 16px;
    text-align: center;
    margin-top: 5px; /* ✅ 避免名稱緊貼圖片 */
}
.dye-main h3 {
    font-size: 14px;
    text-align: center;
    margin-top: 5px; /* ✅ 給名稱一點間距 */
}

/* ✅ 右側內容物圖片區塊 */
/* ✅ 調整內容物顯示方式 */
.dye-content-images {
    display: flex;
    flex-wrap: wrap; /* ✅ 超過 6 個自動換行 */
    gap: 10px; /* ✅ 設定間距 */
    max-width: calc(100% - 130px); /* ✅ 避免擠壓左側主圖 */
}


/* ✅ 每個內容物圖片 + HEX & RGB 顯示 ✅ 內容物 (藍色框) */
.dye-content-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}


/* ✅ 內容物圖片✅ 內容物圖片 (藍色框) */
.dye-content-img {
    width: auto;
    height: auto;
    border: 2px solid blue;
    object-fit: contain;
}


/* ✅ HEX & RGB 顏色顯示 */
/* ✅ HEX & RGB 顯示 */

.color-box {
    width: 120px;  /* ✅ 控制寬度 */
    height: 40px;  /* ✅ 控制高度 */
    display: flex;
    flex-direction: column; /* ✅ 讓 HEX & RGB 垂直排列 */
    align-items: center;
    justify-content: center;
    font-size: 12px;  /* ✅ 調整字體大小 */
    font-weight: bold;
    color: white;  /* ✅ 預設字體為白色 */
    border-radius: 5px;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.3); /* ✅ 邊框 */
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3); /* ✅ 陰影效果 */
}

.hex-code {
    font-size: 14px;
    font-weight: bold;
}

.rgb-code {
    font-size: 12px;
    color: #bbb;
}


/* ✅ 称号信息 */
.dye-info h3 {
    margin: 10px 0 5px;
    font-size: 20px;
}

.dye-info p {
    margin: 5px 0;
    font-size: 14px;
}

/* ✅ 交易狀態 */
.trade-status {
    font-weight: bold;
}

.trade-status::before {
    content: "🔹 ";
}

/* ✅ 分頁控制 */
.pagination {
    margin-top: 20px;
}

.pagination button {
    background-color: #555;
    color: white;
    padding: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.pagination button:hover {
    background-color: #777;
}

/* ✅ 管理員專屬控制區 */
.admin-controls {
    margin-top: 20px;
}

.admin-controls button {
    background-color: #ff5555;
    color: white;
    padding: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.admin-controls button:hover {
    background-color: #ff7777;
}

/* ✅ 確保「編輯」與「刪除」按鈕可見（僅限管理員） */
.admin-controls {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    gap: 10px;
}

.admin-controls button {
    background-color: #ff5555;
    color: white;
    padding: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.admin-controls button:hover {
    background-color: #ff7777;
}

/* ✅ 編輯 / 刪除 按鈕 */
.manage-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.edit-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}

.delete-btn {
    background-color: #FF4444;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}

.edit-btn:hover {
    background-color: #45a049;
}

.delete-btn:hover {
    background-color: #FF6666;
}

/* ✅ 編輯視窗 */
.edit-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.edit-box {
    background: #222;
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    width: 300px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.edit-box input,
.edit-box select {
    width: 90%;
    padding: 5px;
    margin: 5px 0;
    border-radius: 5px;
    border: none;
    font-size: 16px;
    background: #333;
    color: white;
}

.edit-box button {
    margin-top: 10px;
    padding: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    background-color: #4CAF50;
    color: white;
}

.edit-box button:hover {
    background-color: #45a049;
}

#close-edit {
    background-color: #FF4444;
}

#close-edit:hover {
    background-color: #FF6666;
}


/* ✅ 確保單筆稱號有框框 */
.dye-entry {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    border: 2px solid #666;
    border-radius: 10px;
    background: #333;
    margin: 10px 0;
    text-align: center;
    width: 100%;
    max-width: 500px; /* ✅ 不讓容器超過 500px */
    box-shadow: 0 2px 5px rgba(255, 255, 255, 0.2);
}


/* ✅ 確保圖片大小符合 */
/* ✅ 修正圖片大小 */
/* ✅ 圖片固定高度 500px，但寬度等比例縮放 */
.dye-image {
    max-width: 100%;
    width: auto; /* ✅ 讓寬度自適應 */
    height: 500px; /* ✅ 固定高度 500px */
    border-radius: 5px;
    margin-bottom: 10px;
    object-fit: cover; /* ✅ 讓圖片填滿 500px，高度固定 */
}



/* ✅ 讓按鈕並排 */
.dye-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

/* ✅ 編輯與刪除按鈕 */
.edit-btn, .delete-btn {
    background-color: #444;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 14px;
}

.edit-btn:hover { background-color: #28a745; }
.delete-btn:hover { background-color: #dc3545; }


.dye-video {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: 5px;
}

/* 🔹 預設超連結為白色 */
a {
    color: white;
    text-decoration: none; /* 移除底線 */
    font-weight: bold;
}

/* 🔹 滑鼠懸停時變色 */
a:hover {
    color: #ffcc00; /* 黃色，可自行調整 */
    text-decoration: underline;
}

/* 🔹 已訪問的超連結顏色保持白色 */
a:visited {
    color: white !important;
}

/* 🔹 點擊中的超連結顏色保持白色 */
a:active {
    color: white !important;
}


/* 🔹 進階篩選區塊 */
#filter-container {
    background: #444; /* ✅ 深色背景 */
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0px 0px 10px rgba(255, 255, 255, 0.2);
    color: white;
    text-align: left;
    max-width: 800px; /* ✅ 限制篩選框寬度 */
    margin: auto;
}

/* 🔹 `fieldset` 樣式 */
#filter-container fieldset {
    border: 2px solid #666;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 5px;
    background-color: #333; /* ✅ 深色背景 */
}

/* 🔹 `legend` 文字顏色 */
#filter-container legend {
    font-weight: bold;
    color: white;
    font-size: 16px;
}

/* 🔹 `label` 樣式 */
#filter-container label {
    display: inline-block;
    margin-right: 15px;
    cursor: pointer;
    font-size: 14px;
}

/* 🔹 `checkbox` 樣式 */
#filter-container input[type="checkbox"] {
    margin-right: 5px;
    accent-color: #ffcc00; /* ✅ 自訂勾選顏色 */
}

/* 🔹 `套用篩選` 按鈕
#apply-filter {
    width: 100%;
    background: #007bff;
    color: white;
    padding: 10px;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    margin-top: 10px;
    font-size: 14px;
}

#apply-filter:hover {
    background: #0056b3;
}
 */
/* 🔹 隱藏 `filter-container` */
.hidden {
    display: none;
}

/* 🔹 `篩選按鈕` 樣式 */
#toggle-filter {
    width: 40%;
    background: #28a745;
    color: white;
    padding: 10px;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 14px;
}

#toggle-filter:hover {
    background: #218838;
}

/* ✅ 頁面底部 Footer */

/* ✅ 響應式調整 */
@media (max-width: 1024px) {
    .dye-list {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); /* ✅ 確保平板時至少 320px */
    }
}

@media (max-width: 768px) {
    .dye-list {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* ✅ 手機時至少 280px */
    }
}


#pasteImage_canvas {
    cursor: url("dye_img/eyedropper.png") 6 6, crosshair;
}

