/**
 * 樟樹區弟兄姊妹書籍訂閱系統 - 樣式表
 * 
 * @author Roo
 * @date 2025-05-27
 */

/* 全域樣式 */
body {
    font-family: 'Microsoft JhengHei', 'Segoe UI', Arial, sans-serif;
    background-color: #f8f9fa;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
}

/* 頭部樣式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header h1 {
    margin: 0;
    font-weight: 300;
    font-size: 2.5rem;
}

.header .subtitle {
    margin: 0.5rem 0 0 0;
    opacity: 0.9;
    font-size: 1.1rem;
}

/* 導航樣式 */
.nav-tabs {
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 2rem;
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    color: #6c757d;
    font-weight: 500;
    padding: 1rem 1.5rem;
}

.nav-tabs .nav-link:hover {
    border-color: transparent;
    color: #495057;
    background-color: #f8f9fa;
}

.nav-tabs .nav-link.active {
    background-color: transparent;
    border-color: #667eea;
    color: #667eea;
    font-weight: 600;
}

/* 卡片樣式 */
.card {
    border: none;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    border-radius: 10px;
    margin-bottom: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 25px rgba(0,0,0,0.12);
}

.card-header {
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
    border-radius: 10px 10px 0 0 !important;
}

/* 使用者選擇區域 */
.user-selection {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.user-selection .form-select {
    border: 2px solid rgba(255,255,255,0.3);
    background-color: rgba(255,255,255,0.9);
    font-weight: 500;
}

.user-selection .btn {
    border: 2px solid white;
    background-color: rgba(255,255,255,0.2);
    color: white;
    font-weight: 500;
}

.user-selection .btn:hover {
    background-color: white;
    color: #667eea;
}

/* 按鈕樣式 */
.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border: none;
    font-weight: 500;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: linear-gradient(45deg, #5a67d8, #6b46c1);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(45deg, #48bb78, #38a169);
    border: none;
    font-weight: 500;
}

.btn-danger {
    background: linear-gradient(45deg, #f56565, #e53e3e);
    border: none;
    font-weight: 500;
}

.btn-warning {
    background: linear-gradient(45deg, #ed8936, #dd6b20);
    border: none;
    font-weight: 500;
    color: white;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
}

/* 表格樣式 */
.table {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.table thead th {
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
    border: none;
    font-weight: 600;
    color: #495057;
    padding: 1rem;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-top: 1px solid #f1f3f4;
}

/* 表單樣式 */
.form-control, .form-select {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0.6rem 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

/* 統計數字樣式 */
.stat-card {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* 訂單項目樣式 */
.order-item {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s ease;
}

.order-item:hover {
    border-color: #667eea;
}

.item-basic {
    border-left: 4px solid #48bb78;
}

.item-book {
    border-left: 4px solid #ed8936;
}

/* 總計金額樣式 */
.total-amount {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 1rem;
}

/* Alert 樣式 */
.alert {
    border: none;
    border-radius: 8px;
    padding: 1rem 1.5rem;
}

.alert-success {
    background: linear-gradient(45deg, #c6f6d5, #9ae6b4);
    color: #22543d;
}

.alert-danger {
    background: linear-gradient(45deg, #fed7d7, #fbb6ce);
    color: #742a2a;
}

.alert-info {
    background: linear-gradient(45deg, #bee3f8, #90cdf4);
    color: #2c5282;
}

/* 載入動畫 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 響應式設計 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .header .subtitle {
        font-size: 1rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}

/* 管理員界面特殊樣式 */
.admin-header {
    background: linear-gradient(135deg, #e53e3e, #c53030);
}

.admin-card {
    border-left: 4px solid #e53e3e;
}

/* 付費狀態樣式 */
.paid-status {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.paid-yes {
    background-color: #c6f6d5;
    color: #22543d;
}

.paid-no {
    background-color: #fed7d7;
    color: #742a2a;
}

/* 取書狀態樣式 */
.receive-status {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.received-yes {
    background-color: #bee3f8;
    color: #2c5282;
}

.received-no {
    background-color: #fbb6ce;
    color: #742a2a;
}

/* 項目類型標籤 */
.item-type-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.type-basic {
    background: linear-gradient(45deg, #48bb78, #38a169);
    color: white;
}

.type-book {
    background: linear-gradient(45deg, #ed8936, #dd6b20);
    color: white;
}

/* 已到期訂單樣式 */
.expired-order {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    opacity: 0.8;
}

.expired-order:hover {
    border-color: #adb5bd;
}

.expired-order .badge {
    font-size: 0.7rem;
}

/* 已到期訂單中的表單控制項樣式 */
.expired-order .form-check-input {
    border: 2px solid #6c757d;
}

.expired-order .form-check-input:checked {
    background-color: #28a745;
    border-color: #28a745;
}

.expired-order .form-check-input:disabled {
    opacity: 0.6;
}

.expired-order .form-check-label {
    color: #6c757d;
    font-weight: 500;
}