/* ---- General Settings & Theme ---- */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #121212;
    color: #FFFFFF;
    overflow-x: hidden;
}
#root {
  padding-bottom: 80px;
}
main {
    padding: 20px;
    padding-bottom: 80px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ---- Bottom Navigation ---- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background-color: #1E1E1E;
    padding: 10px 0;
    border-top: 1px solid #333;
}

.bottom-nav button {
    background: none;
    border: none;
    color: #B3B3B3;
    font-size: 12px;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.bottom-nav button i {
    font-size: 20px;
}

.bottom-nav button.active {
    color: #007BFF;
}


/* ---- Investment Form (V2) ---- */
.styled-form {
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.styled-form h3 {
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: none;
}

.form-group input {
    width: 100%;
    padding: 15px 20px;
    border: 1px solid #ccc;
    border-radius: 50px;
    background-color: transparent;
    color: #FFFFFF;
    font-size: 1em;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.form-group input::placeholder {
    color: #888;
}

.form-group input:focus {
    outline: none;
    border-color: #007BFF;
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.6);
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.add-button {
    background-color: #007BFF;
    color: white;
    padding: 15px 20px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    margin-top: 10px;
}

.add-button:hover {
    background-color: #0056b3;
}

/* ---- Buy/Sell Toggle ---- */
.form-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.form-header h3 {
    margin: 0;
}

.transaction-type-selector {
    display: flex;
    border: 1px solid #444;
    border-radius: 50px;
    margin-bottom: 20px;
    overflow: hidden;
}

.type-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background-color: transparent;
    color: #888;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
}

.type-btn.active {
    background-color: #007BFF;
    color: white;
    font-weight: bold;
}


/* ---- Investment Card ---- */
.investment-card {
    background-color: #1E1E1E;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    border-left: 4px solid #007BFF;
}

.investment-card .quantity {
    font-weight: normal;
    font-size: 0.9em;
    color: #B3B3B3;
}

.financial-details {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 10px;
    font-size: 14px;
}

.details-column {
    flex: 1;
}

.details-column p {
    margin: 5px 0;
}

.investment-card .profit {
    font-size: 1.1em;
}

.date-info {
    font-size: 12px;
    color: #B3B3B3;
    margin-top: 15px;
    text-align: center;
}

.profit-positive {
    color: #28a745; /* Green */
}

.profit-negative {
    color: #dc3545; /* Red */
}

/* ---- Wallet Tab ---- */
.wallet-container {
    max-width: 500px;
    margin: 0 auto;
}

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

.currency-row .amount-input,
.currency-row .currency-select {
    padding: 10px;
    border: 1px solid #444;
    border-radius: 20px;
    background-color: #333;
    color: white;
    font-size: 1em;
}

.currency-row .amount-input {
    flex-grow: 1;
}

.currency-row .ils-value {
    min-width: 80px;
    text-align: center;
    color: #B3B3B3;
}

.add-button.secondary {
    background-color: transparent;
    border: 1px solid #007BFF;
    color: #007BFF;
}

.history-section {
    margin-top: 40px;
    border-top: 1px solid #444;
    padding-top: 20px;
}

.currency-select option {
    background: #333;
    color: white;
    padding: 10px;
    font-size: 16px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 5px;
    border-bottom: 1px solid #333;
}

/* ---- Capital Tab --- */
.capital-container {
    max-width: 500px;
    margin: 0 auto;
}
.capital-container .subtitle {
    text-align: center;
    color: #B3B3B3;
    margin-top: -10px;
    margin-bottom: 20px;
}
.asset-category {
    margin-bottom: 10px;
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
}
.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 15px;
    background-color: #1E1E1E;
    border: none;
    color: white;
    font-size: 1.1em;
    cursor: pointer;
}
.category-header i {
    transition: transform 0.3s ease;
}
.category-header.active i {
    transform: rotate(180deg);
}
.category-content {
    display: none; /* Hidden by default */
    padding: 15px;
}
.category-content.active {
    display: block; /* Shown when active */
}
.asset-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #333;
}
.asset-item:last-child {
    border-bottom: none;
}
.asset-item label {
    color: #B3B3B3;
}
.asset-value {
    width: 120px;
    padding: 8px;
    border: 1px solid #444;
    border-radius: 4px;
    background-color: #333;
    color: white;
    text-align: left;
}
/* Styling for the small "Add Item" button */
.add-button-small {
    width: auto; /* Allow the button to size to its content */
    padding: 8px 16px; /* Make the button smaller */
    font-size: 0.9em;
    margin-top: 15px; /* Add some space above it */
}
/* ---- Styling for Transaction Details ---- */
.transaction-details-container {
    padding: 15px;
    margin-top: 10px;
    background-color: #161616;
    border-radius: 0 0 8px 8px;
}

.transaction-list .transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #1E1E1E;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    border-left: 3px solid;
}

.transaction-item:last-child {
    margin-bottom: 0;
}

.transaction-item.buy {
    border-left-color: #007BFF;
}

.transaction-item.sell {
    border-left-color: #ff9800;
}

.transaction-info {
    font-size: 0.9em;
}

.transaction-header {
    font-weight: bold;
    margin-bottom: 5px;
    color: #FFFFFF;
}

.transaction-info div {
    color: #B3B3B3;
}

.delete-transaction-btn {
    color: #888;
    cursor: pointer;
    padding: 5px;
    font-size: 1.1em;
    transition: color 0.2s ease;
}

.delete-transaction-btn:hover {
    color: #dc3545; /* Red */
}
/* ---- Styling for Last Measurement Details ---- */
.measurement-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 10px;
    margin-bottom: 5px;
    background-color: #1E1E1E;
    border-radius: 6px;
    border-left: 3px solid #007BFF; /* Blue accent bar */
}

.measurement-item .currency-name {
    flex: 1;
    text-align: right;
    font-weight: bold;
}

.measurement-item .currency-amount {
    flex: 1;
    text-align: center;
    color: #B3B3B3;
}

.measurement-item .currency-ils-value {
    flex: 1;
    text-align: left;
    color: #FFFFFF;
}

.measurement-total {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    margin-top: 10px;
    font-weight: bold;
    font-size: 1.1em;
    border-top: 1px solid #444;
}
/* ---- Styling for Goals Tab ---- */
.goals-container .subtitle {
    text-align: center;
    color: #B3B3B3;
    margin-top: -10px;
    margin-bottom: 20px;
}

.goals-table-header {
    display: flex;
    justify-content: space-between;
    padding: 0 10px 10px 10px;
    color: #B3B3B3;
    font-size: 0.8em;
    border-bottom: 1px solid #444;
}

/* ---- Styling for Goals Tab ---- */
.goals-container .subtitle {
    text-align: center;
    color: #B3B3B3;
    margin-top: -10px;
    margin-bottom: 20px;
}

.goal-year-card {
    background-color: #1E1E1E;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    border: 1px solid #333;
}

.goal-year-header {
    background-color: #2a2a2a;
    padding: 10px 15px;
    font-weight: bold;
    font-size: 1.2em;
}

.goal-details {
    padding: 15px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-item label {
    font-size: 0.8em;
    color: #B3B3B3;
    margin-bottom: 5px;
}

.detail-item span {
    font-size: 1.1em;
}

.detail-item.total-target {
    grid-column: 1 / -1; /* Make this item span the full width */
    background-color: #007BFF;
    color: white;
    padding: 10px;
    border-radius: 6px;
    text-align: center;
}

.detail-item.total-target label {
    color: rgba(255, 255, 255, 0.8);
}

.detail-item.total-target .target-value {
    font-size: 1.5em;
    font-weight: bold;
}

.target-value small {
    display: block;
    font-size: 0.6em;
    font-weight: normal;
    color: rgba(255, 255, 255, 0.8);
}

.editable-goal {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s ease;
}

.editable-goal:hover {
    color: #007BFF;
}

.edit-goal-icon {
    font-size: 0.8em;
}
/* ---- Styling for Capital Breakdown ---- */
.breakdown-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.2em;
    font-weight: bold;
    padding: 15px;
    background-color: #1E1E1E;
    border-radius: 6px;
    border-left: 3px solid #28a745; /* Green accent */
}
/* ---- Styling for Dashboard Components ---- */
.total-capital-card {
    padding: 15px;
    background-color: #1E1E1E;
    border-radius: 8px;
    margin-bottom: 20px;
}

.total-capital-currency-hint {
    font-size: 0.78em;
    font-weight: 600;
    color: #8e8e93;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
    text-align: center;
}

.chart-container {
    position: relative;
    max-width: 250px; /* Controls the size of the chart */
    margin: 0 auto;
}

.chart-center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none; /* Allows clicks to go through to the canvas if needed */
}

.chart-label {
    font-size: 0.9em;
    color: #B3B3B3;
}

.total-value {
    font-size: 2em;
    font-weight: bold;
    margin: 5px 0;
}

.goal-percentage {
    font-size: 1em;
    color: #B3B3B3;
}
/* ---- Styling for KeyRates Component ---- */
.key-rates-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.rate-card {
    flex: 1;
    background-color: #1E1E1E;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #333;
}

.rate-card label {
    display: block;
    font-size: 0.8em;
    color: #B3B3B3;
    margin-bottom: 5px;
}

.rate-card span {
    display: block;
    font-size: 1.2em;
    font-weight: bold;
}
/* Styling for Investment Breakdown Component */
.breakdown-card {
    padding: 15px;
    background-color: #1E1E1E;
    border-radius: 8px;
    margin-bottom: 20px;
}
.breakdown-card h4 {
    margin-top: 0; margin-bottom: 15px; text-align: center;
}
.breakdown-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.7em;
    color: #888;
    padding: 0 10px 5px 10px;
    border-bottom: 1px solid #333;
}
.breakdown-header span:first-child { flex: 2; text-align: right; }
.breakdown-header span:nth-child(2) { flex: 1; text-align: center; }
.breakdown-header span:nth-child(3) { flex: 1; text-align: left; }

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #333;
    font-size: 0.9em;
}
.breakdown-item:last-child { border-bottom: none; }
.breakdown-item span.label { flex: 2; text-align: right; color: #B3B3B3; }
.breakdown-item span:nth-child(2) { flex: 1; text-align: center; font-weight: bold; }
.breakdown-item span:nth-child(3) { flex: 1; text-align: left; font-weight: bold; }

.breakdown-item.total {
    font-size: 1em;
    font-weight: bold;
}
/* ---- Styling for Capital Breakdown Component ---- */
.capital-breakdown-container {
    padding: 15px;
    background-color: #1E1E1E;
    border-radius: 8px;
    margin-bottom: 20px;
}
.capital-breakdown-container h4 {
    margin-top: 0;
    margin-bottom: 15px;
    text-align: center;
}
.capital-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 10px;
    border-bottom: 1px solid #333;
    font-size: 1.1em;
}
.capital-item:last-child {
    border-bottom: none;
}
.capital-item i {
    margin-left: 8px;
    color: #888;
}
.capital-item.total {
    font-size: 1.2em;
    padding-top: 20px;
    margin-top: 10px;
    border-top: 1px solid #555;
}
.capital-item-details {
    padding: 0 25px 10px 10px;
}
.manual-asset-detail {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    color: #B3B3B3; /* Lighter color */
    padding-top: 8px;
}
.manual-asset-category-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.95em;
    font-weight: bold;
    color: #FFFFFF;
    padding: 12px 0 5px 0;
    margin-top: 8px;
    border-bottom: 1px solid #444;
}
/* ---- Styling for Deposit Progress Component ---- */
.deposit-progress-card {
    padding: 15px;
    background-color: #1E1E1E;
    border-radius: 8px;
    margin-bottom: 20px;
}
.deposit-progress-card h4 {
    margin-top: 0;
    margin-bottom: 15px;
    text-align: center;
}
.progress-summary {
    display: flex;
    justify-content: space-around;
    text-align: center;
    margin-bottom: 15px;
}
.progress-summary .label {
    font-size: 0.8em;
    color: #B3B3B3;
    display: block;
}
.progress-summary .value {
    font-size: 1.1em;
    font-weight: bold;
}
.progress-summary .ahead .value {
    color: #28a745; /* Green */
}
.progress-summary .behind .value {
    color: #dc3545; /* Red */
}
.progress-bar-container {
    background-color: #333;
    border-radius: 50px;
    height: 8px;
    overflow: hidden;
    width: 100%;
}
.progress-bar {
    background-color: #007BFF;
    height: 100%;
}
.progress-bar-label {
    text-align: center;
    font-size: 0.8em;
    color: #B3B3B3;
    margin-top: 8px;
}
/* ---- Styling for Investment Goal Component ---- */
.investment-goal-card {
    padding: 15px;
    background-color: #1E1E1E;
    border-radius: 8px;
    margin-bottom: 20px;
}
.investment-goal-card h4 {
    margin-top: 0;
    margin-bottom: 15px;
    text-align: center;
}
.goal-summary {
    display: flex;
    justify-content: space-around;
    text-align: center;
    margin-bottom: 15px;
}
.goal-summary .label {
    font-size: 0.8em;
    color: #B3B3B3;
    display: block;
}
.goal-summary .value {
    font-size: 1.1em;
    font-weight: bold;
}
/* ---- Styling for Records Component ---- */
.records-card {
    padding: 15px;
    background-color: #1E1E1E;
    border-radius: 8px;
    margin-bottom: 20px;
}
.records-card h4 {
    margin-top: 0;
    margin-bottom: 15px;
    text-align: center;
}
.record-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.9em;
}
.record-item span:first-child {
    color: #B3B3B3;
}
.record-item span:last-child {
    font-weight: bold;
}
.record-item.separator {
    border-bottom: 1px solid #333;
    margin-bottom: 8px;
    padding-bottom: 12px;
}
/* ---- Styling for Tab Headers ---- */
.tab-header {
    display: flex;
    align-items: center;
    gap: 12px; /* Space between icon and text */
    color: #FFFFFF;
    border-bottom: 1px solid #222;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.tab-header h1, .tab-header h2 {
    margin: 0;
    font-size: 1.8em; /* Smaller font size */
    font-weight: 600; /* Semi-bold, not extra bold */
}

/* ---- Styling for Tab Headers ---- */
.tab-header {
    display: flex;
    align-items: center;
    gap: 12px; /* Space between icon and text */
    color: #FFFFFF;
    border-bottom: 1px solid #333;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.tab-header h1, .tab-header h2 {
    margin: 0;
    font-size: 1.6em; /* Slightly smaller */
    font-weight: 500; /* Lighter than bold */
}

/* ---- Styling for Tab Headers ---- */
.tab-header {
    display: flex;
    align-items: center;
    gap: 12px; /* Space between icon and text */
    color: #FFFFFF;
    border-bottom: 1px solid #333;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.tab-header h1, .tab-header h2 {
    margin: 0;
    font-size: 1.6em; /* Slightly smaller */
    font-weight: 500; /* Lighter than bold */
}

.tab-header i {
    font-size: 1.1em;
    color: #007BFF; /* Blue accent for the icon */
}
.goal-summary .value small {
    display: block;
    font-size: 0.6em;
    font-weight: 400;
    color: #B3B3B3;
    margin-top: 4px;
}

/* === Dashboard currency blocks (USD above ILS) === */
.dashboard-currency-section {
    margin-bottom: 4px;
}

/* === Performance Snapshot Component === */
.performance-strip-currency-badge {
    flex: 0 0 100%;
    width: 100%;
    font-size: 0.78em;
    font-weight: 600;
    color: #8e8e93;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

.performance-snapshot-card {
    background-color: #2c2c2e;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.bars-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bar-row {
    width: 100%;
}

.bar-label {
    font-size: 14px;
    color: #b0b0b0;
    margin-bottom: 6px;
}

.bar {
    height: 10px;
    border-radius: 5px;
    transition: width 0.5s ease-in-out;
}

/* Default Profit Mode */
.bars-container:not(.loss-mode) .bar {
    float: right; /* Grow from right to left */
}
.blue-bar { background-color: #007bff; }
.green-bar { background-color: #28a745; }

/* Loss Mode Styles */
.bars-container.loss-mode .bar-row {
    display: flex;
    justify-content: flex-end;
}
.bars-container.loss-mode .blue-bar {
    float: none;
    direction: ltr; /* Ensure it grows left */
}
.bars-container.loss-mode .red-bar {
    float: none;
    background-color: #dc3545;
    direction: rtl; /* Ensure it grows right */
}
.bars-container.loss-mode .loss-label {
    text-align: right; /* Align the loss label to the right */
}


.momentum-container {
    flex-shrink: 0;
}

.momentum-box {
    width: 120px;
    height: 100px;
    border-radius: 10px;
    border: 2px solid;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.momentum-box.profit-positive {
    border-color: #28a745;
    color: #28a745;
}
.momentum-box.profit-negative {
    border-color: #dc3545;
    color: #dc3545;
}

.momentum-arrow {
    font-size: 24px;
    line-height: 1;
}
.momentum-delta {
    font-size: 16px;
}
.momentum-label {
    font-size: 12px;
    font-weight: normal;
    color: #b0b0b0;
}