:root {
    --primary: #2962ff;
    --bg: #f4f7f6;
    --card-bg: #ffffff;
    --text: #333;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.7)), url('/static/img/login_bg.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text);
    margin: 0;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Dark Theme Overrides - Midnight Dark */
body.dark-theme {
    background: #0f172a !important;
    background-image: none !important;
    color: #f8fafc !important;
}

body.dark-theme .card,
body.dark-theme .modal-content,
body.dark-theme .portfolio-card,
body.dark-theme .stock-item,
body.dark-theme .market-news-item-container,
body.dark-theme .chart-card,
body.dark-theme .dashboard > div,
body.dark-theme .holdings-table-container,
body.dark-theme .projection-controls,
body.dark-theme .budget-section,
body.dark-theme .budget-summary {
    background: #1e293b !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
}

body.dark-theme h1,
body.dark-theme h2,
body.dark-theme h3,
body.dark-theme h4,
body.dark-theme label,
body.dark-theme .subtitle {
    color: #f8fafc !important;
}

body.dark-theme input,
body.dark-theme textarea,
body.dark-theme select {
    background: #334155 !important;
    color: #f8fafc !important;
    border-color: #475569 !important;
}

body.dark-theme input:focus,
body.dark-theme textarea:focus,
body.dark-theme select:focus {
    border-color: #6366f1 !important;
    outline: none;
}

body.dark-theme .market-news-meta,
body.dark-theme .news-meta,
body.dark-theme .metric-label,
body.dark-theme .holding-price {
    color: #94a3b8 !important;
}

/* Navigation Bar */
body.dark-theme .main-nav {
    background: #1e293b !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
    border: 1px solid #334155 !important;
}

body.dark-theme .nav-link {
    color: #f8fafc !important;
}

body.dark-theme .nav-link:hover {
    background: #334155 !important;
    color: #6366f1 !important;
}

body.dark-theme .nav-link.active {
    background: #334155 !important;
    color: #6366f1 !important;
    border-bottom: 2px solid #6366f1 !important;
}

body.dark-theme .user-greeting {
    color: #f8fafc !important;
}

body.dark-theme .founding-member-icon {
    background: #78350f !important;
    color: #fcd34d !important;
}

body.dark-theme .founding-member-icon:hover {
    background: #92400e !important;
    color: #fef3c7 !important;
}

body.dark-theme .btn-logout-nav {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #f8fafc !important;
}

body.dark-theme .btn-logout-nav:hover {
    background: #475569 !important;
    border-color: #64748b !important;
}

body.dark-theme .btn-share-nav,
body.dark-theme .btn-settings-nav,
body.dark-theme .btn-messages-nav {
    color: #f8fafc !important;
}

body.dark-theme .btn-share-nav:hover,
body.dark-theme .btn-settings-nav:hover,
body.dark-theme .btn-messages-nav:hover {
    background: #334155 !important;
    color: #6366f1 !important;
}

/* Tables */
body.dark-theme .holdings-table th {
    background-color: #334155 !important;
    color: #94a3b8 !important;
    border-bottom-color: #475569 !important;
}

body.dark-theme .holdings-table td {
    border-bottom-color: #334155 !important;
    color: #f8fafc !important;
}

body.dark-theme .holdings-table tr:hover {
    background-color: #334155 !important;
}

body.dark-theme .holding-ticker {
    color: #f8fafc !important;
}

body.dark-theme .holding-shares,
body.dark-theme .holding-value {
    color: #1e3a8a !important;
}

/* Buttons */
body.dark-theme button:not(.btn-remove):not(.btn-remove-row) {
    background-color: #334155 !important;
    color: #f8fafc !important;
    border: 1px solid #475569 !important;
}

body.dark-theme button:hover:not(.btn-remove):not(.btn-remove-row) {
    background-color: #475569 !important;
    border-color: #64748b !important;
}

body.dark-theme .btn-project {
    background-color: #6366f1 !important;
    color: #f8fafc !important;
}

body.dark-theme .btn-project:hover {
    background-color: #4f46e5 !important;
}

/* Cards and Panels */
body.dark-theme .holding-item {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #f8fafc !important;
}

body.dark-theme .holding-item:hover {
    background: #475569 !important;
    border-color: #6366f1 !important;
}

body.dark-theme .news-item {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

body.dark-theme .news-item:hover {
    background: #334155 !important;
    border-color: #6366f1 !important;
}

body.dark-theme .news-title {
    color: #f8fafc !important;
}

/* Metrics and Controls */
body.dark-theme .metrics-grid {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

body.dark-theme .metric-item.clickable:hover {
    background-color: #334155 !important;
}

body.dark-theme .metric-item.active {
    background-color: #334155 !important;
    border-color: #6366f1 !important;
}

body.dark-theme .investment-input-group {
    background: #334155 !important;
    border-color: #475569 !important;
}

body.dark-theme .control-group label {
    color: #f8fafc !important;
}

/* Projection and Budget */
body.dark-theme .result-card {
    background: #334155 !important;
    border-color: #475569 !important;
}

body.dark-theme .result-label {
    color: #94a3b8 !important;
}

body.dark-theme .result-value {
    color: #6366f1 !important;
}

body.dark-theme .budget-row label {
    color: #f8fafc !important;
}

/* Text Colors */
body.dark-theme .text-success {
    color: #1e3a8a !important;
}

body.dark-theme .text-danger {
    color: #ef4444 !important;
}

body.dark-theme .text-primary {
    color: #6366f1 !important;
}

/* Remove button styling */
body.dark-theme .btn-remove,
body.dark-theme .btn-remove-row {
    background: #475569 !important;
    color: #ef4444 !important;
    border-color: #64748b !important;
}

body.dark-theme .btn-remove:hover,
body.dark-theme .btn-remove-row:hover {
    background: #64748b !important;
}

/* Portfolio Management */
body.dark-theme .portfolio-management {
    border-top-color: #334155 !important;
}

body.dark-theme .save-controls input,
body.dark-theme .load-controls select {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #f8fafc !important;
}

/* Modal */
body.dark-theme .modal {
    background-color: rgba(0, 0, 0, 0.8) !important;
}

body.dark-theme .close-modal {
    color: #f8fafc !important;
}

body.dark-theme .close-modal:hover {
    color: #6366f1 !important;
}

/* Message items */
body.dark-theme .message-item {
    background: #1e293b !important;
    border-color: #334155 !important;
}

body.dark-theme .message-item:hover {
    background: #334155 !important;
    border-color: #6366f1 !important;
}

body.dark-theme .message-item.unread {
    background: #1e3a5f !important;
    border-left-color: #6366f1 !important;
}

body.dark-theme .message-subject {
    color: #f8fafc !important;
}

body.dark-theme .message-preview {
    color: #94a3b8 !important;
}

body.dark-theme .message-date {
    color: #64748b !important;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    color: #e2e8f0;
    font-size: 1.1rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.controls {
    text-align: center;
    margin-bottom: 30px;
}

.button-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.portfolio-management {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
}

.save-controls,
.load-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.save-controls input,
.load-controls select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
}

.btn-save {
    background-color: #009688;
}

.btn-delete {
    background-color: #f44336;
    padding: 8px 12px;
}

button {
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.1s, filter 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-weight: 600;
}

button:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-random {
    background-color: #607d8b;
}

.btn-mag7 {
    background-color: #673ab7;
}

.btn-tech {
    background-color: #2196f3;
}

.btn-semi {
    background-color: #ff9800;
}

.btn-fin {
    background-color: #4caf50;
}

.btn-retail {
    background-color: #e91e63;
}

.btn-pharma {
    background-color: #00bcd4;
}

.btn-staples {
    background-color: #8bc34a;
}

.btn-disc {
    background-color: #ff5722;
}

.dashboard {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.holdings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.holdings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.holdings-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-recalc {
    background-color: #607d8b;
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-broker {
    background-color: #795548;
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-broker:hover {
    background-color: #5d4037;
}

#totalWeight {
    font-weight: bold;
    color: #555;
}

.holding-item {
    background: white;
    padding: 10px;
    border-radius: 6px;
    text-align: center;
    border: 1px solid #eee;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    position: relative;
    /* For absolute positioning of remove button if needed, or just flex */
}

.btn-remove {
    background: none;
    border: none;
    color: #ff5252;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    position: absolute;
    top: 5px;
    right: 5px;
    opacity: 0;
    /* Hidden by default */
    transition: opacity 0.2s;
}

.holding-item:hover .btn-remove {
    opacity: 1;
    /* Show on hover */
}

.btn-remove:hover {
    color: #d32f2f;
    transform: scale(1.1);
}

.holding-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.holding-ticker {
    font-weight: bold;
    color: var(--primary);
}

.add-stock-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    justify-content: center;
}

.add-stock-controls input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    width: 150px;
    text-transform: uppercase;
}

.add-stock-controls input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-add {
    background-color: #9c27b0;
    padding: 8px 16px;
    font-size: 0.9rem;
}

.holding-weight-input {
    width: 60px;
    padding: 4px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 0.9rem;
}

.holding-weight-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 25px;
    border: 1px solid #888;
    width: 90%;
    max-width: 800px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.close-modal:hover,
.close-modal:focus {
    color: #333;
    text-decoration: none;
}

.stock-summary {
    margin-top: 20px;
    line-height: 1.6;
    color: #555;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 10px;
    font-size: 0.95rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.metric-item {
    text-align: center;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.metric-item.clickable {
    cursor: pointer;
}

.metric-item.clickable:hover {
    background-color: #e3f2fd;
}

.metric-item.active {
    background-color: #bbdefb;
    border: 1px solid #2196f3;
}

.metric-label {
    font-size: 0.8rem;
    color: #777;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.news-section {
    margin-top: 25px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.holdings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.investment-input-group {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #f1f5f9;
    padding: 5px 10px;
    border-radius: 6px;
}

.investment-input-group input {
    width: 100px;
    padding: 5px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
}

.holdings-table-container {
    overflow-x: auto;
    overflow-y: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
    max-height: 500px;
    /* Limit height to keep charts visible */
    scrollbar-width: thin;
    /* Firefox */
}

.holdings-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
    /* Ensure it doesn't squish too much on mobile */
}

.holdings-table th,
.holdings-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.holdings-table th {
    background-color: #f8fafc;
    color: #64748b;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    /* Sticky header */
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
}

.holdings-table tr:last-child td {
    border-bottom: none;
}

.holdings-table tr:hover {
    background-color: #f8f9fa;
}

.holding-ticker {
    font-weight: 700;
    color: #334155;
}

.holding-price {
    font-size: 0.9rem;
    color: #64748b;
}

.holding-weight-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
}

.holding-weight-input {
    width: 70px;
    padding: 6px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    text-align: right;
}

.holding-shares {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #2563eb;
}

.holding-value {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #166534;
}

.btn-remove {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-remove-row {
    background: transparent;
    color: #ef4444;
    border: 1px solid transparent;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}

.btn-remove-row:hover {
    background: #fee2e2;
    border-color: #fecaca;
    transform: scale(1.1);
}

.news-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.news-item {
    display: flex;
    gap: 15px;
    padding: 10px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.1s, box-shadow 0.1s;
}

.news-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    border-color: var(--primary);
}

.news-thumbnail {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    background: #f0f0f0;
}

.news-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.news-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
    color: #2c3e50;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-meta {
    font-size: 0.8rem;
    color: #888;
}

.btn-project {
    background-color: var(--primary);
    font-size: 1rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-project:hover {
    background-color: #1d4ed8;
    transform: translateY(-2px);
}

.projection-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
    margin-bottom: 25px;
    background: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.control-group label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 600;
}

.control-group input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 120px;
}

.btn-calc-proj {
    background-color: #2196f3;
    color: white;
    border: none;
    padding: 9px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

.projection-results {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.projection-option-card {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.projection-option-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
    background: #f8fafc;
}

.projection-option-card h3 {
    color: #1e293b;
    font-size: 1.3rem;
    margin: 0 0 10px 0;
}

.projection-option-card p {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

/* Dark theme support for projection option cards */
body.dark-theme .projection-option-card {
    background: #1e293b;
    border-color: #334155;
    color: #f8fafc;
}

body.dark-theme .projection-option-card:hover {
    background: #334155;
    border-color: #6366f1;
}

body.dark-theme .projection-option-card h3 {
    color: #f8fafc;
}

body.dark-theme .projection-option-card p {
    color: #cbd5e1;
}

/* Navy theme support for projection option cards */
body.navy-theme .projection-option-card {
    background: #ffffff;
    border-color: #e2e8f0;
}

body.navy-theme .projection-option-card:hover {
    border-color: #1e3a8a;
    background: #f4f7f6;
}

body.navy-theme .projection-option-card h3 {
    color: #1e3a8a;
}

/* Monte Carlo Modal Tabs */
.mc-tab-btn {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: #64748b;
    transition: all 0.2s;
}

.mc-tab-btn:hover {
    color: var(--primary);
    background: rgba(0, 0, 0, 0.02);
}

.mc-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.mc-tab-content {
    padding: 20px 0;
}

/* Dark theme support for MC tabs */
body.dark-theme .mc-tab-btn {
    color: #cbd5e1;
}

body.dark-theme .mc-tab-btn:hover {
    color: #6366f1;
    background: rgba(255, 255, 255, 0.05);
}

body.dark-theme .mc-tab-btn.active {
    color: #6366f1;
    border-bottom-color: #6366f1;
}

/* Spinner animation for loading states */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Strategy Cards Styling */
.strategy-card {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 30px 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.strategy-card:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
    background: #f8fafc;
}

.strategy-card h3 {
    color: #1e293b;
    font-size: 1.5rem;
    margin: 0 0 15px 0;
    font-weight: 700;
}

.strategy-returns {
    font-size: 1.2rem;
    font-weight: 600;
    color: #10b981;
    margin-bottom: 10px;
}

.strategy-suitability {
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Dark theme support for strategy cards */
body.dark-theme .strategy-card {
    background: #1e293b;
    border-color: #334155;
    color: #f8fafc;
}

body.dark-theme .strategy-card:hover {
    background: #334155;
    border-color: #6366f1;
}

body.dark-theme .strategy-card h3 {
    color: #f8fafc;
}

body.dark-theme .strategy-suitability {
    color: #cbd5e1;
}

/* Navy theme support for strategy cards */
body.navy-theme .strategy-card {
    background: #ffffff;
    border-color: #e2e8f0;
}

body.navy-theme .strategy-card:hover {
    border-color: #1e3a8a;
    background: #f4f7f6;
}

body.navy-theme .strategy-card h3 {
    color: #1e3a8a;
}

/* Monte Carlo Chart Styling - Ensure lines are visible */
#mcChart {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 10px;
}

body.dark-theme #mcChart {
    background-color: #1e293b;
}

.chart-container canvas {
    max-width: 100%;
    height: auto !important;
}

/* Responsive grid for projection selection */
@media (max-width: 768px) {
    .projection-option-card {
        grid-column: span 3;
    }
}

.result-card {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #bbdefb;
}

.result-label {
    font-size: 0.85rem;
    color: #555;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.result-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #1565c0;
}

.budget-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.budget-section h4 {
    margin-bottom: 10px;
    color: #444;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.budget-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.budget-row label {
    font-size: 0.9rem;
    color: #555;
}

.budget-input {
    width: 100px;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: right;
}

.budget-summary {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.budget-total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.budget-total-row.final {
    border-top: 1px solid #ddd;
    padding-top: 10px;
    margin-top: 10px;
    font-weight: bold;
    font-size: 1.1rem;
}

.text-success {
    color: #4caf50;
}

.text-danger {
    color: #f44336;
}

.text-primary {
    color: #2196f3;
}

.btn-apply-budget {
    width: 100%;
    background-color: #2196f3;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: bold;
}

.btn-apply-budget:hover {
    background-color: #1976d2;
}

.loading {
    text-align: center;
    margin: 50px 0;
}

.loading-inline {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: nowrap;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner-text {
    position: absolute;
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 500;
    text-transform: lowercase;
    animation: spin-reverse 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes spin-reverse {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(-360deg);
    }
}

.spinner-inline {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    animation: spin 1s linear infinite;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin: 0;
    cursor: pointer;
}

.spinner-inline .spinner-text {
    font-size: 0.6rem;
}

.btn-cancel-inline {
    padding: 8px 12px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    height: auto;
    line-height: 1.2;
    margin: 0;
    display: inline-block;
    vertical-align: middle;
}

.btn-share {
    background-color: #2196f3;
    padding: 6px 12px;
    font-size: 0.9rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-share:hover {
    background-color: #1976d2;
}

.share-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.btn-social {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-twitter {
    background-color: #000;
    color: white;
}

.btn-linkedin {
    background-color: #0077b5;
    color: white;
}

.btn-facebook {
    background-color: #1877f2;
    color: white;
}

.btn-whatsapp {
    background-color: #25D366;
    color: white;
}

.btn-gmail {
    background-color: #EA4335;
    color: white;
}

.btn-copy {
    background-color: #607d8b;
    color: white;
}

.btn-twitter:hover {
    background-color: #333;
}

.btn-linkedin:hover {
    background-color: #005e93;
}

.btn-facebook:hover {
    background-color: #166fe5;
}

.btn-whatsapp:hover {
    background-color: #128C7E;
}

.btn-gmail:hover {
    background-color: #C5221F;
}

.beta-badge {
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
    color: white;
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 6px;
    vertical-align: middle;
    letter-spacing: 1px;
    box-shadow: 0 2px 5px rgba(211, 47, 47, 0.3);
    transform: translateY(-5px);
}

.btn-ai-summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
    margin-bottom: 10px;
}

.btn-ai-summary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(118, 75, 162, 0.3);
}

.btn-ai-ask {
    background-color: #2196f3;
    color: white;
    border: none;
    padding: 0 20px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
}

.btn-ai-ask:hover {
    background-color: #1976d2;
}

.ai-response {
    line-height: 1.6;
    color: #333;
    font-size: 0.95rem;
    white-space: pre-wrap;
    /* Preserve formatting */
}

.btn-prompt {
    background-color: #e3f2fd;
    color: #1565c0;
    border: 1px solid #bbdefb;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-prompt:hover {
    background-color: #bbdefb;
    transform: translateY(-1px);
}

.ai-term {
    color: #1565c0;
    font-weight: bold;
    cursor: pointer;
    border-bottom: 1px dashed #1565c0;
    transition: all 0.2s;
}

.ai-term:hover {
    background-color: #e3f2fd;
    border-bottom: 1px solid #1565c0;
}

.btn-ai-back {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #666;
}

.btn-ai-back:hover {
    background-color: #e0e0e0;
    color: #333;
}

@keyframes pulse-blue {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.ai-loading {
    color: #1565c0;
    font-style: italic;
    font-weight: bold;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    background: #f0f7ff;
    border-radius: 8px;
    animation: pulse-blue 1.5s infinite ease-in-out;
    border: 1px solid #bbdefb;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.btn-project-row {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    padding: 2px 6px;
    transition: all 0.2s;
}

.btn-project-row:hover {
    background-color: #e3f2fd;
    border-color: #2196f3;
}

.chip {
    background: #f0f0f0;
    border: none;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    cursor: pointer;
    color: #555;
    transition: background 0.2s;
}

.chip:hover {
    background: #e0e0e0;
    color: #333;
}

.holding-shares-input {
    width: 80px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 0.9rem;
}

.holding-shares-input:focus {
    border-color: #2196f3;
    outline: none;
}

.clickable-label {
    cursor: pointer;
    color: #1565c0;
    text-decoration: underline;
    text-decoration-style: dotted;
}

.clickable-label:hover {
    color: #0d47a1;
    text-decoration-style: solid;
}

.definitions-row {
    border-bottom: 1px solid #e2e8f0;
    padding: 6px 0;
}
.definitions-row:last-child {
    border-bottom: none;
}
.definitions-term-link {
    display: block;
    padding: 4px 0;
    color: #2962ff;
    text-decoration: none;
    cursor: pointer;
}
.definitions-term-link:hover {
    text-decoration: underline;
}

/* Navigation */
.main-nav {
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 0;
    margin: 15px auto 30px auto;
    max-width: 1380px;
    border-radius: 16px;
    position: sticky;
    top: 15px;
    z-index: 1000;
}

.nav-container {
    max-width: 1380px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    padding: 0 24px;
    box-sizing: border-box;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-link {
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--primary);
    background: #f1f5f9;
}

.nav-link.active {
    color: var(--primary);
    background: #eff6ff;
    font-weight: 600;
}

.nav-link.disabled-link {
    color: #cbd5e1;
    cursor: not-allowed;
    opacity: 0.5;
}

.nav-link.disabled-link:hover {
    color: #cbd5e1;
    background: transparent;
}

/* Stocks nav dropdown */
.nav-item-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown-trigger {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

.nav-dropdown-trigger:not(.disabled-link):hover {
    color: var(--primary);
    background: #f1f5f9;
}

.nav-dropdown-trigger.disabled-link {
    cursor: not-allowed;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 160px;
    margin-top: 4px;
    padding: 8px 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.nav-item-dropdown.open .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-link {
    display: block;
    padding: 10px 16px;
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
    border-radius: 4px;
    margin: 0 6px;
    transition: all 0.2s;
}

.nav-dropdown-link:hover {
    color: var(--primary);
    background: #f1f5f9;
}

.nav-dropdown-link.active {
    color: var(--primary);
    background: #eff6ff;
    font-weight: 600;
}

body.dark-theme .nav-dropdown-menu {
    background: #1e293b;
    border-color: #334155;
}

body.dark-theme .nav-dropdown-link {
    color: #94a3b8;
}

body.dark-theme .nav-dropdown-link:hover {
    color: var(--primary);
    background: #334155;
}

body.dark-theme .nav-dropdown-link.active {
    color: var(--primary);
    background: #334155;
}

.user-controls-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-greeting {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
}

.user-name-and-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.founding-member-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0;
    padding: 2px;
    width: 22px;
    height: 22px;
    vertical-align: middle;
    border: none;
    border-radius: 6px;
    background: #fef3c7;
    color: #b45309;
    cursor: pointer;
}

.founding-member-icon:hover {
    background: #fde68a;
    color: #92400e;
}

.founding-member-icon svg {
    display: block;
}

.btn-logout-nav {
    text-decoration: none;
    color: #ef4444;
    border: 1px solid #fee2e2;
    background: #fef2f2;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-logout-nav:hover {
    background: #fee2e2;
    border-color: #fecaca;
}

.btn-share-nav {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-share-nav:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.btn-settings-nav {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-settings-nav:hover {
    background: #f1f5f9;
    color: var(--primary);
    transform: rotate(45deg);
}

/* Sortable Table Styles */
.holdings-table th[onclick] {
    user-select: none;
    position: relative;
    transition: background-color 0.2s;
}

.holdings-table th[onclick]:hover {
    background-color: #f1f5f9;
}

.holdings-table th[onclick]:active {
    background-color: #e2e8f0;
}

.sort-indicator {
    display: inline-block;
    margin-left: 5px;
    font-size: 0.8rem;
    color: var(--primary);
    min-width: 12px;
}

/* Navy Theme - Light Theme with Navy Accents */
body.emerald-theme {
    background: #f4f7f6 !important;
    background-image: none !important;
    color: #333 !important;
}

body.emerald-theme .main-nav {
    background: #ffffff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    border: none !important;
}

body.emerald-theme .nav-link {
    color: #64748b !important;
}

body.emerald-theme .nav-link:hover {
    background: #f1f5f9 !important;
    color: #1e3a8a !important;
}

body.emerald-theme .nav-link.active {
    color: #1e3a8a !important;
    background: #eef2ff !important;
    font-weight: 600 !important;
    border-bottom: 2px solid #1e3a8a !important;
}

body.emerald-theme .user-greeting {
    color: #64748b !important;
}

body.emerald-theme .btn-logout-nav {
    background: #1e3a8a !important;
    border-color: #172554 !important;
    color: #ffffff !important;
}

body.emerald-theme .btn-logout-nav:hover {
    background: #172554 !important;
    border-color: #1e293b !important;
}

body.emerald-theme .btn-share-nav,
body.emerald-theme .btn-settings-nav,
body.emerald-theme .btn-messages-nav {
    color: #64748b !important;
}

body.emerald-theme .btn-share-nav:hover,
body.emerald-theme .btn-settings-nav:hover,
body.emerald-theme .btn-messages-nav:hover {
    background: #f1f5f9 !important;
    color: #1e3a8a !important;
}

body.emerald-theme .card,
body.emerald-theme .modal-content,
body.emerald-theme .portfolio-card,
body.emerald-theme .stock-item,
body.emerald-theme .market-news-item-container,
body.emerald-theme .chart-card,
body.emerald-theme .dashboard > div,
body.emerald-theme .holdings-table-container,
body.emerald-theme .projection-controls,
body.emerald-theme .budget-section,
body.emerald-theme .budget-summary {
    background: #ffffff !important;
    color: #333 !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05) !important;
}

body.emerald-theme h1,
body.emerald-theme h2,
body.emerald-theme h3,
body.emerald-theme h4,
body.emerald-theme label {
    color: #1e293b !important;
}

body.emerald-theme .subtitle {
    color: #64748b !important;
}

body.emerald-theme input,
body.emerald-theme textarea,
body.emerald-theme select {
    background: #ffffff !important;
    color: #333 !important;
    border-color: #cbd5e1 !important;
}

body.emerald-theme input:focus,
body.emerald-theme textarea:focus,
body.emerald-theme select:focus {
    border-color: #1e3a8a !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1) !important;
}

body.emerald-theme .market-news-meta,
body.emerald-theme .news-meta,
body.emerald-theme .metric-label,
body.emerald-theme .holding-price {
    color: #64748b !important;
}

body.emerald-theme .holdings-table th {
    background-color: #f8fafc !important;
    color: #64748b !important;
    border-bottom-color: #e2e8f0 !important;
}

body.emerald-theme .holdings-table td {
    border-bottom-color: #e2e8f0 !important;
    color: #1e293b !important;
}

body.emerald-theme .holdings-table tr:hover {
    background-color: #f8fafc !important;
}

body.emerald-theme .holding-ticker {
    color: #1e293b !important;
}

body.emerald-theme .holding-shares,
body.emerald-theme .holding-value {
    color: #1e3a8a !important;
}

body.emerald-theme button:not(.btn-remove):not(.btn-remove-row):not(.btn-project) {
    background-color: #1e3a8a !important;
    color: #ffffff !important;
    border: none !important;
}

body.emerald-theme button:hover:not(.btn-remove):not(.btn-remove-row):not(.btn-project) {
    background-color: #172554 !important;
}

body.emerald-theme .btn-project {
    background-color: #1e3a8a !important;
    color: #ffffff !important;
}

body.emerald-theme .btn-project:hover {
    background-color: #172554 !important;
}

body.emerald-theme .holding-item {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    color: #1e293b !important;
}

body.emerald-theme .holding-item:hover {
    background: #f8fafc !important;
    border-color: #1e3a8a !important;
}

body.emerald-theme .news-item {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    color: #1e293b !important;
}

body.emerald-theme .news-item:hover {
    background: #f8fafc !important;
    border-color: #1e3a8a !important;
}

body.emerald-theme .news-title {
    color: #1e293b !important;
}

body.emerald-theme .metrics-grid {
    background-color: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

body.emerald-theme .metric-item.clickable:hover {
    background-color: #eef2ff !important;
}

body.emerald-theme .metric-item.active {
    background-color: #eef2ff !important;
    border-color: #1e3a8a !important;
}

body.emerald-theme .investment-input-group {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}

body.emerald-theme .control-group label {
    color: #1e293b !important;
}

body.emerald-theme .result-card {
    background: #eef2ff !important;
    border-color: #c7d2fe !important;
}

body.emerald-theme .result-label {
    color: #64748b !important;
}

body.emerald-theme .result-value {
    color: #1e3a8a !important;
}

body.emerald-theme .budget-row label {
    color: #1e293b !important;
}

body.emerald-theme .text-success {
    color: #1e3a8a !important;
}

body.emerald-theme .text-danger {
    color: #ef4444 !important;
}

body.emerald-theme .text-primary {
    color: #1e3a8a !important;
}

body.emerald-theme .btn-remove,
body.emerald-theme .btn-remove-row {
    background: #fee2e2 !important;
    color: #ef4444 !important;
    border-color: #fecaca !important;
}

body.emerald-theme .btn-remove:hover,
body.emerald-theme .btn-remove-row:hover {
    background: #fecaca !important;
}

body.emerald-theme .portfolio-management {
    border-top-color: #e2e8f0 !important;
}

body.emerald-theme .save-controls input,
body.emerald-theme .load-controls select {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #1e293b !important;
}

body.emerald-theme .modal {
    background-color: rgba(0, 0, 0, 0.5) !important;
}

body.emerald-theme .close-modal {
    color: #64748b !important;
}

body.emerald-theme .close-modal:hover {
    color: #1e3a8a !important;
}

body.emerald-theme .message-item {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}

body.emerald-theme .message-item:hover {
    background: #f8fafc !important;
    border-color: #1e3a8a !important;
}

body.emerald-theme .message-item.unread {
    background: #eef2ff !important;
    border-left-color: #1e3a8a !important;
}

body.emerald-theme .message-subject {
    color: #1e293b !important;
}

body.emerald-theme .message-preview {
    color: #64748b !important;
}

body.emerald-theme .message-date {
    color: #94a3b8 !important;
}

body.emerald-theme .projection-controls {
    background: #f5f5f5 !important;
}

body.emerald-theme .branding span {
    color: #1e3a8a !important;
}

/* Post-it notes (double-click to create; anchored to page, scroll with content) */
#postit-notes-container {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    min-height: 100%;
    pointer-events: none;
    z-index: 9000;
}

#postit-notes-container .postit-note {
    pointer-events: auto;
    position: absolute;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    background: #fef9c3;
    border: 1px solid #e4d36f;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    z-index: 9001;
    transition: box-shadow 0.15s ease;
}

#postit-notes-container .postit-note:hover {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

#postit-notes-container .postit-note.expanded {
    width: 220px;
    min-height: 140px;
    height: auto;
    max-width: min(280px, calc(100vw - 24px));
    max-height: min(320px, calc(100vh - 24px));
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 8px;
}

#postit-notes-container .postit-note.expanded .postit-icon {
    display: none;
}

#postit-notes-container .postit-note .postit-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
}

#postit-notes-container .postit-note.postit-dragging .postit-icon,
#postit-notes-container .postit-note.postit-dragging .postit-drag-handle {
    cursor: grabbing;
}

#postit-notes-container .postit-note .postit-drag-handle {
    display: none;
    flex-shrink: 0;
    height: 12px;
    width: 100%;
    cursor: grab;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 4px 4px 0 0;
    margin: -8px -8px 8px -8px;
    padding: 0;
}

#postit-notes-container .postit-note.expanded .postit-drag-handle {
    display: block;
}

#postit-notes-container .postit-note .postit-body {
    display: none;
    flex: 1;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}

#postit-notes-container .postit-note.expanded .postit-body {
    display: flex;
}

#postit-notes-container .postit-note textarea.postit-text {
    flex: 1;
    min-height: 80px;
    resize: none;
    border: 1px solid #e4d36f;
    border-radius: 4px;
    padding: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    background: #fffbeb;
}

#postit-notes-container .postit-note button.postit-ask-advisor {
    padding: 6px 10px;
    font-size: 0.85rem;
    background: #059669;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    align-self: flex-start;
}

#postit-notes-container .postit-note button.postit-ask-advisor:hover {
    background: #047857;
}

#postit-notes-container .postit-note button.postit-delete {
    padding: 6px 10px;
    font-size: 0.85rem;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    align-self: flex-start;
}

#postit-notes-container .postit-note button.postit-delete:hover {
    background: #dc2626;
}

/* Double-click tool menu */
.dblclick-tool-menu {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 140px;
}

.dblclick-tool-menu .tool-menu-option {
    padding: 8px 12px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #1e293b;
    transition: background-color 0.15s ease;
}

.dblclick-tool-menu .tool-menu-option:hover {
    background: #f1f5f9;
}

/* Highlighter mode cursor */
body.highlighter-mode,
body.highlighter-mode * {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M17.315 3.15c-.38 0-.7.22-.85.53l-2.34 4.65-1.27-1.27c-.2-.2-.45-.31-.73-.31s-.53.11-.73.31l-4 4c-.2.2-.31.45-.31.73s.11.53.31.73l1.27 1.27-4.65 2.34c-.31.15-.53.47-.53.85 0 .55.45 1 1 1h14c.55 0 1-.45 1-1V4.15c0-.55-.45-1-1-1zm-9.85 8.49l2.56-2.56 1.27 1.27-2.56 2.56-1.27-1.27zm8.85 4.36H8.5l3.15-3.15 1.27 1.27-3.15 3.15z" fill="%23FFD700" opacity="0.8"/></svg>') 0 16, text !important;
}

/* Page highlights */
.page-highlight {
    background-color: rgba(255, 255, 0, 0.4);
    padding: 0;
    border-radius: 2px;
}

/* Exit highlighter button */
.exit-highlighter-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10001;
    padding: 10px 16px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: background-color 0.15s ease, transform 0.1s ease;
}

.exit-highlighter-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.exit-highlighter-btn:active {
    transform: translateY(0);
}