:root {
    --primary-white: #f5f5f5;
    --secondary-white: #ffffff;
    --accent-green: #48bb78;
    --accent-red: #f56565;
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --header-bg: linear-gradient(90deg, #4a90e2, #9013fe);
    --button-bg: #4a90e2;
    --button-hover-bg: #357ABD;
    --sidebar-bg: #ffffff;
    --sidebar-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    --card-bg: #ffffff;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --card-hover-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --card-border-radius: 5px;
    --sidebar-width: 17.6%;
    --main-width: 80%;
    --sidebar-padding: 20px;
    --card-padding: 20px;
    --card-margin-right: 20px;
    --card-width: 250px;
    --card-height: 200px;
}

html {
    height: 97%;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--primary-white);
    height: 100%;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: var(--header-bg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    color: var(--primary-white);
}

.header-left {
    display: flex;
    align-items: center;
    width: 50%;
}

.header-right {
    display: flex;
    align-items: center;
    width: 50%;
    justify-content: flex-end;
}

.header-title {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-white);
}

.search-bar {
    margin: 0 20px;
    padding: 5px 10px;
    font-size: 16px;
    width: 75%;
    height: 1.5rem;
    border: none;
    border-radius: 4px;
    outline: none;
}

.login-btn, .account-btn {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    margin: 0 10px;
    background-color: var(--button-bg);
    color: var(--primary-white);
    border: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.login-btn:hover, .account-btn:hover {
    background-color: var(--button-hover-bg);
    display: inline-block;
}

.login-btn:hover {
    cursor: pointer;
}

.profile-img {
    height: 40px;
    width: 40px;
    border-radius: 50%;
    margin-left: 10px;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: var(--secondary-white);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    z-index: 1;
    border-radius: 4px;
    overflow: hidden;
}

.account-menu {
    position: relative;
    display: none;
}

.account-menu:hover .dropdown-content {
    display: block; /* Change from 'none' to 'block' */
}

.dropdown-content a {
    color: var(--text-primary);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
    cursor: pointer;
}

.main-cont {
    display: flex;
    height: 93%;
    width: 100%;
    justify-content: space-between;
}

.side-menu {
    height: 100%;
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    box-shadow: var(--sidebar-shadow);
    padding: var(--sidebar-padding);
}

.side-menu ul {
    list-style: none;
    padding: 0;
}

.side-menu > ul > li {
    margin: 20px 0;
}

.side-menu ul li a {
    text-decoration: none;
    color: var(--text-primary);
    font-size: 18px;
    transition: color 0.3s ease;
}

.side-menu ul li a:hover {
    color: var(--button-bg);
}

.main-content {
    padding: 20px;
    width: var(--main-width);
    height: 100%;
}

.top-stocks > h2 {
    width: 100%;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    color: var(--text-primary);
}

.page {
    overflow-y: auto;
    height: 100%;
    width: 100%;
}

.index-section {
    margin-bottom: 30px;
    padding: 20px;
    background-color: var(--card-bg);
    box-shadow: var(--card-shadow);
    border-radius: var(--card-border-radius);
}

.index-section > h3 {
    text-align: center;
    font-size: 22px;
    color: var(--text-primary);
}

.stocks-carousel {
    display: flex;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: none;
}

.stocks-carousel::-webkit-scrollbar {
    display: none; /* Hide scrollbar */
}

.stock-card {
    background-color: var(--card-bg);
    padding: var(--card-padding);
    margin-right: var(--card-margin-right);
    box-shadow: var(--card-shadow);
    width: var(--card-width);
    height: var(--card-height);
    text-align: left;
    transition: all 0.2s ease;
    cursor: pointer;
    overflow: hidden;
    flex-shrink: 0;
    border-radius: var(--card-border-radius);
}

.stock-card:hover {
    box-shadow: var(--card-hover-shadow);
    transform: translateY(-2px);
}

.stock-card .ticker {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-primary);
}

.stock-card .price {
    font-size: 16px;
    margin: 10px 0;
    color: var(--text-primary);
}

.stock-card .change {
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.stock-card .change.up {
    background-color: #C6F6D5;
    color: #22543D;
}

.stock-card .change.down {
    background-color: #FED7D7;
    color: #742A2A;
}

.stock-details-sidebar {
    width: 25%;
    height: 100%;
    background-color: var(--sidebar-bg);
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
    padding: 20px;
    display: none;
    position: relative;
    overflow-y: auto;
}

.sidebar-header {
    margin-bottom: 20px;
}

.stock-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.exchange-tag {
    background-color: #E2E8F0;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #4A5568;
}

.current-price {
    display: flex;
    align-items: center;
    gap: 10px;
}

.current-price .price {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-primary);
}

.current-price .change-percent {
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 4px;
}

.change-percent.up {
    background-color: #C6F6D5;
    color: #22543D;
}

.change-percent.down {
    background-color: #FED7D7;
    color: #742A2A;
}

.chart-controls {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    padding: 0 10px;
}

.time-button {
    padding: 6px 12px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 4px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.time-button:hover {
    background-color: #EDF2F7;
}

.time-button.active {
    background-color: #E2E8F0;
    color: var(--text-primary);
    font-weight: 500;
}

.stock-details-container {
    margin: 40px 0;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    overflow: hidden;
}

.details-scroll {
    max-height: 300px;
    overflow-y: auto;
}

.stock-details-table {
    width: 100%;
    border-collapse: collapse;
}

.stock-details-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #E2E8F0;
}

.stock-details-table td:first-child {
    color: var(--text-secondary);
    width: 40%;
}

.stock-details-table td:last-child {
    color: var(--text-primary);
    font-weight: 500;
}

.trading-section {
    margin-top: 20px;
    padding: 20px;
    background-color: #F7FAFC;
    border-radius: 8px;
}

.trade-inputs {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.input-group {
    flex: 1;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-secondary);
    font-size: 14px;
}

.input-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #E2E8F0;
    border-radius: 4px;
    font-size: 16px;
}

.buy-button {
    width: 100%;
    padding: 12px;
    background-color: var(--accent-green);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.buy-button:hover {
    background-color: #38A169;
}

@media (max-width: 768px) {
    .main-cont {
        flex-direction: column;
    }
    
    .side-menu, .top-stocks, .stock-details-sidebar {
        width: 100%;
    }
    
    .stocks-carousel {
        flex-direction: column;
        overflow-y: scroll;
    }
    
    .stock-card {
        margin-bottom: 15px;
        width: 100%;
    }
}

.stock-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.ticker {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-primary);
}

.exchange {
    font-size: 12px;
    color: var(--text-secondary);
}

.price-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.price {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.change {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
}

.change.up {
    background-color: #C6F6D5;
    color: #22543D;
}

.change.down {
    background-color: #FED7D7;
    color: #742A2A;
}

.stock-mini-chart {
    width: 100%;
    height: 60px;
    margin: 10px 0;
    background-color: #fff;
}

.stock-detail-chart {
    width: 100%;
    height: 300px;
    margin: 20px 0;
    background-color: #fff;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

.stock-details-sidebar {
    position: relative;
    padding: 24px;
    height: 98%;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #4A5568;
}

.close-btn:hover {
    background-color: #F7FAFC;
    border-radius: 4px;
}

/* Add to front_page.css */
.stock-list-container {
    width: 100%;
    overflow-x: auto;
    background-color: var(--secondary-white);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.stock-list-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.stock-list-table th,
.stock-list-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #E2E8F0;
}

.stock-list-table th {
    background-color: #F7FAFC;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
}

.portfolio-summary {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    padding: 20px;
    background-color: var(--secondary-white);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.summary-item .label {
    color: var(--text-secondary);
    font-size: 14px;
}

.summary-item .value {
    font-size: 18px;
    font-weight: 600;
}

.value.profit {
    color: var(--accent-green);
}

.value.loss {
    color: var(--accent-red);
}

.watchlist-item, .portfolio-item {
    cursor: pointer;
}

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

.stock-symbol {
    color: var(--text-secondary);
    font-size: 0.9em;
}

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

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

.mini-chart {
    width: 100px;
    height: 40px;
}

.actions {
    display: flex;
    gap: 8px;
}

.actions button {
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--secondary-white);
    cursor: pointer;
}

.actions button:hover {
    background: var(--hover-color);
}