@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    --bg-base: #eef5f2; /* Soft pale celadon green background, extremely relaxing on the eyes */
    --bg-surface: #ffffff; /* Pure white cards */
    --bg-surface-hover: #f5fbf7;
    --border-color: #d1e2da; /* Soft sage green border */
    --border-focus: #10b981; /* Soft green focus highlight */
    
    /* Branding & Semantic Colors (styled for light background contrast) */
    --color-oracle: #e11d48; /* Crimson accent */
    --color-oracle-glow: rgba(225, 29, 72, 0.08);
    --color-primary: #2563eb; /* Trust Blue for MSFT */
    --color-success: #dc2626; /* Profit Red (Chinese Stock Style) */
    --color-danger: #15803d; /* Pullback/Support Green */
    --color-warning: #b45309; /* Wealth Gold */
    
    /* Text Colors - Dark colors for high readability on light background */
    --text-primary: #1e293b; /* Deep slate gray */
    --text-secondary: #475569; /* Slate gray */
    --text-muted: #64748b; /* Muted gray */
    
    /* Fonts */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(at 0% 0%, rgba(16, 185, 129, 0.08) 0px, transparent 50%), /* Soft celadon glow */
        radial-gradient(at 100% 0%, rgba(245, 158, 11, 0.05) 0px, transparent 50%), /* Soft gold glow */
        radial-gradient(at 50% 100%, rgba(16, 185, 129, 0.06) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    min-height: 100vh;
    padding: 2rem 1rem;
    -webkit-font-smoothing: antialiased;
}

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

/* Header Section */
header {
    margin-bottom: 2.5rem;
    text-align: center;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(225, 29, 72, 0.06);
    border: 1px solid rgba(225, 29, 72, 0.15);
    color: var(--color-oracle);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

h1 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 2.5rem;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #1e293b 30%, #475569 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Grid Layout */
.grid-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (min-width: 1024px) {
    .grid-layout {
        grid-template-columns: 380px 1fr;
    }
}

/* Glassmorphism Card Style */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    border-color: #b5d1c4;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    color: var(--text-primary);
}

/* Form Controls */
.form-group {
    margin-bottom: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

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

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
}

.input-suffix {
    position: absolute;
    right: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
}

input[type="number"], select {
    width: 100%;
    background: #fafdfc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.has-prefix input {
    padding-left: 2rem;
}

.has-suffix input {
    padding-right: 2.5rem;
}

input[type="number"]:focus, select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* Strategy Tabs */
.strategy-tabs {
    display: flex;
    background: #f0f5f3;
    padding: 0.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.6rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.tab-btn.active {
    background: var(--color-oracle);
    color: white;
    box-shadow: 0 2px 8px rgba(225, 29, 72, 0.2);
}

/* Summary metrics cards */
.metric-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.metric-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.metric-card.loss::before { background-color: var(--color-danger); }
.metric-card.breakeven::before { background-color: var(--color-warning); }
.metric-card.profit::before { background-color: var(--color-success); }
.metric-card.oracle::before { background-color: var(--color-oracle); }

.metric-value {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 0.25rem;
    letter-spacing: -0.01em;
}

.metric-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.metric-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Visualization Panel */
.visuals-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 1200px) {
    .visuals-container {
        grid-template-columns: 1.3fr 1fr;
    }
}

.chart-wrapper {
    position: relative;
    height: 320px;
    width: 100%;
}

/* Table Style for Build Schedule */
.schedule-table-wrapper {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 0.75rem;
    background: #fafdfc;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    text-align: left;
}

th {
    background: #f1f7f4;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
}

td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e8f3ee;
    color: var(--text-primary);
}

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

.text-danger { color: var(--color-danger); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }

/* Custom Action Button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    background: var(--color-oracle);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.85rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(225, 29, 72, 0.15);
}

.btn:hover {
    background: #f43f5e;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(225, 29, 72, 0.25);
}

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

.strategy-description {
    background: #fcfefe;
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

/* Interactive Slider Style */
.slider-group {
    margin-top: 1rem;
}
.slider-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}
input[type="range"] {
    width: 100%;
    height: 6px;
    background: #e2ede8;
    border-radius: 5px;
    outline: none;
    -webkit-appearance: none;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-oracle);
    cursor: pointer;
    box-shadow: 0 0 5px rgba(225, 29, 72, 0.3);
    transition: all 0.15s ease;
}
input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Custom Alert/Note Box */
.alert-box {
    background: rgba(37, 99, 235, 0.03);
    border: 1px solid rgba(37, 99, 235, 0.15);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    gap: 0.75rem;
}
.alert-box svg {
    flex-shrink: 0;
    color: var(--color-primary);
}
.alert-box-content strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.25rem;
}

/* Profit Threshold Indicators */
.threshold-item {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid #e8f3ee;
}
.threshold-item:last-child {
    border-bottom: none;
}
.threshold-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.threshold-val {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
}

/* Navigation Tabs Styling */
.nav-tabs {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.25rem;
    overflow-x: auto;
}

.nav-tab {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.75rem 1.25rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-tab:hover {
    color: var(--text-primary);
}

.nav-tab.active {
    color: var(--color-oracle);
}

.nav-tab.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--color-oracle);
    border-radius: 3px;
}

#tab-btn-msft.active {
    color: var(--color-primary);
}
#tab-btn-msft.active::after {
    background-color: var(--color-primary);
}

#tab-btn-soxx.active {
    color: var(--color-warning);
}
#tab-btn-soxx.active::after {
    background-color: var(--color-warning);
}

#tab-btn-spy.active {
    color: var(--color-success);
}
#tab-btn-spy.active::after {
    background-color: var(--color-success);
}

/* Portfolio Overview styles */
.overview-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .overview-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1200px) {
    .overview-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.overview-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.overview-card:hover {
    border-color: #b5d1c4;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -2px rgba(0,0,0,0.05);
}

.overview-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.ticker-badge {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
}

.ticker-badge.orcl { color: var(--color-oracle); border-color: rgba(225, 29, 72, 0.3); background: rgba(225, 29, 72, 0.05); }
.ticker-badge.msft { color: var(--color-primary); border-color: rgba(37, 99, 235, 0.3); background: rgba(37, 99, 235, 0.05); }
.ticker-badge.soxx { color: var(--color-warning); border-color: rgba(180, 83, 9, 0.3); background: rgba(180, 83, 9, 0.05); }
.ticker-badge.spy { color: var(--color-success); border-color: rgba(220, 38, 38, 0.3); background: rgba(220, 38, 38, 0.05); }

.overview-card-body .price-row {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.overview-card-footer {
    border-top: 1px solid #e8f3ee;
    padding-top: 0.75rem;
    margin-top: 0.75rem;
}

/* Portfolio Summary Panel layout */
.portfolio-summary-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (min-width: 1024px) {
    .portfolio-summary-panel {
        grid-template-columns: 1fr 380px;
    }
}

/* Refactored Classes styling */
.allocation-chart-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.card-tip-box {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 1.25rem;
    line-height: 1.5;
    background: #f1f7f4;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.active-asset-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #fafdfc;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.loss-conversion-box {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: #fafdfc;
    padding: 0.75rem;
    border-radius: 8px;
    margin-top: 0.5rem;
    border: 1px solid var(--border-color);
}

.btn-secondary {
    background: #fafdfc;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    box-shadow: none;
    padding: 0.5rem;
    margin-bottom: 1rem;
}

.btn-secondary:hover {
    background: #f1f7f4;
    border-color: #b5d1c4;
    box-shadow: none;
    transform: translateY(-1px);
}

.net-profit-row {
    border-bottom: none !important;
    font-weight: bold;
    background: #fcfefe;
    padding: 0.5rem;
    border-radius: 4px;
    margin-top: 0.25rem;
    border: 1px solid var(--border-color) !important;
}

.active-plan-btn {
    background: var(--color-oracle) !important;
    color: white !important;
    border-color: var(--color-oracle) !important;
    box-shadow: 0 4px 10px rgba(225, 29, 72, 0.2) !important;
}

/* Overview Stock Grouping Card & Mini Metrics */
.overview-stock-group {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04);
}

.overview-stock-group:hover {
    border-color: #b5d1c4;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -2px rgba(0,0,0,0.05);
}

.overview-stock-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.overview-stock-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    background: #f1f7f4;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-secondary);
}
