:root {
    --bg-main: #f0f2f5;
    --panel-bg: #ffffff;
    --panel-border: #dadce0;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --text-light: #70757a;
    --accent-color: #1a73e8;
    --positive: #137333;
    --positive-bg: rgba(19, 115, 51, 0.05);
    --negative: #a50e0e;
    --negative-bg: rgba(165, 14, 14, 0.05);
    --hover-bg: #f8f9fa;
    --chart-grid: #e8eaed;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scrollbar-width: auto;
    scrollbar-color: #80868b #f1f3f4;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 14px;
}
::-webkit-scrollbar-track {
    background: #f1f3f4; 
    border-radius: 8px;
}
::-webkit-scrollbar-thumb {
    background: #80868b; 
    border-radius: 8px;
    border: 3px solid #f1f3f4;
}
::-webkit-scrollbar-thumb:hover {
    background: #80868b; 
}

body {
    font-family: 'Roboto', 'Arial', sans-serif;
    background: linear-gradient(135deg, #ffffff 0%, #fcfaf8 40%, #f4eee6 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.app-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dashboard-16-9 {
    width: 100%;
    max-width: 1600px;
    aspect-ratio: 16 / 9;
    max-height: calc(100vw * 9 / 16);
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    display: flex;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 25%;
    min-width: 280px;
    border-right: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
    background: #fff;
}

.sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--panel-border);
}

.sidebar-header h1 {
    font-size: 1.125rem;
    font-weight: 500;
}

.stock-list {
    flex: 1;
    overflow-y: scroll;
}

.sidebar-category {
    padding: 14px 24px;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #495057;
    background: #e9ecef;
    border-bottom: 2px solid #dee2e6;
    border-left: 4px solid #ced4da;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 4px;
}

.sidebar-category:hover {
    background: #dee2e6;
    border-left-color: #adb5bd;
}

.sidebar-category.active {
    color: var(--accent-color);
    background: #e8f0fe;
    border-left-color: var(--accent-color);
    border-bottom-color: #d2e3fc;
}

#sidebar-gesamtportfolio {
    background: #343a40;
    color: #ffffff;
    border-left: 4px solid #ffc107;
    border-bottom: none;
    font-size: 1.05rem;
    padding: 18px 24px;
    margin-top: 0;
}

#sidebar-gesamtportfolio:hover {
    background: #495057;
    border-left-color: #ffca2c;
}

#sidebar-gesamtportfolio.active {
    background: var(--accent-color);
    color: #ffffff;
    border-left-color: #ffc107;
}

.stock-item {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    cursor: pointer;
    border-bottom: 1px solid #f1f3f4;
}

.stock-item:hover {
    background: var(--hover-bg);
}

.stock-item.active {
    background: #e8f0fe;
}

.stock-brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f1f3f4;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 500;
    margin-right: 12px;
    flex-shrink: 0;
}

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

.stock-name {
    font-size: 1.05rem;
    font-weight: 500;
}

.stock-symbol {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.stock-price-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-left: auto;
}

.stock-price {
    font-size: 1.05rem;
    font-weight: 500;
}

.stock-change {
    font-size: 0.95rem;
    font-weight: 500;
    margin-top: 2px;
}

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

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

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 40px 60px;
    background: #fff;
    overflow-y: scroll;
}

.main-header {
    margin-bottom: 24px;
}

.company-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.company-logo {
    width: 44px;
    height: 44px;
    background: #f1f3f4;
    border-radius: 50%;
    margin-right: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    font-weight: 500;
    color: white;
}

.company-title {
    display: flex;
    flex-direction: column;
}

.company-title h2 {
    font-size: 1.75rem;
    font-weight: 400;
    color: var(--text-primary);
}

.company-title span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.price-section {
    margin-bottom: 24px;
}

.selected-stock-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

#selected-stock-price-val {
    font-size: 2.75rem;
    font-weight: 400;
}

.currency {
    font-size: 1rem;
    color: var(--text-secondary);
}

.stock-change-full {
    font-size: 1.1rem;
    margin-top: 4px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.date-info {
    font-size: 0.8rem;
    color: var(--text-light);
}

.time-tabs {
    display: inline-flex;
    background: #f1f3f4;
    padding: 6px;
    border-radius: 24px;
    margin-bottom: 24px;
    gap: 4px;
    border: 1px solid var(--panel-border);
}

.tab {
    padding: 8px 24px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    background-color: transparent;
    border-radius: 18px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.tab:hover {
    background-color: #e8eaed;
    color: var(--text-primary);
}

.tab.active {
    background-color: var(--accent-color);
    color: white;
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.4);
}

.chart-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 32px;
    min-height: 250px;
}

.chart-container {
    flex: 1;
    position: relative;
    width: 100%;
    min-height: 0;
}

canvas#stock-chart {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.x-axis-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    margin-top: 8px;
    margin-bottom: 0;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    row-gap: 16px;
    column-gap: 48px;
    border-top: 1px solid var(--panel-border);
    padding-top: 32px;
    padding-bottom: 24px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #f1f3f4;
    padding-bottom: 8px;
}

.detail-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.detail-value {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-primary);
}

.chart-crosshair {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: var(--text-secondary);
    pointer-events: none;
    display: none;
    z-index: 5;
}

.chart-tooltip {
    position: absolute;
    top: 20px;
    background: #fff;
    border: 2px solid var(--panel-border);
    border-radius: 12px;
    padding: 16px 24px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    pointer-events: none;
    display: none;
    z-index: 10;
    transform: translateX(-50%);
    white-space: nowrap;
    text-align: center;
}

.tooltip-time {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.tooltip-price {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text-primary);
}
