/* 경봇 Dashboard Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Sections */
section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

section h2, section h3 {
    margin-bottom: 16px;
    color: #333;
}

/* Market Hero */
.hero-market {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.hero-market h2 {
    color: white;
}

.market-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 20px;
    color: #333;
}

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

.info-item {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
}

.info-item label {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 4px;
}

.info-item value {
    display: block;
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
}

.trade-ready {
    background: #d4edda;
    border-left: 4px solid #28a745;
    padding: 12px;
    border-radius: 4px;
    margin-top: 16px;
}

.trade-not-ready {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    padding: 12px;
    border-radius: 4px;
    margin-top: 16px;
}

/* 거래 실행 미리보기 */
.execution-preview {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.execution-placeholder {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0;
}

.execution-details h4 {
    font-size: 0.95rem;
    margin-bottom: 12px;
    color: #333;
}

.execution-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.9rem;
}

.execution-row.execution-total {
    font-weight: 600;
    border-top: 1px solid #dee2e6;
    margin-top: 8px;
    padding-top: 12px;
}

/* Trading Controls */
.control-group {
    margin-bottom: 16px;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.control-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

.trade-info {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.info-row:last-child {
    margin-bottom: 0;
}

.button-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-auto {
    background: #28a745;
    color: white;
}

.btn-auto:hover {
    background: #218838;
}

.btn-auto.active {
    background: #dc3545;
}

.btn-auto.active:hover {
    background: #c82333;
}

.auto-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.status-message {
    margin-top: 16px;
    padding: 12px;
    border-radius: 6px;
    display: none;
}

.status-message.success {
    background: #d4edda;
    color: #155724;
    display: block;
}

.status-message.error {
    background: #f8d7da;
    color: #721c24;
    display: block;
}

/* Accounts */
.accounts-list {
    display: grid;
    gap: 12px;
}

.account-card {
    display: grid;
    grid-template-columns: 60px 1fr 100px 90px;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    gap: 12px;
}

.btn-approve {
    font-size: 0.8rem;
    padding: 6px 10px;
    background: #17a2b8;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
}

.btn-approve:hover:not(:disabled) {
    background: #138496;
}

.btn-approve:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.account-id {
    font-weight: bold;
    font-size: 1.2rem;
    color: #667eea;
}

.account-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.account-address {
    font-family: monospace;
    font-size: 0.85rem;
    color: #666;
}

.account-usdt {
    font-size: 0.9rem;
    font-weight: 600;
    color: #0d6efd;
}

.total-usdt {
    font-weight: normal;
    color: #0d6efd;
    font-size: 0.9em;
}

.account-balance {
    font-weight: 600;
    font-size: 1.1rem;
}

.account-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    text-align: center;
}

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

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

/* Trade History */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    display: grid;
    grid-template-columns: 150px 1fr 100px 100px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    gap: 12px;
}

.empty-state {
    text-align: center;
    color: #999;
    padding: 40px;
}

/* Loading */
.loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .account-card {
        grid-template-columns: 1fr;
    }
    
    .history-item {
        grid-template-columns: 1fr;
    }
}

/* Auto Mode Stats */
.auto-stats {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.auto-stats h3 {
    color: white;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.9);
    padding: 16px;
    border-radius: 8px;
    text-align: center;
}

.stat-item label {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 8px;
}

.stat-item value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

/* 계정 추가 모달 */
.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 420px;
    width: 90%;
}

.modal-content h4 {
    margin-bottom: 8px;
    color: #333;
}

.modal-content select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

.modal-hint {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.accounts-actions {
    margin-top: 12px;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* 좌측 하단 플로팅 리프레시 버튼 */
.floating-refresh {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 1000;
}

.floating-refresh:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

.floating-refresh:active {
    transform: scale(0.98);
}
