* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border: #334155;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* Navbar */
.navbar {
    background: var(--bg-card);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.logo {
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
    background: var(--bg-hover);
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Search Section */
.search-section {
    margin-bottom: 2rem;
}

.search-box {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.search-box input {
    flex: 1;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: var(--primary);
}

.btn-primary {
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.quick-symbols {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.quick-symbols span {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.chip {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 2rem;
    cursor: pointer;
    transition: all 0.2s;
}

.chip:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Sections */
.section {
    display: none;
}

.section.active {
    display: block;
}

.section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card h3 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

/* Chart */
.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.chart-header h3 {
    margin: 0;
    padding: 0;
    border: none;
}

.chart-controls {
    display: flex;
    gap: 0.5rem;
}

.chart-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    background: var(--bg-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
}

.chart-btn:hover, .chart-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Grid Layouts */
.stock-overview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* Quote Card Styles */
.quote-main {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1rem;
}

.quote-price {
    font-size: 2.5rem;
    font-weight: 700;
}

.quote-change {
    font-size: 1.25rem;
    font-weight: 500;
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
}

.quote-change.positive {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.quote-change.negative {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.quote-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.quote-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.quote-item label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.quote-item span {
    font-weight: 500;
}

/* Profile Card */
.profile-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.profile-logo {
    width: 60px;
    height: 60px;
    border-radius: 0.75rem;
    object-fit: contain;
    background: white;
    padding: 0.25rem;
}

.profile-info h4 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.profile-info p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.profile-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.profile-item {
    font-size: 0.875rem;
}

.profile-item label {
    color: var(--text-secondary);
}

/* Recommendation */
.recommend-bars {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.recommend-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.recommend-bar label {
    width: 60px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.bar {
    flex: 1;
    height: 8px;
    background: var(--bg-hover);
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.bar-fill.buy { background: var(--success); }
.bar-fill.hold { background: var(--warning); }
.bar-fill.sell { background: var(--danger); }

.recommend-bar span {
    width: 30px;
    text-align: right;
    font-size: 0.875rem;
}

/* Target Price */
.target-display {
    text-align: center;
    padding: 1rem 0;
}

.target-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.target-range {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    font-size: 0.875rem;
}

.target-low { color: var(--danger); }
.target-high { color: var(--success); }

/* Peers */
.peers-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.peer-chip {
    padding: 0.5rem 1rem;
    background: var(--bg-hover);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.2s;
}

.peer-chip:hover {
    background: var(--primary);
}

/* Metrics */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.metric-item {
    text-align: center;
    padding: 1rem;
    background: var(--bg-hover);
    border-radius: 0.75rem;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.metric-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* News */
.news-grid {
    display: grid;
    gap: 1rem;
}

.news-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-hover);
    border-radius: 0.75rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s;
}

.news-item:hover {
    transform: translateX(4px);
}

.news-image {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 0.5rem;
    flex-shrink: 0;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.page-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
    background: var(--primary);
    border-color: var(--primary);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.news-content h4 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.news-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Forex */
.forex-controls, .crypto-controls, .news-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.select-input {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-primary);
    outline: none;
    min-width: 200px;
}

.forex-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.forex-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
}

.forex-pair {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.forex-rate {
    font-size: 1.5rem;
    font-weight: 600;
}

.forex-change {
    margin-top: 0.25rem;
}

/* Calendar */
.calendar-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover, .tab-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.calendar-grid {
    display: grid;
    gap: 1rem;
}

.calendar-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
}

.calendar-item .date {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.calendar-item .symbol {
    font-weight: 600;
}

.calendar-item .info {
    text-align: right;
    font-size: 0.875rem;
}

/* Placeholder */
.placeholder {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

/* Loading */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-overlay.hidden {
    display: none;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
}

/* Responsive */
@media (max-width: 1024px) {
    .stock-overview, .grid-3 {
        grid-template-columns: 1fr;
    }
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    .search-box {
        flex-direction: column;
    }
    .grid-2 {
        grid-template-columns: 1fr;
    }
    .container {
        padding: 1rem;
    }
}
