/* 全域樣式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* 動畫效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.5s ease-out;
}

/* 自訂捲軸 */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 程式碼區塊 */
pre {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 1rem;
    overflow-x: auto;
    font-size: 0.875rem;
}

/* 狀態指示器 */
.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-indicator.online {
    background-color: #28a745;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.5);
}

.status-indicator.offline {
    background-color: #dc3545;
    box-shadow: 0 0 8px rgba(220, 53, 69, 0.5);
}

.status-indicator.warning {
    background-color: #ffc107;
    box-shadow: 0 0 8px rgba(255, 193, 7, 0.5);
}

/* 響應式調整 */
@media (max-width: 768px) {
    .stat-card {
        margin-bottom: 1rem;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
}

/* 表單美化 */
.form-control:focus,
.form-select:focus {
    border-color: #18BC9C;
    box-shadow: 0 0 0 0.2rem rgba(24, 188, 156, 0.25);
}

/* 按鈕效果 */
.btn {
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn:active {
    transform: translateY(0);
}

/* 卡片陰影效果 */
.card-hover {
    transition: all 0.3s ease;
}

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

/* 載入動畫 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-overlay .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* 通知樣式 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

/* 表格美化 */
.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
}

/* Badge 美化 */
.badge {
    padding: 0.5em 0.75em;
    font-weight: 500;
}

/* 圖表容器 */
.chart-container {
    position: relative;
    height: 300px;
}

/* 工具提示 */
.tooltip-inner {
    max-width: 300px;
    text-align: left;
}

/* 活動記錄項目 */
.activity-item {
    padding: 0.75rem;
    border-left: 3px solid #dee2e6;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.activity-item:hover {
    background-color: #f8f9fa;
    border-left-color: #18BC9C;
}

/* 連線狀態標籤 */
.connection-status {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 5px;
    margin-bottom: 0.5rem;
}

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

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

/* 統計數字動畫 */
@keyframes countUp {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.stat-value {
    animation: countUp 0.5s ease-out;
}

/* 錯誤訊息 */
.error-message {
    padding: 1rem;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    color: #721c24;
}

/* 成功訊息 */
.success-message {
    padding: 1rem;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 5px;
    color: #155724;
}

/* 資訊訊息 */
.info-message {
    padding: 1rem;
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 5px;
    color: #0c5460;
}
