/* ============================================
   RAFALBOT v2.8.0 - DESIGN INSPIRÉ ROSSTRADER
   ============================================ */

:root {
    /* Couleurs principales */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    --wallet-gradient: linear-gradient(135deg, #FF8C00 0%, #FFD700 50%, #FF8C00 100%);
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --warning-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    
    /* Couleurs de base */
    --bg-primary: #0a0e27;
    --bg-secondary: #111827;
    --bg-card: #1a1f36;
    --bg-hover: #252b47;
    
    /* Textes */
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    /* Accents */
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-purple: #8b5cf6;
    --accent-pink: #ec4899;
    --accent-orange: #f59e0b;
    
    /* Bordures */
    --border-color: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.2);
    
    /* Ombres */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(102, 126, 234, 0.3);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* ============================================
   WALLET HEADER (Modern Style)
   ============================================ */

.wallet-header {
    background: var(--wallet-gradient);
    padding: 12px 24px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-glow);
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.wallet-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wallet-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    backdrop-filter: blur(10px);
}

.wallet-info h3 {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 4px;
}

.wallet-amount {
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wallet-currency {
    font-size: 1rem;
    font-weight: 600;
    opacity: 0.8;
}

.wallet-disponible {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 2px;
}

.btn-recharge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-recharge:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* ============================================
   USER PROFILE HEADER
   ============================================ */

.user-profile-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.user-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.user-status-dot {
    width: 14px;
    height: 14px;
    background: var(--accent-green);
    border: 3px solid var(--bg-card);
    border-radius: 50%;
    position: absolute;
    bottom: 0;
    right: 0;
}

.user-info h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.user-email {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.user-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ============================================
   STATUS BADGES (Running, Stopped, etc.)
   ============================================ */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    animation: pulse 2s ease-in-out infinite;
}

.status-badge.running {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.stopped {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-badge.paused {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ============================================
   TRADING CONTROL CENTER
   ============================================ */

.trading-control-center {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 30px;
    margin-top: 30px;
    border: 1px solid var(--border-color);
}

.control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.control-title {
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-title::before {
    content: "●";
    color: var(--accent-green);
    font-size: 1.5rem;
    animation: blink 1.5s ease-in-out infinite;
}

.control-status {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

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

.control-stat-card {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-blue);
}

.control-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.control-btn {
    padding: 14px 24px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.control-btn.start {
    background: var(--success-gradient);
    color: white;
}

.control-btn.stop {
    background: var(--danger-gradient);
    color: white;
}

.control-btn.pause {
    background: var(--accent-blue);
    color: white;
}

.control-btn.reload {
    background: var(--accent-blue);
    color: white;
}

.control-btn.force {
    background: var(--accent-green);
    color: white;
}

.control-btn.auto {
    background: var(--accent-green);
    color: white;
}

/* ============================================
   ENHANCED STAT CARDS
   ============================================ */

.enhanced-stat-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 25px;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.enhanced-stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-gradient);
}

.enhanced-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-hover);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 20px;
}

.stat-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.stat-icon-wrapper.orange {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
}

.stat-icon-wrapper.green {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.stat-icon-wrapper.blue {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

.stat-icon-wrapper.purple {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
}

.stat-details h3 {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.stat-main-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-subtext {
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ============================================
   ENHANCED TABLES
   ============================================ */

.enhanced-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.enhanced-table thead {
    background: var(--bg-secondary);
}

.enhanced-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.enhanced-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.enhanced-table tbody tr {
    transition: background 0.2s;
}

.enhanced-table tbody tr:hover {
    background: var(--bg-hover);
}

.enhanced-table tbody tr:last-child td {
    border-bottom: none;
}

.table-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.table-badge.completed {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.table-badge.pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
}

.table-badge.failed {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* ============================================
   BUTTONS ENHANCEMENT
   ============================================ */

.btn-enhanced {
    padding: 12px 24px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.btn-enhanced:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-enhanced.primary {
    background: var(--primary-gradient);
    color: white;
}

.btn-enhanced.success {
    background: var(--success-gradient);
    color: white;
}

.btn-enhanced.danger {
    background: var(--danger-gradient);
    color: white;
}

.btn-enhanced.outline {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
}

.btn-enhanced.outline:hover {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .wallet-header {
        flex-direction: column;
        text-align: center;
    }
    
    .control-stats {
        grid-template-columns: 1fr 1fr;
    }
    
    .control-actions {
        grid-template-columns: 1fr;
    }
    
    .stat-main-value {
        font-size: 1.5rem;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in {
    animation: slideIn 0.5s ease-out;
}
