/* Trading Dashboard Styles - Robinhood-inspired */

/* Core Dashboard Layout */
.trading-dashboard {
    min-height: 100vh;
    background: #000000;
    color: #ffffff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Enhanced Header */
.dashboard-header {
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 230, 118, 0.15);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 24px;
}

/* Logo and Branding */
.logo {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, #00e676, #00b248);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    letter-spacing: -0.5px;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-tab {
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #888;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.nav-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 230, 118, 0.1), transparent);
    transition: left 0.5s ease;
}

.nav-tab:hover::before {
    left: 100%;
}

.nav-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
}

.nav-tab.active {
    background: rgba(0, 230, 118, 0.12);
    color: #00e676;
    box-shadow: 0 0 20px rgba(0, 230, 118, 0.2);
}

/* Header Right Section */
.header-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.buying-power {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    position: relative;
}

.buying-power::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, transparent, rgba(0, 230, 118, 0.3), transparent);
}

.buying-power-label {
    font-size: 12px;
    color: #888;
    margin-bottom: 2px;
    font-weight: 500;
}

.buying-power-value {
    font-size: 18px;
    font-weight: 700;
    color: #00e676;
    text-shadow: 0 0 10px rgba(0, 230, 118, 0.3);
}

/* User Menu */
.user-menu {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00e676, #00b248);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 700;
    font-size: 18px;
    color: #000;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 230, 118, 0.3);
}

.user-menu:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 30px rgba(0, 230, 118, 0.4);
}

/* Main Content Grid */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px;
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 32px;
    min-height: calc(100vh - 100px);
}

.left-column,
.right-column {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Enhanced Panels */
.panel {
    background: linear-gradient(145deg, rgba(15, 15, 15, 0.9), rgba(5, 5, 5, 0.8));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 32px;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 230, 118, 0.5), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.panel:hover::before {
    opacity: 1;
}

.panel:hover {
    border-color: rgba(0, 230, 118, 0.25);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(0, 230, 118, 0.1);
    transform: translateY(-2px);
}

/* Panel Headers */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.panel-title {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    letter-spacing: -0.3px;
}

.panel-action {
    background: rgba(0, 230, 118, 0.08);
    border: 1px solid rgba(0, 230, 118, 0.2);
    color: #00e676;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.panel-action:hover {
    background: rgba(0, 230, 118, 0.15);
    border-color: rgba(0, 230, 118, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 230, 118, 0.2);
}

/* Portfolio Statistics */
.portfolio-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00e676, transparent);
    transition: left 0.8s ease;
}

.stat-card:hover::before {
    left: 100%;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(0, 230, 118, 0.2);
    transform: translateY(-2px);
}

.stat-label {
    font-size: 14px;
    color: #888;
    margin-bottom: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.stat-change {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.positive {
    color: #00e676;
    text-shadow: 0 0 10px rgba(0, 230, 118, 0.3);
}

.negative {
    color: #ff1744;
    text-shadow: 0 0 10px rgba(255, 23, 68, 0.3);
}

/* Chart Enhancements */
.chart-container {
    height: 420px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 16px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.chart-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(0, 230, 118, 0.03), transparent 70%);
    pointer-events: none;
}

/* Watchlist Enhancements */
.watchlist-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 12px;
    margin-bottom: 4px;
    position: relative;
    overflow: hidden;
}

.watchlist-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, #00e676, #00b248);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.watchlist-item:hover::before {
    transform: scaleY(1);
}

.watchlist-item:hover {
    background: rgba(0, 230, 118, 0.05);
    border-color: rgba(0, 230, 118, 0.15);
    transform: translateX(8px);
}

.watchlist-item:last-child {
    border-bottom: none;
}

.stock-info,
.stock-price-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stock-price-info {
    align-items: flex-end;
}

.stock-symbol {
    font-weight: 700;
    color: #fff;
    font-size: 16px;
    letter-spacing: 0.5px;
}

.stock-name {
    font-size: 13px;
    color: #888;
    font-weight: 500;
}

.stock-price {
    font-weight: 700;
    color: #fff;
    font-size: 16px;
}

.stock-change {
    font-size: 13px;
    font-weight: 600;
}

/* Quick Trade Form */
.quick-trade-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-label {
    font-size: 14px;
    color: #888;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px 20px;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.form-input:focus {
    outline: none;
    border-color: rgba(0, 230, 118, 0.5);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 
        0 0 0 3px rgba(0, 230, 118, 0.1),
        0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Order Type Buttons */
.order-type-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.order-type-btn {
    padding: 16px 12px;
    border: 2px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    color: #888;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.order-type-btn:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.order-type-btn.active {
    background: rgba(0, 230, 118, 0.12);
    border-color: rgba(0, 230, 118, 0.4);
    color: #00e676;
    box-shadow: 0 4px 20px rgba(0, 230, 118, 0.2);
}

/* Trade Buttons */
.trade-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 12px;
}

.btn-buy,
.btn-sell {
    border: none;
    padding: 20px 16px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.btn-buy::before,
.btn-sell::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transition: left 0.5s ease;
}

.btn-buy:hover::before,
.btn-sell:hover::before {
    left: 100%;
}

.btn-buy {
    background: linear-gradient(135deg, #00e676, #00b248);
    color: #000;
    box-shadow: 0 4px 20px rgba(0, 230, 118, 0.3);
}

.btn-buy:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 230, 118, 0.4);
}

.btn-sell {
    background: linear-gradient(135deg, #ff1744, #c62828);
    color: #fff;
    box-shadow: 0 4px 20px rgba(255, 23, 68, 0.3);
}

.btn-sell:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(255, 23, 68, 0.4);
}

/* Recent Activity */
.activity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    margin-bottom: 4px;
    transition: all 0.2s ease;
}

.activity-item:hover {
    background: rgba(255, 255, 255, 0.02);
    transform: translateX(4px);
}

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

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

.activity-action {
    font-weight: 600;
    color: #fff;
    font-size: 14px;
}

.activity-time {
    font-size: 12px;
    color: #888;
    font-weight: 500;
}

.activity-amount {
    font-weight: 700;
    font-size: 15px;
}

/* Loading States */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 120px;
    color: #888;
    flex-direction: column;
    gap: 16px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(0, 230, 118, 0.2);
    border-top: 3px solid #00e676;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Toast Notifications */
.toast {
    position: fixed;
    top: 32px;
    right: 32px;
    padding: 20px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    z-index: 1000;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: slideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast-success {
    background: rgba(0, 230, 118, 0.9);
    color: #000;
    border-color: rgba(0, 230, 118, 0.3);
}

.toast-error {
    background: rgba(255, 23, 68, 0.9);
    color: #fff;
    border-color: rgba(255, 23, 68, 0.3);
}

.toast-info {
    background: rgba(0, 191, 255, 0.9);
    color: #fff;
    border-color: rgba(0, 191, 255, 0.3);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr 350px;
        gap: 24px;
    }
    
    .portfolio-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        padding: 24px 20px;
        gap: 20px;
    }
    
    .header-content {
        padding: 0 20px;
    }
    
    .nav-tabs {
        display: none;
    }
    
    .buying-power::before {
        display: none;
    }
}

@media (max-width: 768px) {
    .portfolio-stats {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .header-left .logo {
        font-size: 24px;
    }
    
    .buying-power {
        display: none;
    }
    
    .chart-container {
        height: 320px;
    }
    
    .main-content {
        padding: 20px 16px;
        gap: 16px;
    }
    
    .panel {
        padding: 24px 20px;
    }
    
    .trade-buttons {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 0 16px;
        gap: 12px;
    }
    
    .portfolio-stats {
        gap: 12px;
    }
    
    .stat-card {
        padding: 20px 16px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .panel {
        padding: 20px 16px;
        border-radius: 16px;
    }
    
    .main-content {
        padding: 16px 12px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .panel {
        border-color: rgba(255, 255, 255, 0.3);
    }
    
    .nav-tab.active {
        background: rgba(0, 230, 118, 0.3);
    }
    
    .form-input:focus {
        border-color: #00e676;
        box-shadow: 0 0 0 3px rgba(0, 230, 118, 0.3);
    }
}