/**
 * 奇楠沉香VIP查詢系統 - 樣式表
 */

/* ===== 全域設定 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2d5016;
    --primary-light: #4a7c23;
    --primary-dark: #1a3009;
    --secondary-color: #8b6914;
    --accent-color: #c4a35a;
    --bg-color: #f5f5f0;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-light: #666666;
    --border-color: #ddd;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --radius: 8px;
}

body {
    font-family: 'Microsoft JhengHei', 'PingFang TC', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    color: var(--primary-light);
}

/* ===== 容器 ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== 表頭 ===== */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 20px 0;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 2rem;
}

.nav {
    display: flex;
    gap: 20px;
}

.nav a {
    color: white;
    padding: 8px 15px;
    border-radius: var(--radius);
    transition: background 0.3s;
}

.nav a:hover, .nav a.active {
    background: rgba(255,255,255,0.2);
}

/* ===== 登入頁面 ===== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.login-card {
    background: var(--card-bg);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-card h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.login-card .subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 30px;
}

/* ===== 表單 ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn {
    display: inline-block;
    padding: 12px 25px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-light);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
}

/* ===== 卡片 ===== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    background: var(--primary-color);
    color: white;
    padding: 15px 20px;
    font-weight: bold;
}

.card-body {
    padding: 20px;
}

/* ===== 資料表格 ===== */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: #f8f8f5;
    font-weight: 600;
}

tr:hover {
    background: #f8f8f5;
}

/* ===== 狀態標籤 ===== */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-normal {
    background: #d4edda;
    color: #155724;
}

.status-warning {
    background: #fff3cd;
    color: #856404;
}

.status-critical {
    background: #f8d7da;
    color: #721c24;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-inactive {
    background: #e2e3e5;
    color: #383d41;
}

.status-suspended {
    background: #f8d7da;
    color: #721c24;
}

/* ===== 會員面板 ===== */
.member-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 30px 0;
}

.member-info h2 {
    margin-bottom: 5px;
}

.member-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.stat-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-card .number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-card .label {
    color: var(--text-light);
    margin-top: 5px;
}

/* ===== 樹木卡片 ===== */
.trees-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.tree-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.tree-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.tree-card-header {
    background: var(--primary-color);
    color: white;
    padding: 15px;
    font-weight: bold;
}

.tree-card-body {
    padding: 15px;
}

.tree-card-body .info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.tree-card-footer {
    padding: 15px;
    text-align: center;
    border-top: 1px solid #eee;
}

/* ===== 樹木詳細頁面 ===== */
.tree-detail-header {
    position: relative;
    height: 200px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.tree-detail-header h1 {
    font-size: 2rem;
}

.tree-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.tree-stat-item {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
}

.tree-stat-item .value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.tree-stat-item .label {
    color: var(--text-light);
    margin-top: 5px;
}

/* ===== 日誌表格 ===== */
.care-log-table th, .care-log-table td {
    text-align: center;
}

.care-log-table th:first-child, .care-log-table td:first-child {
    text-align: left;
}

.check-icon {
    color: var(--success-color);
    font-weight: bold;
}

.waiting {
    color: #999;
}

/* ===== 麵包屑 ===== */
.breadcrumb {
    padding: 15px 0;
    margin-bottom: 20px;
}

.breadcrumb a {
    color: var(--primary-color);
}

.breadcrumb span {
    margin: 0 10px;
    color: var(--text-light);
}

/* ===== 側邊欄 ===== */
.layout {
    display: flex;
    gap: 20px;
    margin: 20px 0;
}

.sidebar {
    width: 250px;
    flex-shrink: 0;
}

.sidebar-menu {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.sidebar-menu a {
    display: block;
    padding: 12px 20px;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
}

.sidebar-menu a:hover, .sidebar-menu a.active {
    background: var(--primary-color);
    color: white;
}

.main-content {
    flex: 1;
}

/* ===== 分頁 ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin: 20px 0;
}

.pagination a, .pagination span {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.pagination a {
    color: var(--primary-color);
}

.pagination a:hover {
    background: var(--primary-color);
    color: white;
}

.pagination .current {
    background: var(--primary-color);
    color: white;
}

/* ===== 訊息提示 ===== */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* ===== 彈出視窗 ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--radius);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* ===== 頁尾 ===== */
.footer {
    text-align: center;
    padding: 30px 0;
    color: var(--text-light);
    margin-top: 50px;
    border-top: 1px solid var(--border-color);
}

/* ===== 工具列 ===== */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.toolbar-actions {
    display: flex;
    gap: 10px;
}

/* ===== 搜尋框 ===== */
.search-box {
    display: flex;
    gap: 10px;
}

.search-box input {
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

/* ===== 響應式 ===== */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .tree-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .member-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .login-card {
        padding: 30px 20px;
        margin: 20px;
    }
}

/* ===== 月份切換器 ===== */
.month-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
}

.month-nav h3 {
    color: var(--primary-color);
}

/* ===== 圖表區 ===== */
.environment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.env-item {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
}

.env-item .label {
    color: var(--text-light);
    margin-bottom: 5px;
}

.env-item .value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}
