/* --- General Layout & Typography --- */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #121212;
    color: #e0e0e0;
    margin: 0;
    font-size: 16px;
}

.content-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
}

h1,
h2,
h3 {
    color: #ffffff;
}

.error {
    color: #cf6679;
    font-weight: bold;
}


/* --- Navigation Bar --- */

nav {
    background-color: #1f1f1f;
    padding: 1em 2rem;
    border-bottom: 1px solid #333;
}

nav a {
    color: #bb86fc;
    text-decoration: none;
    margin-right: 1.5em;
    font-weight: bold;
    font-size: 1.1em;
}


/* --- Table Styles --- */

.portfolio-table {
    overflow-x: auto;
    /* Ensures table is scrollable on small screens */
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1em;
}

th,
td {
    border: 1px solid #444;
    padding: 10px 12px;
}

th {
    background-color: #333;
}


/* --- Help Section & Watchlists --- */
/* --- Help Section & Watchlists --- */

.help-section {
    background-color: #2c3e50;
    margin-bottom: 2rem;
    padding: 1.5rem 0;
}

.help-section-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.help-section h2 {
    text-align: center;
    color: #ecf0f1;
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.help-bar-container {
    display: flex;
    flex-direction: column;
    /* This stacks the rows vertically */
    gap: 20px;
}

.help-topic-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    /* Centers the help bubbles in the top row */
    padding-bottom: 20px;
    /* Adds space below the help bubbles */
    border-bottom: 1px solid #4a627a;
    /* Adds a separator line */
}


/* --- New Wrapper for Watchlist Boxes --- */
.watchlists-wrapper {
    display: flex;
    gap: 20px;
    width: 100%;
}

/* --- Help Topic Hover Bubbles (No changes here) --- */
.help-topic {
    position: relative;
    display: inline-block;
}

.help-trigger {
    background-color: #3498db;
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.help-bubble {
    visibility: hidden;
    opacity: 0;
    width: 300px;
    background-color: #34495e;
    color: #ecf0f1;
    text-align: left;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: absolute;
    z-index: 10;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.help-topic:hover .help-bubble {
    visibility: visible;
    opacity: 1;
}

.help-bubble p {
    margin: 0;
    line-height: 1.6;
}


/* --- Watchlist Boxes & Bubbles --- */

.watchlist-box {
    background-color: #34495e;
    border-radius: 8px;
    padding: 15px;
    flex: 1;
    /* Allows boxes to grow and fill available space */
    min-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.watchlist-box h3 {
    margin: 0;
    color: #ecf0f1;
    text-align: center;
    font-size: 1.1em;
    border-bottom: 1px solid #4a627a;
    padding-bottom: 10px;
}

.bubbles-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.stock-bubble {
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.9em;
    font-weight: bold;
}

.stock-bubble small {
    opacity: 0.8;
    font-weight: normal;
}

.stock-bubble.breakout {
    background-color: #27ae60;
    /* Green */
}

.stock-bubble.breakdown {
    background-color: #c0392b;
    /* Red */
}