/* =========================================
   Wealth Calculator – Plugin Styles
   ========================================= */

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

:root {
    --wc-primary:   #1a3a2a;
    --wc-accent:    #c9a84c;
    --wc-bg:        #f7f5f0;
    --wc-card:      #ffffff;
    --wc-border:    #e2ddd4;
    --wc-text:      #2c2c2c;
    --wc-muted:     #7a7670;
    --wc-positive:  #2d7a4f;
    --wc-negative:  #a33a2a;
    --wc-radius:    12px;
    --wc-shadow:    0 4px 24px rgba(26,58,42,0.10);
    --wc-font-head: 'Cormorant Garamond', Georgia, serif;
    --wc-font-body: 'DM Sans', system-ui, sans-serif;
}

/* Wrapper */
.wc-wrapper {
    font-family: var(--wc-font-body);
    color: var(--wc-text);
    background: var(--wc-bg);
    border-radius: var(--wc-radius);
    overflow: hidden;
    box-shadow: var(--wc-shadow);
    max-width: 860px;
    margin: 2rem auto;
}

/* Header */
.wc-header {
    background: var(--wc-primary);
    color: #fff;
    padding: 2.5rem 2rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.wc-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 80% 20%, rgba(201,168,76,0.18) 0%, transparent 60%);
    pointer-events: none;
}
.wc-header-ornament {
    width: 40px;
    height: 3px;
    background: var(--wc-accent);
    margin: 0 auto 1rem;
    border-radius: 2px;
}
.wc-title {
    font-family: var(--wc-font-head);
    font-size: 2.2rem;
    font-weight: 600;
    margin: 0 0 0.4rem;
    letter-spacing: 0.02em;
    color: #fff;
    line-height: 1.2;
}
.wc-subtitle {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.6);
    margin: 0;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Body */
.wc-body {
    padding: 0 1.75rem 1.75rem;
    background: var(--wc-bg);
}

/* Tabs */
.wc-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--wc-border);
    margin: 0 -1.75rem 1.75rem;
    padding: 0 1.75rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.wc-tab {
    font-family: var(--wc-font-body);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--wc-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 1rem 1.2rem;
    cursor: pointer;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s;
}
.wc-tab:hover { color: var(--wc-primary); }
.wc-tab.active {
    color: var(--wc-primary);
    border-bottom-color: var(--wc-accent);
    font-weight: 600;
}

/* Panels */
.wc-panel { display: none; }
.wc-panel.active { display: block; }

/* Section label */
.wc-section-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--wc-muted);
    margin: 1.5rem 0 0.75rem;
}
.wc-section-label:first-child { margin-top: 0; }

/* Grid */
.wc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.9rem;
    margin-bottom: 0.5rem;
}

/* Fields */
.wc-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.wc-field label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--wc-muted);
    letter-spacing: 0.01em;
}
.wc-input-wrap {
    display: flex;
    align-items: center;
    background: var(--wc-card);
    border: 1.5px solid var(--wc-border);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.wc-input-wrap:focus-within {
    border-color: var(--wc-accent);
    box-shadow: 0 0 0 3px rgba(201,168,76,0.12);
}
.wc-currency-symbol {
    font-size: 0.85rem;
    color: var(--wc-muted);
    padding: 0 0.6rem;
    border-right: 1.5px solid var(--wc-border);
    background: #f9f7f4;
    height: 100%;
    display: flex;
    align-items: center;
    min-width: 32px;
    justify-content: center;
    user-select: none;
}
.wc-input {
    border: none;
    outline: none;
    padding: 0.6rem 0.7rem;
    font-family: var(--wc-font-body);
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--wc-text);
    background: transparent;
    width: 100%;
    min-width: 0;
}
.wc-input::-webkit-inner-spin-button,
.wc-input::-webkit-outer-spin-button { opacity: 0.4; }

/* Result card */
.wc-result-card {
    background: var(--wc-card);
    border: 1.5px solid var(--wc-border);
    border-radius: var(--wc-radius);
    padding: 1.25rem 1.5rem;
    margin-top: 1.5rem;
    box-shadow: 0 2px 12px rgba(26,58,42,0.06);
}
.wc-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0;
}
.wc-result-row.highlight {
    padding: 0.6rem 0 0.3rem;
}
.wc-result-label {
    font-size: 0.85rem;
    color: var(--wc-muted);
    font-weight: 400;
}
.wc-result-row.highlight .wc-result-label {
    font-size: 0.92rem;
    color: var(--wc-text);
    font-weight: 600;
}
.wc-result-value {
    font-family: var(--wc-font-head);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--wc-text);
}
.wc-result-value.positive { color: var(--wc-positive); }
.wc-result-value.negative { color: var(--wc-negative); }
.wc-result-value.accent {
    font-size: 1.5rem;
    color: var(--wc-accent);
}
.wc-divider {
    border: none;
    border-top: 1.5px solid var(--wc-border);
    margin: 0.5rem 0;
}

/* Health bar */
.wc-health-bar-wrap {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.wc-health-label {
    font-size: 0.75rem;
    color: var(--wc-muted);
    white-space: nowrap;
}
.wc-health-bar {
    flex: 1;
    min-width: 80px;
    height: 6px;
    background: var(--wc-border);
    border-radius: 99px;
    overflow: hidden;
}
.wc-health-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--wc-accent), var(--wc-positive));
    border-radius: 99px;
    transition: width 0.4s ease;
    width: 61%;
}
.wc-health-pct {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--wc-primary);
    min-width: 36px;
}

/* Status badge */
.wc-status-badge {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.35rem 1rem;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
    background: #e8f5ee;
    color: var(--wc-positive);
    letter-spacing: 0.03em;
}
.wc-status-badge.bad {
    background: #fbeae7;
    color: var(--wc-negative);
}

/* Projection table */
.wc-projection-table-wrap { margin-top: 1.25rem; }
.wc-table-scroll {
    overflow-x: auto;
    border-radius: 8px;
    border: 1.5px solid var(--wc-border);
}
.wc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.wc-table thead th {
    background: var(--wc-primary);
    color: rgba(255,255,255,0.85);
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.72rem;
    padding: 0.6rem 1rem;
    text-align: right;
}
.wc-table thead th:first-child { text-align: left; }
.wc-table tbody td {
    padding: 0.5rem 1rem;
    text-align: right;
    border-bottom: 1px solid var(--wc-border);
    font-family: var(--wc-font-body);
    font-size: 0.84rem;
    color: var(--wc-text);
}
.wc-table tbody td:first-child { text-align: left; font-weight: 500; }
.wc-table tbody tr:last-child td { border-bottom: none; }
.wc-table tbody tr:nth-child(even) td { background: #faf8f5; }
.wc-table tbody tr.wc-milestone td { color: var(--wc-accent); font-weight: 600; }

/* Disclaimer */
.wc-disclaimer {
    padding: 1rem 1.75rem;
    background: #f0ede7;
    border-top: 1px solid var(--wc-border);
}
.wc-disclaimer p {
    font-size: 0.73rem;
    color: var(--wc-muted);
    margin: 0;
    line-height: 1.6;
}

/* =========================================
   MOBILE – Vertical stacked tabs
   ========================================= */
@media (max-width: 600px) {

    /* Header */
    .wc-header { padding: 1.75rem 1.25rem 1.5rem; }
    .wc-title  { font-size: 1.55rem; }

    /* Body */
    .wc-body { padding: 0; }

    /* Tabs become full-width vertical pill buttons */
    .wc-tabs {
        flex-direction: column;
        gap: 0;
        border-bottom: none;
        margin: 0;
        padding: 1rem 1rem 0;
        background: var(--wc-bg);
        overflow: visible;
    }
    .wc-tab {
        width: 100%;
        text-align: left;
        border: 1.5px solid var(--wc-border);
        border-radius: 10px;
        margin-bottom: 0.5rem;
        padding: 0.9rem 1.1rem;
        background: #fff;
        font-size: 0.88rem;
        letter-spacing: 0.04em;
        display: flex;
        align-items: center;
        gap: 0.6rem;
        border-bottom-width: 1.5px; /* reset desktop override */
        margin-bottom-value: 0;
    }
    .wc-tab::before {
        content: '';
        display: inline-block;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--wc-border);
        flex-shrink: 0;
        transition: background 0.2s;
    }
    .wc-tab.active {
        background: var(--wc-primary);
        color: #fff;
        border-color: var(--wc-primary);
        font-weight: 600;
    }
    .wc-tab.active::before {
        background: var(--wc-accent);
    }

    /* Panels sit inside padded content area */
    .wc-panel {
        display: none;
        padding: 1.25rem 1rem 1rem;
    }
    .wc-panel.active { display: block; }

    /* Grid: 2-col on medium mobile, 1-col on small */
    .wc-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; }

    /* Results */
    .wc-result-value.accent { font-size: 1.25rem; }
    .wc-result-card { padding: 1rem 1.1rem; }

    /* Disclaimer */
    .wc-disclaimer { padding: 1rem; }

    /* Section label spacing */
    .wc-section-label { margin-top: 1.1rem; }
}

@media (max-width: 380px) {
    .wc-grid { grid-template-columns: 1fr; }
    .wc-tab { font-size: 0.82rem; }
}
