/* 十月飛雲錢包系統 - 樣式表 */

/* ========== 全局樣式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 紫色科幻主題色 */
    --primary-color: #8B5CF6;
    --primary-dark: #7C3AED;
    --primary-light: #A78BFA;
    --secondary-color: #EC4899;
    --accent-color: #10B981;
    
    /* 背景色 */
    --bg-primary: #0F172A;
    --bg-secondary: #1E293B;
    --bg-tertiary: #334155;
    --bg-card: rgba(30, 41, 59, 0.8);
    
    /* 文字色 */
    --text-primary: #F8FAFC;
    --text-secondary: #CBD5E1;
    --text-muted: #94A3B8;
    
    /* 邊框色 */
    --border-color: rgba(139, 92, 246, 0.3);
    --border-glow: rgba(139, 92, 246, 0.6);
    
    /* 陰影 */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.5);
    
    /* 動畫速度 */
    --transition-speed: 0.3s;
}

body {
    font-family: 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 背景動畫效果 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ========== 載入動畫 ========== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s, visibility 0.5s;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
}

.loading-logo img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.loading-spinner {
    margin: 30px auto;
    width: 60px;
    height: 60px;
    border: 4px solid rgba(139, 92, 246, 0.2);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: var(--text-secondary);
    font-size: 16px;
    margin-top: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

/* ========== 頁面容器 ========== */
.page {
    display: none;
    position: relative;
    z-index: 1;
}

.page.active {
    display: block;
}

/* ========== 登入頁面 ========== */
.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    box-shadow: var(--shadow-glow);
    margin-bottom: 20px;
}

.system-title {
    font-size: 32px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.system-subtitle {
    font-family: 'Orbitron', monospace;
    color: var(--text-secondary);
    font-size: 14px;
    letter-spacing: 2px;
}

.login-form-container {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow-lg);
}

.form-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-speed);
    font-size: 16px;
    font-weight: 500;
}

.tab-btn:hover {
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-glow);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== 輸入框 ========== */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.input-group label i {
    margin-right: 8px;
    color: var(--primary-color);
}

.input-group input,
.input-group textarea,
.input-group select,
.filter-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all var(--transition-speed);
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.input-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 12px;
}

.checkbox-group {
    margin: 20px 0;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    color: var(--text-secondary);
    font-size: 14px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
}

.link {
    color: var(--primary-light);
    text-decoration: none;
    transition: color var(--transition-speed);
}

.link:hover {
    color: var(--primary-color);
}

/* ========== 按鈕 ========== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
}

.btn-logout {
    background: rgba(239, 68, 68, 0.2);
    color: #FCA5A5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.3);
    color: white;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* ========== 導航欄 ========== */
.navbar {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 30px;
    display: flex;
    align-items: center;
    gap: 30px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 20px;
}

.navbar-brand img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.navbar-menu {
    display: flex;
    gap: 10px;
    flex: 1;
}

.nav-btn {
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.nav-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-glow);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
}

.user-info i {
    font-size: 24px;
    color: var(--primary-color);
}

/* ========== 內容區域 ========== */
.content-wrapper {
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.view {
    display: none;
}

.view.active {
    display: block;
    animation: fadeIn 0.3s;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.view-header h2 {
    font-size: 28px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ========== 錢包卡片 ========== */
.wallet-card {
    position: relative;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 40px;
    overflow: hidden;
    box-shadow: var(--shadow-glow);
}

.wallet-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.wallet-card-content {
    position: relative;
    z-index: 1;
}

.wallet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.wallet-header h3 {
    font-size: 20px;
    font-weight: 500;
}

.wallet-header i {
    font-size: 32px;
    opacity: 0.8;
}

.wallet-balance {
    margin-bottom: 30px;
}

.balance-label {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 10px;
}

.balance-amount {
    font-family: 'Orbitron', monospace;
    font-size: 48px;
    font-weight: 900;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.wallet-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.info-item span {
    font-size: 14px;
    opacity: 0.8;
}

.info-item strong {
    font-size: 16px;
    font-weight: 600;
}

/* ========== 快速操作 ========== */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.action-btn {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.action-btn:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-glow);
}

.action-btn i {
    font-size: 40px;
}

.deposit-btn i { color: var(--accent-color); }
.withdraw-btn i { color: var(--secondary-color); }
.transfer-btn i { color: var(--primary-color); }

.action-btn span {
    font-size: 18px;
    font-weight: 600;
}

/* ========== 交易列表 ========== */
.recent-transactions {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h3 {
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.transaction-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.transaction-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 20px;
    align-items: center;
    transition: all var(--transition-speed);
}

.transaction-item:hover {
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.transaction-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.transaction-icon.deposit { background: rgba(16, 185, 129, 0.2); color: var(--accent-color); }
.transaction-icon.withdraw { background: rgba(236, 72, 153, 0.2); color: var(--secondary-color); }
.transaction-icon.transfer-in { background: rgba(139, 92, 246, 0.2); color: var(--primary-color); }
.transaction-icon.transfer-out { background: rgba(236, 72, 153, 0.2); color: var(--secondary-color); }

.transaction-info h4 {
    font-size: 16px;
    margin-bottom: 5px;
}

.transaction-info p {
    font-size: 14px;
    color: var(--text-muted);
}

.transaction-amount {
    text-align: right;
}

.transaction-amount .amount {
    font-family: 'Orbitron', monospace;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 5px;
}

.transaction-amount .amount.positive { color: var(--accent-color); }
.transaction-amount .amount.negative { color: var(--secondary-color); }

.transaction-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-completed { background: rgba(16, 185, 129, 0.2); color: var(--accent-color); }
.status-pending { background: rgba(251, 191, 36, 0.2); color: #FCD34D; }
.status-approved { background: rgba(59, 130, 246, 0.2); color: #60A5FA; }
.status-rejected { background: rgba(239, 68, 68, 0.2); color: #FCA5A5; }

.empty-message {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
    font-size: 16px;
}

/* ========== 篩選欄 ========== */
.filter-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-select {
    flex: 1;
    min-width: 200px;
}

/* ========== 轉帳表單 ========== */
.transfer-form-container {
    max-width: 600px;
    margin: 0 auto;
}

.transfer-form {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 40px;
}

.balance-info {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.balance-info strong {
    font-family: 'Orbitron', monospace;
    font-size: 20px;
    color: var(--primary-light);
}

/* ========== 用戶列表 ========== */
.users-list {
    display: grid;
    gap: 20px;
}

.user-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 25px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 20px;
    align-items: center;
    transition: all var(--transition-speed);
}

.user-card:hover {
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: white;
}

.user-details h4 {
    font-size: 18px;
    margin-bottom: 5px;
}

.user-details p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 3px;
}

.user-role {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.role-user { background: rgba(139, 92, 246, 0.2); color: var(--primary-light); }
.role-support { background: rgba(16, 185, 129, 0.2); color: var(--accent-color); }
.role-admin { background: rgba(236, 72, 153, 0.2); color: var(--secondary-color); }

/* ========== 管理介面 ========== */
.admin-sections {
    display: grid;
    gap: 30px;
}

.admin-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 30px;
}

.admin-card h3 {
    font-size: 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.stat-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-item i {
    font-size: 36px;
    color: var(--primary-color);
}

.stat-item p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.stat-item h3 {
    font-family: 'Orbitron', monospace;
    font-size: 32px;
    font-weight: 700;
}

/* ========== 模態框 ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s;
}

.modal-content {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 22px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 30px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition-speed);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-content form {
    padding: 30px;
}

/* ========== 通知系統 ========== */
#notificationContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    border-radius: 10px;
    padding: 15px 20px;
    min-width: 300px;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s;
}

@keyframes slideInRight {
    from { transform: translateX(400px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.notification.success { border-left-color: var(--accent-color); }
.notification.error { border-left-color: var(--secondary-color); }
.notification.warning { border-left-color: #FCD34D; }

.notification-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
    font-weight: 600;
}

.notification-body {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ========== Messenger 浮動按鈕 ========== */
.messenger-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 999;
}

.messenger-tooltip {
    background: white;
    color: #333;
    padding: 12px 18px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    font-size: 14px;
    max-width: 200px;
    line-height: 1.4;
    animation: fadeIn 1s;
}

.messenger-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
    transition: all var(--transition-speed);
    font-size: 28px;
    color: white;
    text-decoration: none;
}

.messenger-button:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.7);
}

/* ========== 響應式設計 ========== */
@media (max-width: 1024px) {
    .navbar {
        flex-wrap: wrap;
        padding: 15px 20px;
    }
    
    .navbar-menu {
        order: 3;
        width: 100%;
        margin-top: 15px;
        overflow-x: auto;
    }
    
    .content-wrapper {
        padding: 20px;
    }
    
    .wallet-card {
        padding: 30px 20px;
    }
    
    .balance-amount {
        font-size: 36px;
    }
}

@media (max-width: 768px) {
    .system-title {
        font-size: 24px;
    }
    
    .login-form-container {
        padding: 30px 20px;
    }
    
    .navbar-brand span {
        display: none;
    }
    
    .nav-btn span {
        display: none;
    }
    
    .nav-btn {
        padding: 10px 15px;
    }
    
    .user-info span {
        display: none;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .transaction-item {
        grid-template-columns: auto 1fr;
        gap: 15px;
    }
    
    .transaction-amount {
        grid-column: 2;
    }
    
    .user-card {
        grid-template-columns: auto 1fr;
        gap: 15px;
    }
    
    .user-actions {
        grid-column: 1 / -1;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-bar {
        flex-direction: column;
    }
    
    .filter-select {
        width: 100%;
    }
    
    .messenger-tooltip {
        display: none;
    }
    
    .view-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .login-form-container {
        padding: 25px 15px;
    }
    
    .wallet-card {
        padding: 20px 15px;
    }
    
    .balance-amount {
        font-size: 28px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .action-btn {
        padding: 20px;
    }
    
    .action-btn i {
        font-size: 32px;
    }
    
    .action-btn span {
        font-size: 16px;
    }
}

/* ========== 列印樣式 ========== */
@media print {
    .navbar,
    .quick-actions,
    .messenger-widget,
    .btn {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .page {
        display: block !important;
    }
}
