:root {
    --primary: #0e7e94;
    --secondary: #0a6475;
    --accent: #14b8c4;
    --text-dark: #0b1120;
    --text-muted: #4b5563;
    --bg-white: #ffffff;
    --border: #e5e7eb;
    --shadow-sm: 0 2px 6px rgba(0,0,0,0.04);
    --shadow-md: 0 8px 20px rgba(0,0,0,0.06);
    --radius: 12px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.upwork-calc-container {
    font-family: var(--font);
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.calc-header {
    text-align: center;
    margin-bottom: 32px;
}
.calc-header h1 {
    color: var(--primary);
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 8px;
}
.calc-header p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Tabs */
.calc-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 32px;
    flex-wrap: wrap;
}
.tab-btn {
    background: transparent;
    border: none;
    padding: 10px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 10px 10px 0 0;
}
.tab-btn:hover {
    background: var(--primary);
    color: #ffffff;
    border-radius: 10px 10px 0 0;
    transform: translateY(-1px);
}
.tab-btn.active {
    color: var(--primary);
    background: rgba(14,126,148,0.08);
    border-bottom: 2px solid var(--accent);
    border-radius: 10px 10px 0 0;
}

/* Mode panels */
.mode-panel {
    display: none;
}
.mode-panel.active {
    display: block;
}

/* Grids */
.premium-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}
.premium-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-top: 16px;
}
.calc-grid, .compare-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

/* Cards */
.premium-card, .calc-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}
.premium-card:hover, .calc-card:hover {
    box-shadow: var(--shadow-md);
}
.card-header {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}
.card-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

/* Input Fields */
.input-field {
    margin-bottom: 18px;
}
.input-field label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
}
#hours-per-week, #duration-value, #duration-unit, #tax-rate,
#fixed-hours, #fixed-tax-rate,
#compA-hours, #compA-weeks, #compB-hours, #compB-weeks {
    margin-top: 4px;
}
.comparison-result p, .fixed-results p, .compare-grid .calc-card p {
    margin-top: 8px;
}
.compare-grid .calc-card p:first-of-type {
    margin-top: 12px;
}

.premium-input, .premium-select, .calc-input, .calc-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    background: var(--bg-white);
    transition: 0.2s;
}
.premium-input:focus, .premium-select:focus,
.calc-input:focus, .calc-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(20,184,196,0.2);
}
.duration-group {
    display: flex;
    gap: 10px;
}
.duration-number { flex: 2; }
.duration-unit { flex: 1; }

.input-hint {
    background: #e8f2f4;
    padding: 8px;
    text-align: center;
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 12px;
}

#custom-fee, #fixed-custom-fee {
    margin-top: 12px;
}

/* Results & Lists */
.result-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.result-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    padding: 6px 0;
    border-bottom: 1px dashed #f0f0f0;
}
.result-item.net {
    border-top: 2px solid var(--accent);
    margin-top: 6px;
    padding-top: 10px;
    font-weight: 700;
}
.result-value {
    font-weight: 600;
    color: var(--text-dark);
}
.fee-red, .tax-red {
    color: darkred !important;
    font-weight: 700;
}

/* Fixed Project tab specific colors */
#fixed-fee-amount, #fixed-tax-amount {
    color: #8b0000 !important;
    font-weight: 700;
}
#fixed-net {
    color: #2e7d32 !important;
    font-weight: 700;
}

/* Profit margin badge */
.profit-badge {
    margin-top: 16px;
    padding: 8px;
    text-align: center;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    background: #e8f2f4;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.profit-circle {
    display: inline-block;
    animation: blinkColor 0.8s infinite;
}
@keyframes blinkColor {
    0% { opacity: 1; }
    50% { opacity: 0.4; filter: brightness(1.2); }
    100% { opacity: 1; }
}

.net-profit-high { color: #2e7d32 !important; font-weight: 700; }
.net-profit-medium { color: #ed6c02 !important; font-weight: 700; }
.net-profit-low { color: #d32f2f !important; font-weight: 700; }

/* Goal Based Planning result background */
.goal-result {
    font-size: 1rem !important;
    line-height: 1.4;
    background: #e8f2f4;
    padding: 10px;
    border-radius: 8px;
}

.warning-msg {
    background: #fff3cd;
    border-left: 3px solid #ffc107;
    padding: 8px;
    font-size: 0.8rem;
    margin-top: 12px;
    border-radius: 6px;
}

/* Button group for Required Rate / Required Hours - centered, slightly larger */
.button-group {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 12px 0;
}
.button-group .premium-btn {
    display: inline-flex;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 6px;
}

/* General button style (kept for export buttons) */
.premium-btn {
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
}
.premium-btn.primary {
    background: var(--primary);
    color: white;
}
.premium-btn.primary:hover {
    background: var(--secondary);
}
.premium-btn.secondary {
    background: #e2e8f0;
    color: var(--text-dark);
}
.premium-btn.secondary:hover {
    background: #cbd5e1;
}

.info-text {
    background: #f1f5f9;
    padding: 8px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-top: 12px;
    color: var(--text-muted);
}
.dual-input {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Export buttons - larger size */
.export-section {
    text-align: center;
    margin-top: 40px;
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}
.export-section .premium-btn {
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    min-width: 160px;
}

.workload-level {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 1rem;
    font-weight: 600;
}

.fixed-results p, .comparison-result p {
    margin: 8px 0;
}

/* Responsive */
@media (max-width: 1024px) {
    .premium-grid, .premium-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .export-section .premium-btn {
        padding: 10px 24px;
        font-size: 0.95rem;
        min-width: 140px;
    }
}
@media (max-width: 768px) {
    .premium-grid, .premium-row, .premium-grid, .calc-grid, .compare-grid {
        grid-template-columns: 1fr;
    }
    .calc-tabs {
        justify-content: center;
    }
    .duration-group {
        flex-direction: column;
    }
    .export-section {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
    .export-section .premium-btn {
        width: 80%;
        max-width: 280px;
        padding: 12px 20px;
        font-size: 1rem;
    }
}