/* 基本樣式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft JhengHei", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* 登入頁面樣式 */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    padding: 40px 30px;
}

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo h2 {
    color: #1e824c;
    margin-top: 10px;
    font-size: 24px;
}

.form-group {
    margin-bottom: 20px;
}

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

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #27ae60;
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 0;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 8px;
}

.login-btn {
    width: 100%;
    background: #27ae60;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.login-btn:hover {
    background: #219a52;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
}

/* 管理後台樣式 */
.admin-header {
    background: #2c3e50;
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.admin-header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    font-size: 24px;
}

.admin-nav a {
    color: white;
    text-decoration: none;
    margin-left: 20px;
    padding: 8px 15px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.admin-nav a:hover {
    background: rgba(255,255,255,0.1);
}

.admin-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.content-box {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 30px;
    margin-bottom: 30px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #27ae60;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn:hover {
    background: #219a52;
}

.btn-primary {
    background: #3498db;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-danger {
    background: #e74c3c;
}

.btn-danger:hover {
    background: #c0392b;
}

/* 圖示按鈕樣式 */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 6px;
    margin: 2px;
    border-radius: 4px;
    font-size: 14px;
    position: relative;
    transition: all 0.2s ease;
}

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

/* Tooltip 樣式 */
.tooltip {
    position: relative;
}

.tooltip::before,
.tooltip::after {
    position: absolute;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 1000;
}

.tooltip::before {
    content: attr(data-tooltip);
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.tooltip::after {
    content: '';
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
}

.tooltip:hover::before,
.tooltip:hover::after {
    visibility: visible;
    opacity: 1;
}

/* 特定操作按鈕顏色 */
.btn-icon.btn-edit {
    background: #3498db;
    color: white;
}

.btn-icon.btn-edit:hover {
    background: #2980b9;
}

.btn-icon.btn-view {
    background: #95a5a6;
    color: white;
}

.btn-icon.btn-view:hover {
    background: #7f8c8d;
}

.btn-icon.btn-copy {
    background: #f39c12;
    color: white;
}

.btn-icon.btn-copy:hover {
    background: #e67e22;
}

.btn-icon.btn-share {
    background: #27ae60;
    color: white;
}

.btn-icon.btn-share:hover {
    background: #219a52;
}

.btn-icon.btn-delete {
    background: #e74c3c;
    color: white;
}

.btn-icon.btn-delete:hover {
    background: #c0392b;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
}

.table tr:hover {
    background: #f8f9fa;
}

.pagination {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

.pagination a {
    display: block;
    padding: 8px 12px;
    margin: 0 5px;
    background: white;
    color: #007bff;
    text-decoration: none;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.pagination a:hover {
    background: #e9ecef;
}

.pagination .active {
    background: #007bff;
    color: white;
}

@media (max-width: 768px) {
    .admin-header .container {
        flex-direction: column;
        text-align: center;
    }
    
    .admin-nav {
        margin-top: 10px;
    }
    
    .admin-nav a {
        margin: 0 10px;
    }
    
    .admin-container {
        padding: 0 15px;
    }
    
    .content-box {
        padding: 20px;
    }
}
