:root {
    --gap-size: 32px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS',
        Roboto, Ubuntu, sans-serif;
    color: #000;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fff;
    padding-top: 84px;
}

header {
    display: flex;
    width: 100%;
    align-items: center;
    background: #1a1a1a;
    justify-content: space-between;
    padding: 0 var(--gap-size);
    gap: calc(var(--gap-size) * 2);
    box-shadow: rgba(0, 0, 0, 0.3) 0 2px 6px 0;
    flex-direction: row;
    z-index: 1000;
    position: fixed;
    top: 0;
}

header #symbol-dropdown {
    height: 36px;
    padding: 0 10px;
    border: 1px solid #555;
    border-radius: 20px;
    background-color: #2a2a2a;
    color: #ffffff;
}

header #symbol-dropdown option {
    background-color: #2a2a2a;
    color: #ffffff;
}

header #site-logo {
    font-weight: 600;
    font-size: 32px;
    padding: 16px;
    color: #ffffff;
    text-decoration: none;
}

.search-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    position: relative;
}

#stock-search {
    padding: 10px;
    width: 100%;
    height: 36px;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 14px;
    background-color: white;
    color: #333;
}

#stock-search::placeholder {
    color: #888;
}

#symbol-dropdown {
    height: 36px;
    padding: 0 10px;
    border: 1px solid #ccc;
    border-radius: 20px;
    background-color: white;
    color: #333;
}

#symbol-dropdown option {
    background-color: white;
    color: #333;
}

#ticker-tape {
    width: 100%;
    margin-bottom: var(--gap-size);
    margin-top: 0;
}

/* Two-column layout using flexbox */
main {
    width: 100%;
    padding: var(--gap-size);
    max-width: 1600px;
    margin: 0 auto;
}

.main-columns {
    display: flex;
    gap: var(--gap-size);
    margin-left: 432px;
}

.left-column,
.right-column {
    display: flex;
    flex-direction: column;
    gap: var(--gap-size);
}


.right-column {
    flex-grow: 1;
    width: 100%;
}

.left-column {
    position: fixed;
    left: 0;
    top: 84px;
    width: 400px;
    z-index: 100;
    background: white;
    border-right: 1px solid #e0e3eb;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
    padding: 16px;
    height: calc(100vh - 84px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#watchlist {
    height: auto;
    min-height: 200px;
    flex-grow: 1;
}

#technical-analysis {
    height: 425px;
}

#symbol-info {
    min-height: 120px;
}

#advanced-chart {
    height: calc(100vh - 250px);
    width: 100%;
}

#tradingview_chart {
    width: 100%;
    height: 100%;
}

/* Custom watchlist styles */
#watchlist h3 {
    margin-top: 0;
    margin-bottom: 10px;
    padding: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.watchlist-table-container {
    width: 100%;
    border: 1px solid #e0e3eb;
    border-radius: 4px;
    overflow-y: auto;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    max-height: calc(100vh - 200px);
}

#watchlist-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

#watchlist-table thead {
    background-color: #f9fafb;
    border-bottom: 1px solid #e0e3eb;
}

#watchlist-table th {
    text-align: left;
    padding: 10px 8px;
    font-weight: 500;
    color: #787b86;
}

#watchlist-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #f0f3fa;
}

#watchlist-table tbody tr:hover {
    background-color: rgba(41, 98, 255, 0.03);
    cursor: pointer;
}

#watchlist-table tbody tr.active {
    background-color: rgba(41, 98, 255, 0.07);
}

.symbol-cell {
    font-weight: 500;
    color: #131722;
}

.price-cell {
    font-weight: 500;
    color: #131722;
}

.change-cell.positive {
    color: #4CAF50;
    font-weight: 500;
}

.change-cell.negative {
    color: #F44336;
    font-weight: 500;
}

/* Widget container styles */
.tradingview-widget-container {
    height: 100%;
    width: 100%;
}

.tradingview-widget-container__widget {
    height: 100%;
    width: 100%;
}

/* Fix for advanced chart specifically */
#advanced-chart .tradingview-widget-container__widget {
    height: calc(100% - 32px);
}

/* Responsive adjustments */
@media (max-width: 800px) {
    .main-columns {
        flex-direction: column;
    }

    .left-column {
        width: 100%;
    }

    main {
        padding: 16px;
    }

    .search-container {
        flex-direction: column;
        align-items: stretch;
    }

    #symbol-dropdown {
        width: 100%;
    }

    #advanced-chart {
        height: 400px;
    }
}

/* Add this at the end of your CSS file */
#autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.autocomplete-item .symbol {
    font-weight: 500;
    color: #131722;
}

.autocomplete-item .exchange {
    font-size: 12px;
    color: #787b86;
    padding: 2px 4px;
    background: #f0f3fa;
    border-radius: 3px;
}

.autocomplete-item .name {
    color: #787b86;
    margin-left: auto;
}

/* Timeframe selector styles */
.watchlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.timeframe-selector {
    display: flex;
    gap: 4px;
}

.timeframe-button {
    padding: 4px 8px;
    border: 1px solid #ddd;
    background: #f8f9fa;
    color: #666;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.timeframe-button:hover {
    background: #e9ecef;
    border-color: #ccc;
}

.timeframe-button.active {
    background: #2962ff;
    color: white;
    border-color: #2962ff;
}
