:root {
    --primary-color: #6c5ce7;
    --secondary-color: #a29bfe;
    --accent-color: #00cec9;
    --background-dark: #0f1624;
    --background-card: #1a2035;
    --text-primary: #ffffff;
    --text-secondary: #b8c6db;
    --text-tertiary: #64748b;
    --positive-color: #00b894;
    --negative-color: #ff6b6b;
    --glow-primary: 0 0 10px rgba(108, 92, 231, 0.7);
    --glow-accent: 0 0 15px rgba(0, 206, 201, 0.5);
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--background-dark);
    color: var(--text-primary);
    min-height: 100vh;
}

.app-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    grid-template-rows: auto 1fr;
    grid-template-areas:
        "navbar navbar"
        "main sidebar";
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

/* Navbar styles */
.navbar {
    grid-area: navbar;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: var(--background-card);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
}

.logo .glow {
    color: var(--primary-color);
    text-shadow: var(--glow-primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 0;
    transition: var(--transition-speed);
    position: relative;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-links a.active {
    color: var(--primary-color);
}

.nav-links a.active:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    box-shadow: var(--glow-primary);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.notification {
    position: relative;
}

.notification-icon {
    font-size: 1.25rem;
}

.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--glow-primary);
}

.profile-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    box-shadow: var(--glow-primary);
}

/* Main content styles */
.main-content {
    grid-area: main;
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Sidebar styles */
.sidebar {
    grid-area: sidebar;
    padding: 2rem 1rem;
    background-color: var(--background-card);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
}

/* Card styles */
.card {
    background-color: var(--background-card);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.card:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    opacity: 0.6;
}

/* Portfolio summary styles */
.portfolio-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.summary-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.summary-card h2 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.value {
    font-size: 1.75rem;
    font-weight: 700;
}

.change {
    font-size: 0.875rem;
}

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

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

/* Charts section styles */
.charts-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.chart-card {
    display: flex;
    flex-direction: column;
}

.main-chart {
    height: 350px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-header h2 {
    font-size: 1.25rem;
}

.time-controls {
    display: flex;
    gap: 0.5rem;
}

.time-btn {
    background: none;
    border: 1px solid var(--text-tertiary);
    color: var(--text-tertiary);
    border-radius: 6px;
    padding: 0.25rem 0.75rem;
    cursor: pointer;
    transition: var(--transition-speed);
}

.time-btn:hover {
    border-color: var(--text-secondary);
    color: var(--text-secondary);
}

.time-btn.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: var(--glow-primary);
}

.chart-container {
    flex: 1;
    position: relative;
}

/* Stock overview styles */
.stock-overview {
    max-height: 350px;
    overflow-y: auto;
}

#sortOptions {
    background-color: var(--background-dark);
    color: var(--text-secondary);
    border: 1px solid var(--text-tertiary);
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.stocks-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stock-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.02);
    transition: var(--transition-speed);
}

.stock-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.stock-details {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stock-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.stock-info {
    display: flex;
    flex-direction: column;
}

.stock-symbol {
    font-weight: 600;
}

.stock-name {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.stock-price {
    text-align: right;
}

.price {
    font-weight: 600;
}

/* Bottom charts styles */
.bottom-charts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

/* Sidebar card styles */
.actions-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.actions-card h3 {
    margin-bottom: 0.5rem;
}

.action-btn {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-speed);
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
    box-shadow: var(--glow-primary);
}

.primary-btn:hover {
    background-color: var(--secondary-color);
    box-shadow: 0 0 15px rgba(162, 155, 254, 0.7);
}

.secondary-btn {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.secondary-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.watchlist-card, .market-news-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.watchlist-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.news-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.news-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: 0.25rem;
}

.news-title {
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--background-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Glow effects for chart lines */
.chart-line-glow {
    filter: drop-shadow(0 0 6px rgba(108, 92, 231, 0.6));
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .portfolio-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-section {
        grid-template-columns: 1fr;
    }
    
    .bottom-charts {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr;
        grid-template-areas:
            "navbar"
            "main";
    }
    
    .sidebar {
        display: none;
    }
    
    .nav-links {
        display: none;
    }
}