/**
 * Virtual Trading - Professional Dashboard Design
 * Matching Findrack Sporting Style
 */

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    --vt-primary: #0066FF;
    --vt-primary-hover: #0052CC;
    --vt-primary-light: #E6F0FF;
    --vt-success: #10B981;
    --vt-success-bg: #D1FAE5;
    --vt-danger: #EF4444;
    --vt-danger-bg: #FEE2E2;
    --vt-warning: #F59E0B;
    --vt-warning-bg: #FEF3C7;
    --vt-icon-color: #3D4F5F;
    --vt-text-primary: #1F2937;
    --vt-text-secondary: #6B7280;
    --vt-text-muted: #9CA3B8;
    --vt-border: #E5E7EB;
    --vt-background: #F3F4F6;
    --vt-surface: #FFFFFF;
    --vt-shadow: 0 1px 3px rgba(0,0,0,0.08);
    --vt-shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --vt-radius: 10px;
    --vt-radius-lg: 16px;
}

/* ============================================
   BASE STYLES
   ============================================ */
.vt-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--vt-text-primary);
    background: var(--vt-background);
    padding: 30px;
    max-width: 1200px;
    margin: 0 auto;
    min-height: calc(100vh - 200px);
}

/* ============================================
   PAGE HEADER
   ============================================ */
.vt-page-header {
    margin-bottom: 30px;
}

.vt-page-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--vt-text-primary);
    margin: 0;
}

.vt-page-header h1::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--vt-primary);
    margin-top: 15px;
    border-radius: 2px;
}

/* ============================================
   QUICK ACTIONS BAR - FINDRACK STYLE
   ============================================ */
.vt-quick-actions-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    background: var(--vt-surface);
    border: 1px solid var(--vt-border);
    border-radius: var(--vt-radius-lg);
    padding: 25px 30px;
    margin-bottom: 30px;
    justify-content: flex-start;
    box-shadow: var(--vt-shadow);
}

.vt-quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 100px;
    background: var(--vt-surface);
    border: 1px solid var(--vt-border);
    border-radius: var(--vt-radius);
    text-decoration: none !important;
    color: var(--vt-text-primary);
    transition: all 0.25s ease;
    cursor: pointer;
}

.vt-quick-action:hover {
    border-color: var(--vt-primary);
    background: var(--vt-primary-light);
    transform: translateY(-3px);
    box-shadow: var(--vt-shadow-md);
}

.vt-quick-action:hover .vt-quick-action-icon {
    color: var(--vt-primary);
}

.vt-quick-action-icon {
    font-size: 28px;
    color: var(--vt-icon-color);
    margin-bottom: 10px;
    transition: color 0.25s ease;
}

.vt-quick-action-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--vt-text-secondary);
}

/* ============================================
   WELCOME SECTION
   ============================================ */
.vt-welcome-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    background: var(--vt-surface);
    border: 1px solid var(--vt-border);
    border-radius: var(--vt-radius-lg);
    padding: 25px 30px;
    margin-bottom: 30px;
    box-shadow: var(--vt-shadow);
}

.vt-welcome-text h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 5px 0;
    color: var(--vt-text-primary);
}

.vt-welcome-text h2::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: #D1D5DB;
    margin-top: 12px;
    border-radius: 2px;
}

.vt-date {
    color: var(--vt-text-muted);
    font-size: 14px;
    margin: 15px 0 0 0;
}

.vt-welcome-actions {
    display: flex;
    gap: 12px;
}

/* ============================================
   BUTTONS
   ============================================ */
.vt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    border: none;
    border-radius: var(--vt-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none !important;
    white-space: nowrap;
}

.vt-btn i {
    font-size: 12px;
}

.vt-btn-primary {
    background: var(--vt-primary);
    color: white !important;
}

.vt-btn-primary:hover {
    background: var(--vt-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
    color: white !important;
}

.vt-btn-outline {
    background: transparent;
    color: var(--vt-text-primary) !important;
    border: 1px solid var(--vt-border);
}

.vt-btn-outline:hover {
    border-color: var(--vt-primary);
    color: var(--vt-primary) !important;
    background: var(--vt-primary-light);
}

.vt-btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.vt-btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

/* ============================================
   ALERT BANNER
   ============================================ */
.vt-alert-banner {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--vt-warning-bg);
    border: 1px solid #FCD34D;
    border-radius: var(--vt-radius-lg);
    padding: 20px 25px;
    margin-bottom: 30px;
}

.vt-alert-icon {
    font-size: 28px;
    color: var(--vt-warning);
}

.vt-alert-content {
    flex: 1;
}

.vt-alert-content strong {
    display: block;
    font-size: 16px;
    margin-bottom: 5px;
    color: #92400E;
}

.vt-alert-content p {
    margin: 0;
    font-size: 14px;
    color: #B45309;
}

/* ============================================
   STATS ROW
   ============================================ */
.vt-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.vt-stat-card {
    background: var(--vt-surface);
    border: 1px solid var(--vt-border);
    border-radius: var(--vt-radius-lg);
    padding: 25px;
    text-align: center;
    box-shadow: var(--vt-shadow);
}

.vt-stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--vt-text-primary);
    line-height: 1.2;
}

.vt-stat-number.positive {
    color: var(--vt-success);
}

.vt-stat-number.negative {
    color: var(--vt-danger);
}

.vt-stat-label {
    font-size: 13px;
    color: var(--vt-text-muted);
    margin-top: 8px;
}

/* ============================================
   DASHBOARD PANELS
   ============================================ */
.vt-dashboard-panels {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.vt-panel {
    background: var(--vt-surface);
    border: 1px solid var(--vt-border);
    border-radius: var(--vt-radius-lg);
    overflow: hidden;
    box-shadow: var(--vt-shadow);
}

.vt-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--vt-border);
    background: linear-gradient(to bottom, #FAFAFA, #F5F5F5);
}

.vt-panel-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--vt-text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.vt-panel-title i {
    color: var(--vt-icon-color);
    font-size: 16px;
}

.vt-panel-link {
    font-size: 13px;
    color: var(--vt-primary);
    text-decoration: none !important;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

.vt-panel-link:hover {
    text-decoration: underline !important;
}

.vt-panel-link i {
    font-size: 10px;
}

.vt-panel-content {
    padding: 20px;
}

.vt-empty-panel {
    text-align: center;
    padding: 30px 20px;
    color: var(--vt-text-muted);
}

.vt-empty-panel i {
    display: block;
    margin-bottom: 10px;
}

.vt-empty-panel p {
    margin: 0 0 15px 0;
    font-size: 14px;
}

/* ============================================
   PORTFOLIO LIST
   ============================================ */
.vt-portfolio-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vt-portfolio-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--vt-background);
    border-radius: var(--vt-radius);
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.vt-portfolio-row:hover {
    border-color: var(--vt-border);
    background: white;
}

.vt-portfolio-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vt-portfolio-info strong {
    font-size: 14px;
    font-weight: 600;
}

.vt-portfolio-values {
    text-align: right;
}

.vt-portfolio-balance {
    font-size: 16px;
    font-weight: 700;
}

.vt-portfolio-pnl {
    font-size: 13px;
    font-weight: 600;
    margin-top: 2px;
}

.vt-portfolio-pnl.positive { color: var(--vt-success); }
.vt-portfolio-pnl.negative { color: var(--vt-danger); }

/* ============================================
   BADGES
   ============================================ */
.vt-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-radius: 5px;
    background: var(--vt-background);
    color: var(--vt-text-secondary);
}

.vt-badge-growth {
    background: var(--vt-success-bg);
    color: #047857;
}

.vt-badge-dividend {
    background: var(--vt-primary-light);
    color: var(--vt-primary);
}

.vt-badge-balanced {
    background: #FEF3C7;
    color: #B45309;
}

/* ============================================
   MARKET INDICES
   ============================================ */
.vt-market-indices {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vt-index-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: var(--vt-background);
    border-radius: var(--vt-radius);
}

.vt-index-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--vt-text-primary);
}

.vt-index-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--vt-text-primary);
}

.vt-index-change {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 5px;
}

.vt-index-change.positive {
    background: var(--vt-success-bg);
    color: var(--vt-success);
}

.vt-index-change.negative {
    background: var(--vt-danger-bg);
    color: var(--vt-danger);
}

/* ============================================
   ALERTS
   ============================================ */
.vt-alerts-badge {
    background: var(--vt-danger-bg);
    color: var(--vt-danger);
    padding: 15px;
    border-radius: var(--vt-radius);
    text-align: center;
    font-weight: 600;
    font-size: 14px;
}

/* ============================================
   GLOBAL HELPERS
   ============================================ */
.positive { color: var(--vt-success) !important; }
.negative { color: var(--vt-danger) !important; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .vt-dashboard-panels {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .vt-page {
        padding: 20px;
    }
    
    .vt-stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .vt-quick-actions-bar {
        gap: 10px;
        padding: 20px;
        justify-content: center;
    }
    
    .vt-quick-action {
        width: 100px;
        height: 90px;
    }
    
    .vt-quick-action-icon {
        font-size: 24px;
    }
    
    .vt-quick-action-label {
        font-size: 10px;
    }
    
    .vt-welcome-section {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
    }
    
    .vt-welcome-actions {
        width: 100%;
    }
    
    .vt-welcome-actions .vt-btn {
        flex: 1;
        text-align: center;
    }
    
    .vt-alert-banner {
        flex-direction: column;
        text-align: center;
    }
    
    .vt-page-header h1 {
        font-size: 26px;
    }
    
    .vt-stat-number {
        font-size: 26px;
    }
}

@media (max-width: 480px) {
    .vt-quick-actions-bar {
        padding: 15px;
    }
    
    .vt-quick-action {
        width: 80px;
        height: 80px;
    }
    
    .vt-quick-action-icon {
        font-size: 22px;
        margin-bottom: 8px;
    }
    
    .vt-quick-action-label {
        font-size: 9px;
    }
    
    .vt-stats-row {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .vt-stat-card {
        padding: 15px;
    }
    
    .vt-stat-number {
        font-size: 22px;
    }
    
    .vt-stat-label {
        font-size: 11px;
    }
}

/* Stats Row - Market Data Page */
.vt-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.vt-stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
}

.vt-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.vt-stat-content {
    display: flex;
    flex-direction: column;
}

.vt-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}

.vt-stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

/* Card Header Actions */
.vt-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.vt-search-box {
    position: relative;
}

.vt-search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.vt-search-box .vt-input {
    padding-left: 2.5rem;
    min-width: 200px;
}

/* Action Card Badge */
.vt-action-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #2563eb;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.vt-action-card.active .vt-action-badge {
    background: white;
    color: #2563eb;
}

/* High Yield Highlight */
.vt-yield.high-yield {
    color: #059669;
    font-weight: 600;
}

/* Symbol styling */
.vt-symbol {
    color: #2563eb;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

/* Responsive Stats */
@media (max-width: 1024px) {
    .vt-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .vt-stats-row {
        grid-template-columns: 1fr;
    }
    
    .vt-header-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .vt-search-box .vt-input {
        min-width: 100%;
    }
}

/* =====================================================
   MARKET DATA PAGE - HORIZONTAL BUTTON ROW
   ===================================================== */

.vt-market-page .vt-quick-actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.vt-market-page .vt-action-card {
    flex: 1;
    min-width: 140px;
    max-width: 180px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 1.25rem 1rem;
    display: flex !important;
    flex-direction: column !important;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none !important;
    transition: all 0.2s ease;
    position: relative;
    cursor: pointer;
}

.vt-market-page .vt-action-card:hover {
    border-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.15);
    text-decoration: none !important;
}

.vt-market-page .vt-action-card.active {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-color: #2563eb;
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.3);
}

.vt-market-page .vt-action-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.vt-market-page .vt-action-card.active .vt-action-icon {
    background: rgba(255,255,255,0.2);
}

.vt-market-page .vt-action-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    text-align: center;
    text-decoration: none !important;
}

.vt-market-page .vt-action-card.active .vt-action-label {
    color: white;
}

.vt-market-page .vt-action-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #2563eb;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    min-width: 24px;
    text-align: center;
}

.vt-market-page .vt-action-card.active .vt-action-badge {
    background: rgba(255,255,255,0.25);
}

/* ============================================
   PRICE ARROW INDICATORS
   ============================================ */
.vt-price-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
    margin-right: 8px;
    flex-shrink: 0;
}

.vt-arrow-up {
    background: var(--vt-success-bg, #d1fae5);
    color: var(--vt-success, #10b981);
}

.vt-arrow-down {
    background: var(--vt-danger-bg, #fee2e2);
    color: var(--vt-danger, #ef4444);
}

.vt-arrow-neutral {
    background: #f3f4f6;
    color: #9ca3af;
}

/* Asset cell with arrow */
.vt-asset-cell {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.vt-asset-cell strong {
    color: var(--vt-text-primary, #1f2937);
    font-weight: 600;
}

.vt-asset-cell span:not(.vt-price-arrow) {
    font-size: 12px;
    color: var(--vt-text-secondary, #6b7280);
    display: block;
    width: 100%;
    margin-left: 30px;
}
