/* 投資交易表單樣式 */
.transaction-type-option {
    padding: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80px;
}

.transaction-type-option:hover {
    border-color: #3b82f6;
    background: #f0f9ff;
}

.transaction-type-option.active {
    border-color: #3b82f6;
    background: #dbeafe;
    color: #1e40af;
}

.transaction-type-option .icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.transaction-type-option .label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.transaction-type-option.active .label {
    color: #1e40af;
}

/* 投資交易表單特定樣式 */
#investment-transaction-form .form-group {
    margin-bottom: 20px;
}

#investment-transaction-form .form-hint {
    margin-top: 5px;
    font-size: 12px;
    color: #6b7280;
}

#transaction-preview {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-top: 20px;
}

#transaction-preview h5 {
    margin-bottom: 10px;
    font-weight: 600;
    color: #374151;
}

#transaction-preview .text-sm {
    color: #6b7280;
}

/* 動態欄位顯示 */
#trade-fields, #dividend-fields, #split-fields {
    transition: all 0.3s ease;
}

/* 投資交易表單網格佈局 */
#investment-transaction-form .grid {
    display: grid;
}

#investment-transaction-form .grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

#investment-transaction-form .grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

#investment-transaction-form .gap-3 {
    gap: 12px;
}

#investment-transaction-form .gap-4 {
    gap: 16px;
}

@media (max-width: 768px) {
    #investment-transaction-form .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    #investment-transaction-form .grid-cols-2 {
        grid-template-columns: 1fr;
    }
}

/* 自定義銀行/機構表單樣式 */
.icon-option {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    min-height: 40px;
    transition: all 0.2s ease;
    border: 2px solid #e5e7eb;
    background: white;
    cursor: pointer;
    border-radius: 6px;
}

.icon-option:hover {
    border-color: #3b82f6;
    background: #f8fafc;
    transform: scale(1.05);
}

.icon-option.selected {
    border-color: #3b82f6;
    background: #eff6ff;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.icon-option:active {
    transform: scale(0.95);
}

#bank-icon-grid {
    margin-top: 8px;
    gap: 8px;
}

/* 表單輸入組合樣式 */
.form-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-input-group .form-select {
    flex: 1;
}

.form-input-group .btn-secondary {
    flex-shrink: 0;
    padding: 8px 12px;
    font-size: 14px;
    min-width: auto;
    white-space: nowrap;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .form-input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-input-group .btn-secondary {
        width: 100%;
        margin-top: 8px;
    }
    
    #bank-icon-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 480px) {
    #bank-icon-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .icon-option {
        min-height: 36px;
        font-size: 16px;
    }
}

/* 新增投資快捷按鈕的CSS樣式 */
.investment-shortcut-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.investment-shortcut-buttons .btn {
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.investment-shortcut-buttons .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.investment-shortcut-buttons .btn:active {
    transform: translateY(0);
}

/* 投資表單特殊樣式 */
.investment-form-header {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #e0f2fe;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.investment-form-header.profit {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #bbf7d0;
}

.investment-form-header.dividend {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-color: #a7f3d0;
}

.investment-form-header.loss {
    background: linear-gradient(135deg, #fff7ed 0%, #fed7aa 100%);
    border-color: #fde68a;
}

.investment-form-header .icon {
    font-size: 1.5rem;
    margin-right: 0.75rem;
}

.investment-form-header h4 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.investment-form-header p {
    margin: 0.25rem 0 0 0;
    font-size: 0.875rem;
    opacity: 0.8;
}

/* 投資項目選擇器增強 */
.investment-select-wrapper {
    position: relative;
}

.investment-select-wrapper::before {
    content: "📊";
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 1;
}

.investment-select-wrapper select {
    padding-left: 2.5rem;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .investment-shortcut-buttons {
        justify-content: center;
    }
    
    .investment-shortcut-buttons .btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .investment-form-header {
        flex-direction: column;
        text-align: center;
    }
    
    .investment-form-header .icon {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
}

/* 表單行樣式增強 */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* 投資詳情網格 */
.investment-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 640px) {
    .investment-details-grid {
        grid-template-columns: 1fr;
    }
}

/* 表單提示文字樣式 */
.form-hint {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
    line-height: 1.4;
}

/* 投資損失類型選擇器 */
.loss-type-selector {
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    background-color: #ffffff;
    transition: border-color 0.2s ease;
}

.loss-type-selector:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

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

.investment-form-container {
    animation: slideIn 0.3s ease-out;
}

/* 按鈕群組響應式佈局 */
.btn-group-responsive {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}

@media (max-width: 768px) {
    .btn-group-responsive {
        justify-content: center;
    }
}

/* 輸入框焦點效果 */
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 成功和錯誤狀態 */
.form-input.success {
    border-color: #10b981;
}

.form-input.error {
    border-color: #ef4444;
}

/* 股息計算器樣式 */
.dividend-calculator {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.dividend-calculator h5 {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

.dividend-calculator .calculation-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.875rem;
}

.dividend-calculator .operator {
    font-weight: bold;
    color: #6b7280;
}

/* 投資類型標籤 */
.investment-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    background: #e5e7eb;
    color: #374151;
}

.investment-type-badge.profit {
    background: #dcfce7;
    color: #166534;
}

.investment-type-badge.dividend {
    background: #dbeafe;
    color: #1e40af;
}

.investment-type-badge.loss {
    background: #fef3c7;
    color: #92400e;
}

/* 載入動畫 */
.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 工具提示 */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem;
    background: #1f2937;
    color: white;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1000;
}

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

/* 表格增強 */
.investment-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.investment-table th,
.investment-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.investment-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.investment-table tr:hover {
    background: #f9fafb;
}

/* 數字格式化 */
.number-positive {
    color: #059669;
}

.number-negative {
    color: #dc2626;
}

.number-neutral {
    color: #6b7280;
}

/* 投資組合卡片 */
.investment-portfolio-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.investment-portfolio-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.investment-portfolio-card:hover::before {
    opacity: 1;
}

.investment-portfolio-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.investment-portfolio-card .portfolio-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.investment-portfolio-card .portfolio-change {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* 無數據狀態 */
.no-data-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

.no-data-state .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.no-data-state h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.no-data-state p {
    margin: 0;
    font-size: 0.875rem;
    opacity: 0.8;
}

/* 打印樣式 */
@media print {
    .investment-shortcut-buttons,
    .btn-group-responsive,
    .tooltip::after {
        display: none !important;
    }
    
    .investment-form-container {
        box-shadow: none !important;
        border: 1px solid #e5e7eb !important;
    }
}

/* 無障礙改進 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 高對比度模式 */
@media (prefers-contrast: high) {
    .form-input,
    .form-select,
    .form-textarea {
        border-width: 2px;
    }
    
    .investment-form-header {
        border-width: 2px;
    }
}

/* 動畫偏好設定 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 深色模式支援 */
@media (prefers-color-scheme: dark) {
    .investment-form-header {
        background: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }
    
    .investment-form-header.profit {
        background: #064e3b;
        border-color: #059669;
    }
    
    .investment-form-header.dividend {
        background: #1e3a8a;
        border-color: #3b82f6;
    }
    
    .investment-form-header.loss {
        background: #92400e;
        border-color: #f59e0b;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        background: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }
    
    .form-hint {
        color: #9ca3af;
    }
    
    .investment-table {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .investment-table th {
        background: #374151;
    }
    
    .investment-table tr:hover {
        background: #374151;
    }
}

/* 列印友好 */
@page {
    margin: 1in;
}

@media print {
    .investment-shortcut-buttons,
    button,
    .btn {
        display: none !important;
    }
    
    .investment-form-container {
        box-shadow: none !important;
        page-break-inside: avoid;
    }
    
    .investment-table {
        page-break-inside: auto;
    }
    
    .investment-table tr {
        page-break-inside: avoid;
    }
}

/* 額外的實用樣式 */
.text-success {
    color: #059669;
}

.text-error {
    color: #dc2626;
}

.text-warning {
    color: #d97706;
}

.text-info {
    color: #0891b2;
}

.bg-success {
    background-color: #ecfdf5;
}

.bg-error {
    background-color: #fef2f2;
}

.bg-warning {
    background-color: #fffbeb;
}

.bg-info {
    background-color: #f0f9ff;
}

.border-success {
    border-color: #10b981;
}

.border-error {
    border-color: #ef4444;
}

.border-warning {
    border-color: #f59e0b;
}

.border-info {
    border-color: #0ea5e9;
} 

/* 銀行帳戶UI改進樣式 */

/* 空狀態樣式 */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #6b7280;
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
}

.empty-state p {
    font-size: 16px;
    margin-bottom: 24px;
}

/* 帳戶總覽樣式 */
.account-summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    color: white;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.summary-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.summary-card .summary-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.summary-card h4 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    opacity: 0.9;
}

.summary-card .summary-value {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.summary-card .summary-value.positive {
    color: #10b981;
}

.summary-card .summary-value.negative {
    color: #ef4444;
}

/* 帳戶篩選樣式 */
.account-filters {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filter-section {
    display: flex;
    gap: 12px;
    align-items: center;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.filter-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* 帳戶網格佈局 */
.accounts-grid {
    display: grid;
    gap: 24px;
}

.account-group {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

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

/* 分組標題 */
.group-title {
    background: #f8fafc;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.group-title .group-icon {
    font-size: 20px;
}

.group-title .group-count {
    background: #e2e8f0;
    color: #64748b;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-left: auto;
}

/* 帳戶群組內容 */
.group-accounts {
    padding: 12px;
    display: grid;
    gap: 12px;
}

/* 帳戶卡片 */
.account-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.account-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.account-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #e2e8f0;
    transition: background 0.2s ease;
}

.account-card.positive-balance::before {
    background: #10b981;
}

.account-card.negative-balance::before {
    background: #ef4444;
}

.account-card.debt-balance::before {
    background: #f59e0b;
}

.account-card.debt-balance-positive::before {
    background: #06b6d4;
}

/* 帳戶標題區域 */
.account-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.account-main-info {
    flex: 1;
}

.account-name {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.account-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #64748b;
}

.bank-name {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.account-number {
    font-family: monospace;
    opacity: 0.7;
}

/* 帳戶餘額 */
.account-balance {
    text-align: right;
    margin-left: 16px;
}

.balance-amount {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 2px;
}

.balance-currency {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

/* 帳戶詳細信息 */
.account-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

/* 狀態指示器 */
.account-status {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.status-indicator {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.status-indicator.warning {
    background: #fef3c7;
    color: #92400e;
}

.status-indicator.info {
    background: #dbeafe;
    color: #1e40af;
}

.status-indicator.success {
    background: #d1fae5;
    color: #065f46;
}

/* 帳戶擁有者 */
.account-owner {
    font-size: 12px;
    color: #3b82f6;
    font-weight: 500;
}

/* 帳戶操作按鈕 */
.account-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
}

.action-btn {
    padding: 6px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
}

.action-btn:hover {
    background: #f8fafc;
    border-color: #9ca3af;
}

.action-btn.edit-btn:hover {
    color: #3b82f6;
    border-color: #3b82f6;
}

.action-btn.delete-btn:hover {
    color: #ef4444;
    border-color: #ef4444;
}

.action-btn.transaction-btn:hover {
    color: #10b981;
    border-color: #10b981;
}

.action-btn svg {
    width: 16px;
    height: 16px;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filter-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-select {
        width: 100%;
    }
    
    .account-header {
        flex-direction: column;
        gap: 12px;
    }
    
    .account-balance {
        text-align: left;
        margin-left: 0;
    }
    
    .group-accounts {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .account-summary {
        padding: 16px;
    }
    
    .summary-card {
        padding: 12px;
    }
    
    .account-card {
        padding: 12px;
    }
    
    .account-actions {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .action-btn {
        padding: 4px;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .account-group {
        background: #1f2937;
        border-color: #374151;
    }
    
    .group-title {
        background: #111827;
        border-color: #374151;
        color: #f9fafb;
    }
    
    .account-card {
        background: #1f2937;
        border-color: #374151;
    }
    
    .account-name {
        color: #f9fafb;
    }
    
    .balance-amount {
        color: #f9fafb;
    }
    
    .filter-select {
        background: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }
    
    .account-filters {
        background: #1f2937;
        border-color: #374151;
    }
    
    .action-btn {
        background: #1f2937;
        border-color: #374151;
        color: #9ca3af;
    }
    
    .action-btn:hover {
        background: #111827;
    }
} 