/* PolyBudget Dashboard - Telegram Mini App Styles */

:root {
    /* Telegram theme colors - will be overridden by WebApp */
    --tg-theme-bg-color: #1a1a2e;
    --tg-theme-text-color: #ffffff;
    --tg-theme-hint-color: #8e8e93;
    --tg-theme-link-color: #5eb5ff;
    --tg-theme-button-color: #5eb5ff;
    --tg-theme-button-text-color: #ffffff;
    --tg-theme-secondary-bg-color: #0f0f23;
    
    /* Custom colors */
    --success-color: #4ade80;
    --danger-color: #f87171;
    --warning-color: #fbbf24;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--tg-theme-bg-color);
    color: var(--tg-theme-text-color);
    min-height: 100vh;
    padding-bottom: 60px;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.badge.live {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.stat-label {
    font-size: 12px;
    color: var(--tg-theme-hint-color);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
}

.status-run {
    color: var(--success-color);
}

.status-pause {
    color: var(--warning-color);
}

.status-hard {
    color: var(--danger-color);
}

/* Sections */
.section {
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.section h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Activity Rows */
.activity-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.activity-row:last-child {
    border-bottom: none;
}

.activity-row span:first-child {
    color: var(--tg-theme-hint-color);
}

.activity-row .value {
    font-weight: 600;
}

/* Positions List */
.positions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.position-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 12px;
}

.position-title {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.position-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--tg-theme-hint-color);
}

.position-pnl {
    font-weight: 600;
}

.pnl-positive {
    color: var(--success-color);
}

.pnl-negative {
    color: var(--danger-color);
}

/* Trades List */
.trades-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.trade-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.trade-info {
    flex: 1;
}

.trade-side {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 8px;
}

.trade-side.buy {
    background: rgba(74, 222, 128, 0.2);
    color: var(--success-color);
}

.trade-side.sell {
    background: rgba(248, 113, 113, 0.2);
    color: var(--danger-color);
}

.trade-title {
    font-size: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.trade-amount {
    font-weight: 600;
    font-size: 14px;
}

/* Loading state */
.loading {
    text-align: center;
    color: var(--tg-theme-hint-color);
    padding: 20px;
}

/* Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    text-align: center;
    font-size: 11px;
    color: var(--tg-theme-hint-color);
    background: var(--tg-theme-bg-color);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 20px;
    color: var(--tg-theme-hint-color);
    font-size: 13px;
}
