/* 中央氣象署光達剖風顯示系統統一樣式表 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: '微軟正黑體', 'Microsoft JhengHei', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

/* 頁首 */
header {
    background-color: #2c3e50;
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    font-size: 28px;
    font-weight: normal;
}

.user-info {
    text-align: right;
}

.user-info .username {
    font-weight: bold;
    margin-bottom: 5px;
}

/* 導航 */
nav {
    background-color: #34495e;
    padding: 10px 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    margin-right: 10px;
    border-radius: 4px;
    display: inline-block;
    transition: background-color 0.3s;
}

nav a:hover {
    background-color: #2c3e50;
}

/* 主要內容 */
.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

/* 內容卡片 */
.content-card, .content-section, .section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 30px;
    margin-bottom: 20px;
}

/* 標題 */
h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #2c3e50;
}

h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #2c3e50;
}

.section-title {
    color: #2c3e50;
    font-size: 24px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

/* 表格 */
.table, .data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.table th, .table td,
.data-table th, .data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th, .data-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #2c3e50;
}

.table tr:hover, .data-table tr:hover {
    background-color: #f8f9fa;
}

/* 表單 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.form-control, .form-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: #3498db;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-inline {
    display: flex;
    gap: 10px;
    align-items: end;
    margin-bottom: 20px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

/* 按鈕 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 2px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
    border: none;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background-color: #229954;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-sm, .btn-small {
    padding: 5px 10px;
    font-size: 12px;
}

/* 徽章 */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 0.85em;
    font-weight: bold;
}

.badge-zx {
    background-color: #e3f2fd;
    color: #1976d2;
}

.badge-halo {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.badge-success {
    background-color: #d4edda;
    color: #155724;
}

.badge-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.badge-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

.badge-warning {
    background-color: #fff3cd;
    color: #856404;
}

.badge-admin {
    background-color: #f0e6ff;
    color: #8e44ad;
}

.badge-user {
    background-color: #e8f4f8;
    color: #2980b9;
}

/* 狀態 */
.status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 0.85em;
}

.status-active {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.status-idle {
    background-color: #fff3e0;
    color: #ef6c00;
}

/* 警告訊息 */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* 工具類 */
.text-center {
    text-align: center;
}

.text-muted {
    color: #6c757d;
}

.hidden {
    display: none;
}

.required {
    color: #dc3545;
}

/* 代碼樣式 */
code {
    background-color: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
    color: #666;
    font-family: Consolas, 'Courier New', monospace;
}

/* 專案相關樣式 */
.project-header {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.project-title {
    color: #2c3e50;
    font-size: 32px;
    margin-bottom: 10px;
}

.project-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-label {
    font-weight: bold;
    color: #666;
}

.project-description {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 4px;
    margin-top: 20px;
    line-height: 1.6;
}

.project-link {
    font-weight: bold;
    color: #1976d2;
    text-decoration: none;
}

.project-link:hover {
    text-decoration: underline;
}

/* 設備相關 */
.device-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 5px;
    margin-top: 10px;
}

.device-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.stat-card {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 4px;
    text-align: center;
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
    color: #1976d2;
    margin-bottom: 5px;
}

.stat-label {
    color: #666;
    font-size: 14px;
}

/* 用戶列表 */
.user-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.user-item {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-role {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    background-color: #e8f4f8;
    color: #2980b9;
}

.user-role.admin {
    background-color: #f0e6ff;
    color: #8e44ad;
}

/* 登入頁面 */
.login-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    width: 400px;
    max-width: 95%;
    margin: 100px auto;
}

.login-header {
    background: #2c3e50;
    color: white;
    padding: 30px;
    text-align: center;
}

.login-header h1 {
    margin-bottom: 10px;
    font-size: 24px;
}

.login-body {
    padding: 40px 30px;
}

.login-footer {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 12px;
    border-top: 1px solid #eee;
}

/* 開發中訊息 */
.coming-soon {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.coming-soon-icon {
    font-size: 64px;
    margin-bottom: 20px;
    color: #ccc;
}

.coming-soon h3 {
    color: #666;
    margin-bottom: 10px;
}

.coming-soon p {
    color: #999;
}

/* 統計網格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Tab 系統 */
.tabs {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.tab-nav {
    display: flex;
    border-bottom: 1px solid #ddd;
    flex-wrap: wrap;
}

.tab-nav a {
    padding: 15px 30px;
    text-decoration: none;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    cursor: pointer;
}

.tab-nav a.active {
    color: #3498db;
    border-bottom-color: #3498db;
    background-color: #f8f9fa;
}

.tab-nav a:hover {
    background-color: #f8f9fa;
}

.tab-content {
    background: white;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 風羽圖相關樣式 */
.windbarb-container {
    text-align: center;
    padding: 20px;
}

.windbarb-controls {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.windbarb-nav-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
    min-width: 120px;
}

.windbarb-nav-btn:hover:not(:disabled) {
    background-color: #2980b9;
}

.windbarb-nav-btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

.windbarb-info {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: inline-block;
    min-width: 200px;
}

.windbarb-image-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
    margin: 0 auto;
}

.windbarb-image {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.3s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.windbarb-image:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.windbarb-loading {
    text-align: center;
    padding: 50px;
    color: #666;
    font-size: 18px;
}

.windbarb-error {
    text-align: center;
    padding: 50px;
    color: #e74c3c;
    background-color: #fdf2f2;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    margin: 20px;
}

/* 全螢幕模式 */
.fullscreen-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    cursor: pointer;
}

.fullscreen-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 95%;
    max-height: 95%;
    border-radius: 5px;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

.fullscreen-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    z-index: 10000;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.fullscreen-close:hover {
    color: #ff6b6b;
}

.image-counter {
    color: #666;
    font-size: 14px;
    margin-left: 10px;
}

/* 模態框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 500px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: black;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .table, .data-table {
        font-size: 14px;
    }
    
    .btn {
        padding: 4px 8px;
        font-size: 14px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .project-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .tab-nav {
        overflow-x: auto;
    }
    
    .tab-nav a {
        padding: 12px 20px;
        white-space: nowrap;
    }
    
    .windbarb-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .windbarb-nav-btn {
        width: 100%;
        max-width: 200px;
    }
    
    .windbarb-info {
        margin-bottom: 10px;
    }
    
    .fullscreen-close {
        top: 10px;
        right: 15px;
        font-size: 30px;
    }
}

@media (max-width: 480px) {
    .header-container {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .user-info {
        text-align: center;
    }
    
    h1 {
        font-size: 24px;
    }
    
    .project-title {
        font-size: 28px;
    }
    
    .windbarb-image {
        max-width: 95%;
    }
}

/* 相容性支援 */
.header {
    background-color: #2c3e50;
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Tab 導航的額外樣式 */
.nav-link {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    margin-right: 10px;
    border-radius: 4px;
    display: inline-block;
    transition: background-color 0.3s;
}

.nav-link:hover {
    background-color: #2c3e50;
}

/* 載入動畫 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

/* 空狀態 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-state h3 {
    color: #999;
    margin-bottom: 10px;
}

.empty-state p {
    color: #bbb;
}