/* --- YOUR ORIGINAL, KNOWN-GOOD STYLES --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #121212;
    color: #e0e0e0;
    margin: 0;
    line-height: 1.6;
}
header { 
    text-align: center; 
    padding: 2rem 1rem; 
    border-bottom: 1px solid #333; 
    position: relative; /* For positioning the nav link */
}
h1 { 
    color: #f39c12; 
    margin: 0; 
    font-size: 2.5rem;
}
h2 { 
    border-bottom: 1px solid #444; 
    padding-bottom: 0.5rem; 
    margin-top: 0; 
}
main { 
    padding: 1rem; 
}

.container { 
    display: flex;
    flex-direction: column; /* This is the key for your single-column layout */
    gap: 2rem; 
    max-width: 80vw;
    margin: auto; 
    padding: 0 1rem;
}

.form-container, .output-container { 
    background: #1e1e1e; 
    padding: 1.5rem 2rem; 
    border-radius: 8px; 
}

form { 
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem; 
}
.form-group {
    display: flex;
    flex-direction: column;
}
.form-group.full-width {
    grid-column: 1 / -1;
}

label { 
    font-weight: bold; 
    color: #aaa; 
    margin-bottom: 0.5rem;
}
input, textarea { 
    background: #2a2a2a; 
    color: #e0e0e0; 
    border: 1px solid #444; 
    padding: 0.75rem; 
    border-radius: 4px; 
    font-size: 1rem; 
    width: 100%;
    box-sizing: border-box;
}
button { 
    background-color: #f39c12; 
    color: #121212; 
    border: none; 
    padding: 0.75rem 1.5rem; 
    border-radius: 50px; /* Pill style for Primary Actions */
    font-weight: bold; 
    cursor: pointer; 
    transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
    grid-column: 1 / -1;
    justify-self: center;
    width: 50%;
    max-width: 300px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2); /* Subtle shadow */
}
button:hover { 
    background-color: #e67e22; 
    transform: translateY(-2px); /* Lift effect */
    box-shadow: 0 6px 12px rgba(243, 156, 18, 0.3); /* Glow effect */
}
button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* ... existing styles ... */

/* Header Navigation Link (Back Button) - Keeping default radius as requested */
.nav-link-header {
    background-color: #2a2a2a;
    color: #f39c12;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 4px; /* Default radius */
    border: 1px solid #444;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.2s ease;
    display: inline-block;
    margin-top: 1.5rem;
}

/* ... */

.ticker-btn {
    background-color: #2a2a2a;
    color: #f39c12;
    border: 1px solid #444;
    padding: 8px 16px;
    border-radius: 4px; /* Default radius */
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

/* ... */

.nav-button {
    background-color: #2a2a2a;
    color: #f39c12;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 4px; /* Default radius */
    border: 1px solid #444;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.2s ease;
    display: inline-block;
    margin-top: 1.5rem;
}
#output-content { 
    margin-top: 1rem; 
}
.placeholder { 
    color: #666; 
    font-style: italic; 
    text-align: center;
}
/* Report Formatting */
#output-content h3 { 
    color: #f39c12; 
    border-bottom: none; 
}
#output-content table { 
    border-collapse: collapse; 
    width: 100%; 
    margin: 1.5rem 0; 
    font-size: 0.95rem;
}
#output-content th, #output-content td { 
    border: 1px solid #444; 
    padding: 0.75rem; 
    text-align: left; 
}
#output-content th { 
    background-color: #2a2a2a; 
}
#output-content blockquote { 
    border-left: 4px solid #f39c12; 
    padding: 0.5rem 1rem; 
    margin-left: 0; 
    background: #2a2a2a; 
    border-radius: 4px;
}
#output-content code {
    background-color: #2a2a2a;
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 85%;
    border-radius: 3px;
}
/* Spinner */
.spinner { 
    border: 4px solid #333; 
    border-top: 4px solid #f39c12; 
    border-radius: 50%; 
    width: 40px; 
    height: 40px; 
    animation: spin 1s linear infinite; 
    margin: 2rem auto; 
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }


/* --- NEW, NON-CONFLICTING STYLES FOR NAVIGATION & HISTORY PAGE --- */

/* Header Navigation Link */
.nav-link-header {
    background-color: #2a2a2a;
    color: #f39c12;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    border: 1px solid #444;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.2s ease;
    display: inline-block;
    margin-top: 1.5rem;
}
.nav-link-header:hover {
    background-color: #333;
    border-color: #f39c12;
}

/* Ticker Buttons on History Page */
#ticker-list-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 1rem;
}
.ticker-btn {
    background-color: #2a2a2a;
    color: #f39c12;
    border: 1px solid #444;
    padding: 8px 16px;
    border-radius: 5px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}
.ticker-btn:hover {
    background-color: #333;
    border-color: #f39c12;
}

/* "Back" Button on History Page */
#back-to-tickers {
    background-color: transparent;
    color: #f39c12;
    border: none;
    padding: 8px 0;
    font-size: 1em;
    cursor: pointer;
    margin-bottom: 1rem;
}

/* Section Headers for Report Tables */
.table-section-header {
    font-size: 1.2rem;
    color: #ccc;
    margin-top: 2.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #444;
    padding-bottom: 0.5rem;
}

/* Report Tables on History Page (Applied to both tables via class) */
.report-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}
.report-table th, 
.report-table td {
    border: 1px solid #444;
    padding: 12px;
    text-align: left;
    vertical-align: middle;
}
.report-table th {
    background-color: #2a2a2a;
    color: #f39c12;
}
.report-table tbody tr:hover {
    background-color: #2c2c2c;
}

/* Action Buttons & Column within Tables */
.actions-column {
    width: 100px; /* Fixed width for the actions column */
    text-align: center;
}
.actions-cell {
    display: flex;
    justify-content: center;
    gap: 10px; /* Adds space between buttons */
}
.action-btn {
    background-color: #2a2a2a; /* Default background for visibility */
    border: 1px solid #444;    /* Subtle border to define the button */
    color: #e0e0e0;             /* Ensures the icon/emoji color is readable */
    cursor: pointer;
    font-size: 1.3rem;
    padding: 5px 8px;          /* Adjusted padding for better shape */
    border-radius: 5px;
    transition: all 0.2s ease; /* Smoother transition for all properties */
    line-height: 1;            /* Helps vertically center emoji icons */
}
.action-btn:hover {
    background-color: hsl(53, 100%, 37%);
}

/* Differentiates the Delete button on hover */
.delete-btn:hover {
    background-color: #680000; /* Subtle red on hover for delete */
    color: #000dff;
}

.error {
    color: #ff4d4d;
}

/* --- ADD THIS TO THE END OF YOUR CSS FILE --- */

.nav-button {
    background-color: #2a2a2a;
    color: #f39c12;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    border: 1px solid #444;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.2s ease;
    display: inline-block;
    margin-top: 1.5rem;
}

.nav-button:hover {
    background-color: #333;
    border-color: #f39c12;
}

/* --- NEW STYLES FOR REFINED UI --- */

/* Main Navigation (Top Level) */
.main-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.nav-pill {
    background-color: transparent;
    color: #aaa;
    border: 2px solid #444;
    padding: 0.75rem 2rem;
    border-radius: 50px; /* Pill shape */
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    width: auto; /* Override generic button width */
}

.nav-pill:hover {
    border-color: #f39c12;
    color: #e0e0e0;
}

.nav-pill.active {
    background-color: #f39c12;
    color: #121212;
    border-color: #f39c12;
    box-shadow: 0 0 15px rgba(243, 156, 18, 0.3);
}

/* Sub-Tabs (Strategist vs Portfolio) */
.tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #444;
}

.tab-button {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #aaa;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
    width: auto; /* Override generic button width */
    margin: 0;
    border-radius: 0;
}

.tab-button:hover {
    color: #e0e0e0;
    background: transparent;
}

.tab-button.active {
    color: #f39c12;
    border-bottom-color: #f39c12;
}