/** * MetaPost AI - Core Design System v2.2
 * Unified Theme: Professional SaaS Modern
 */

:root {
    /* 顏色定義 */
    --primary-gradient: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    --bg-main: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #f1f5f9;
    
    /* 陰影與圓角 */
    --card-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    --input-focus-shadow: rgba(37, 99, 235, 0.1);
    --border-radius-lg: 16px;
    --border-radius-md: 10px;
}

/* --- 1. 基礎佈局基礎 --- */
body {
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow-x: hidden;
}

/* 品牌文字漸層 */
.brand-accent {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

/* --- 2. 通用組件 --- */

/* 專業級卡片容器 */
.mp-card {
    background: #ffffff;
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.mp-card:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
}

/* 現代化輸入框 */
.mp-input {
    border-radius: var(--border-radius-md);
    border: 1px solid #e2e8f0;
    padding: 12px 15px;
    transition: all 0.3s ease;
}

.mp-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px var(--input-focus-shadow);
    outline: none;
}

/* 質感按鈕 */
.mp-btn-primary {
    background: var(--primary-gradient);
    border: none;
    border-radius: var(--border-radius-md);
    padding: 10px 20px;
    color: white !important;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mp-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
    opacity: 0.95;
    color: white !important;
}

/* 統一狀態標籤系統 (Badges) */
.mp-badge {
    border-radius: 50px;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid transparent;
}

.mp-badge-success { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.mp-badge-warning { background: #fef9c3; color: #854d0e; border-color: #fef08a; }
.mp-badge-danger  { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.mp-badge-info    { background: #e3f2fd; color: #1565c0; border-color: #bbdefb; }

/* --- 3. 貼文列表專用樣式 --- */

/* 現代化表格 */
.mp-table thead th {
    background-color: #f8fafc;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-top: none;
    border-bottom: 2px solid var(--border-color);
    padding: 15px;
}

.mp-table tbody td {
    vertical-align: middle;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.mp-table tbody tr:hover {
    background-color: rgba(37, 99, 235, 0.015);
}

/* 圖片預覽 */
.post-preview-img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #eef2f6;
    transition: 0.3s;
}

.post-preview-img:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* 成效數據標籤 */
.stats-badge {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 6px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-right: 5px;
    color: var(--text-muted);
}

/* 操作按鈕組 */
.btn-action {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    transition: all 0.2s;
}

.btn-action:hover {
    background: #f1f5f9;
    color: #1e293b;
    transform: translateY(-2px);
}

.btn-action-delete:hover {
    background: #fee2e2;
    color: #ef4444;
    border-color: #fecaca;
}

.action-group {
    display: flex;
    gap: 8px;
}

/* 文字截斷 */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- 4. 儀表板架構 (AdminLTE 補強) --- */

.main-sidebar {
    background-color: #ffffff !important;
    border-right: 1px solid var(--border-color) !important;
}

.nav-sidebar .nav-item > .nav-link.active {
    background: var(--primary-gradient) !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
    color: #ffffff !important;
}

.nav-sidebar .nav-item > .nav-link.active i,
.nav-sidebar .nav-item > .nav-link.active p {
    color: #ffffff !important;
}

.main-header {
    background-color: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color) !important;
}

/* 儀表板數據排版 */
.stat-card-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 700;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
}

/* --- 5. 滾動條優化 --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
/* 預覽手機殼樣式 */
.preview-phone {
    width: 300px;
    height: 580px;
    background: #fff;
    border: 10px solid #1e293b;
    border-radius: 30px;
    margin: 0 auto;
    position: relative;
    overflow-y: auto;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.preview-phone::-webkit-scrollbar { width: 3px; }
.preview-phone::-webkit-scrollbar-thumb { background: #ddd; }

.sticky-preview { 
    position: sticky; 
    top: 20px; 
    z-index: 10; /* 降低 z-index 以免擋到日期彈窗 */
}

.section-label { 
    font-weight: 700; 
    color: #475569; 
    font-size: 0.9rem; 
    margin-bottom: 12px; 
    display: block; 
}

/* 粉專選取樣式優化 */
.page-item-card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 15px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    background: #fff;
}

.page-item-card:hover { border-color: #3b82f6; background: #f8fafc; }
.page-item-card.selected { border-color: #3b82f6; background: #eff6ff; }
.page-item-card .check-icon { color: #cbd5e1; transition: 0.2s; margin-left: auto; flex-shrink: 0; }
.page-item-card.selected .check-icon { color: #3b82f6; }

/* 修正右側粉專名稱遮擋問題 */
.page-item-card span.account-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px; /* 強制限制寬度，不讓文字撐開擠壓到勾選框 */
    display: inline-block;
    font-size: 0.85rem;
}

/* 修正日期區塊佈局 */
#reservationdatetime {
    flex-wrap: nowrap;
}

.datetimepicker-input {
    background-color: #fff !important;
    cursor: pointer;
}

/* 確保 Tempus Dominus 彈窗在最上層 */
.bootstrap-datetimepicker-widget {
    z-index: 9999 !important;
}

