/* ... (Previous styles) ... */

/* Header Controls */
.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-account {
    background-color: #00c853; /* NH Greenish */
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
}

.btn-account:hover {
    background-color: #009624;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: var(--bg-card);
    margin: 10% auto;
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    position: relative;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: white;
}

.modal-note {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* ... (Rest of existing styles) ... */
/* Search Section */
.search-section {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-box {
    display: flex;
    gap: 0.5rem;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #2a2a3e;
    border: 1px solid #444;
    border-radius: 6px;
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none; /* Hidden by default */
}

.search-results li {
    padding: 0.8rem;
    cursor: pointer;
    border-bottom: 1px solid #333;
    transition: background 0.2s;
}

.search-results li:hover {
    background-color: #3d5afe;
}

.search-match {
    color: var(--text-primary);
    font-weight: bold;
}

.search-sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-left: 0.5rem;
}

/* Stock Info Card */
.stock-info-card {
    background: #252530;
    border: 1px solid var(--accent-blue);
    border-radius: 8px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
    text-align: center;
    animation: fadeIn 0.3s;
}

.info-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.info-header h3 {
    margin: 0;
    font-size: 1.2rem;
    border: none;
}

.code-badge {
    background: #333;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.info-price-row {
    font-size: 2rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

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

.change-rate {
    font-size: 1rem;
    margin-left: 0.5rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: rgba(0,0,0,0.2);
}

.updated-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 350px 1fr 300px; /* Increased left panel width */
    grid-template-rows: auto 1fr;
    gap: 1rem;
    padding: 1rem;
    height: 100%;
    overflow-y: auto;
}

.market-panel {
    grid-column: 1 / -1;
    min-height: 350px;
}

.panel-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.market-panel h2 {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.btn-ai {
    background: linear-gradient(135deg, #3d5afe, #a73dfe);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    transition: transform 0.2s;
}

.btn-ai:hover {
    transform: scale(1.05);
}

.ai-result-box {
    background-color: #2a2a3e;
    border: 1px solid #a73dfe;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.market-content {
    display: flex;
    gap: 2rem;
    height: 100%;
}

.chart-container {
    flex: 2;
    position: relative;
    height: 100%;
    min-height: 250px;
}

.movers-list {
    flex: 1;
    overflow-y: auto;
    min-width: 250px;
}

.movers-list h3 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.movers-list h3.fall-header {
    margin-top: 1rem;
}

.movers-list ul {
    list-style: none;
}

.movers-list li {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid #333;
    font-size: 0.9rem;
}

.card {
    background-color: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

h2 {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

/* Form Styles */
.input-group {
    margin-bottom: 1rem;
}

.row {
    display: flex;
    gap: 1rem;
}

label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

input {
    width: 100%;
    padding: 0.8rem;
    background-color: #2c2c2c;
    border: 1px solid #444;
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 1rem;
}

input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.help-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
    display: block;
}

.btn-primary {
    width: 100%;
    padding: 1rem;
    background-color: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 1rem;
    transition: background 0.2s;
}

.btn-primary:hover {
    background-color: #304ffe;
}

.btn-primary:disabled {
    background-color: #444;
    cursor: not-allowed;
    color: #888;
}

/* Table Styles */
.table-container {
    flex-grow: 1;
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 1rem;
    border-bottom: 1px solid #2c2c2c;
}

.up { color: var(--accent-red); } /* Korean stock color for Up is Red */
.down { color: var(--accent-blue); } /* Korean stock color for Down is Blue */

.status-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    background-color: #2c2c2c;
}

.status-badge.buying { color: var(--accent-green); border: 1px solid var(--accent-green); }
.status-badge.holding { color: #ffab00; border: 1px solid #ffab00; }
.status-badge.sold { color: var(--text-secondary); }

.btn-delete {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
}

.btn-delete:hover { color: var(--accent-red); }

/* Simulation Controls */
.simulation-controls {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.btn-secondary {
    padding: 0.5rem 1rem;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.sim-note {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Log Styles */
.log-list {
    list-style: none;
    overflow-y: auto;
    flex-grow: 1;
}

.log-item {
    padding: 0.8rem 0;
    border-bottom: 1px solid #2c2c2c;
    font-size: 0.9rem;
}

.log-time {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.2rem;
}

.log-action {
    font-weight: 700;
    margin-right: 0.5rem;
}

.log-action.buy { color: var(--accent-red); } /* Buy is Red (Active) */
.log-action.sell { color: var(--accent-blue); } /* Sell is Blue (Exit) */

.empty-log {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem 0;
}

/* Responsive */
@media (max-width: 1000px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        overflow-y: auto;
    }
    .market-panel {
        min-height: auto;
    }
    .market-content {
        flex-direction: column;
    }
    body { overflow: auto; }
}

/* Common */
:root {
    --bg-dark: #121212;
    --bg-card: #1e1e1e;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --accent-blue: #3d5afe;
    --accent-green: #00c853;
    --accent-red: #ff3d00;
    --border-color: #333;
    --font-family: 'Noto Sans KR', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-family);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}
