/* ================================================
   優惠碼頁面樣式表
   ================================================ */

/* ------------------------------------------------
   表格相關樣式
   ------------------------------------------------ */

/* 高亮單元格樣式 */
.table tbody tr td.highlight-cell {
    background-color: #f1f1f1 !important;
}

/* 表格容器樣式 */
#tableContainer {
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* 靜態標題列圓角樣式 */
.row.border-top {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    background-color: #DADADA;
}

/* 彈性寬度欄位 */
.flex-col {
    width: 9% !important;
    min-width: 9% !important;
    max-width: 9% !important;
}

.note-col {
    width: 10% !important;
    min-width: 10% !important;
    max-width: 10% !important;
}

.center-col {
    text-align: center;
}

/* ------------------------------------------------
   操作按鈕樣式
   ------------------------------------------------ */

/* 操作按鈕容器 */
.action-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

/* 操作按鈕基本樣式 */
.action-buttons button {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #666;
    transition: color 0.2s ease;
}

/* 操作按鈕懸停效果 */
.action-buttons button:hover {
    color: #333;
}

/* ------------------------------------------------
   搜尋區域樣式
   ------------------------------------------------ */

/* 搜尋輸入群組 */
.search-input-group {
    width: auto;
}

/* 搜尋輸入框 */
.search-input {
    box-shadow: none;
}

.promo-filter {
    cursor: pointer;
    color: #0d6efd;
    user-select: none;
}

.promo-filter.active {
    color: #212529;
    font-weight: 600;
}

/* ------------------------------------------------
   表單相關樣式
   ------------------------------------------------ */

/* 標籤容器邊框 */
.tag-container {
    border-width: 1px !important;
}

/* 標籤選擇器容器 */
.position-relative {
    position: relative;
}

/* 標籤彈出視窗 */
.tags-popup {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    z-index: 1000;
    display: none;
    max-height: 200px;
    overflow-y: auto;
}

/* 顯示標籤彈出視窗 */
.tags-popup.show {
    display: block;
}

/* 標籤彈出視窗中的標籤項目 */
.tags-popup .tag {
    display: block;
    width: 100%;
    padding: 0.5rem;
    margin: 0;
    border: none;
    border-radius: 0;
    background: white;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

/* 標籤項目懸停效果 */
.tags-popup .tag:hover {
    background-color: #f8f9fa;
}

/* 新增標籤按鈕 */
.add-tag-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: #f8f9fa;
    border: 1px dashed #dee2e6;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 1.25rem;
    color: #6c757d;
    transition: all 0.2s ease;
}

/* 新增標籤按鈕懸停效果 */
.add-tag-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #495057;
}

/* 標籤移除圖示 */
.remove-icon {
    margin-left: 0.5rem;
    cursor: pointer;
    font-weight: bold;
    color: #dc3545;
}

/* 標籤移除圖示懸停效果 */
.remove-icon:hover {
    color: #c82333;
}

/* ------------------------------------------------
   響應式設計
   ------------------------------------------------ */

/* 手機版樣式調整 */
@media (max-width: 768px) {
    .content {
        --mobile-table-min-width: 1080px;
    }

    #themeTableSchedulePanel > .row.border-top .flex-col {
        flex-basis: 96px !important;
        width: 96px !important;
        min-width: 96px !important;
        max-width: none !important;
    }

    #themeTableSchedulePanel > .row.border-top .note-col {
        flex-basis: 160px !important;
        width: 160px !important;
        min-width: 160px !important;
        max-width: none !important;
    }

    #tableContainer .flex-col {
        width: 96px !important;
        min-width: 96px !important;
        max-width: none !important;
    }

    #tableContainer .note-col {
        width: 160px !important;
        min-width: 160px !important;
        max-width: none !important;
        white-space: normal;
        word-break: break-word;
    }

    .search-input-group {
        flex: 1 1 100%;
    }

    .action-buttons {
        flex-direction: column;
        gap: 4px;
    }

    .action-buttons button {
        min-height: 36px;
        min-width: 36px;
    }
    
    .tag {
        font-size: 0.75rem;
        padding: 0.125rem 0.375rem;
    }
}
