/* Dashboard Layout */
.dashboard {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: auto auto 1fr;
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    flex: 1; /* Allow the dashboard to grow and take available space */
}

/* Grid Areas */
.account-summary-card { grid-area: 1 / 1 / 2 / 3; }


/* Cards */
.card {
    background: rgba(30, 41, 59, 0.8);
    border-radius: 15px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    background: rgba(30, 41, 59, 0.95);
}

.card-header {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: #7dd3fc;
}

.card-header svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
}

/* Account Summary */
.account-summary {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.3rem;
    padding: 1rem 0;
}

.metric {
    background: linear-gradient(145deg, #1e3a8a, #1e40af);
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.metric::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -33%;
    width: 160%;
    height: 185%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1));
    transform: rotate(45deg);
}

.metric-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0.5rem 0;
    color: #4ade80;
    position: relative;
    z-index: 1;
}

/* Positions Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: rgba(51, 65, 85, 0.6);
    padding: 1rem;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.4);
}

.data-table tr:hover {
    background: rgba(51, 65, 85, 0.3);
}

/* Watchlist */
.watchlist-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin: 0.5rem 0;
    background: rgba(51, 65, 85, 0.3);
    border-radius: 8px;
    transition: background 0.3s ease;
}

.watchlist-item:hover {
    background: rgba(51, 65, 85, 0.5);
}

/* Orders */
.order-status {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.status-filled {
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
}

/* Footer Styles */
.footer {
    padding: 1rem;
    text-align: center;
    background: rgba(30, 41, 59, 0.9);
    color: #e2e8f0;
    margin-top: 20px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .dashboard {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .account-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile Responsive Enhancements */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .dashboard {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        height: auto;
        gap: 1rem;
    }

    .account-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .metric {
        padding: 1rem;
    }

    .metric-value {
        font-size: 1.4rem;
    }

    .card-header {
        font-size: 1.1rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }

    .watchlist-item {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    /* Add horizontal scroll for tables on mobile */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 480px) {
    .account-summary {
        grid-template-columns: 1fr;
    }

    .metric-value {
        font-size: 1.2rem;
    }
}