/* Tool-specific styles only - base styles are in tool-layout.css */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #0a0a0a;
    color: #e5e7eb;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #141414;
    border-bottom: 1px solid #374151;
    z-index: 100;
}

    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

    margin-top: 60px;
    padding: 48px 24px;
    text-align: center;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    max-width: 720px;
    margin: 0 auto;
}

.tool-main {
    flex: 1;
    padding: 32px 24px 120px;
}

.tool-container {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 8px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group > label {
    font-size: 14px;
    font-weight: 500;
    color: #e5e7eb;
}

.input-hint {
    font-size: 12px;
    color: #6b7280;
    margin-top: -4px;
}

.core-inputs {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.text-input {
    background-color: #1a1a1a;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    width: 100%;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.text-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.text-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.text-input::placeholder {
    color: #6b7280;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

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

.input-prefix {
    position: absolute;
    left: 16px;
    font-size: 15px;
    font-weight: 500;
    color: #6b7280;
    z-index: 1;
    pointer-events: none;
}

.input-with-prefix .text-input {
    padding-left: 36px;
}

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

.input-suffix {
    position: absolute;
    right: 16px;
    font-size: 15px;
    font-weight: 500;
    color: #6b7280;
    z-index: 1;
    pointer-events: none;
}

.input-with-suffix .text-input {
    padding-right: 36px;
}

.select-input {
    background-color: #1a1a1a;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.select-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.select-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.select-input option {
    background-color: #1a1a1a;
}

.currency-group {
    padding-bottom: 16px;
    border-bottom: 1px solid #2a2a2a;
}

.button-primary {
    background-color: #3b82f6;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: background-color 150ms ease;
    text-align: center;
    width: 100%;
}

.button-secondary {
    background-color: #1a1a1a;
    color: #e5e7eb;
    border: 1px solid #374151;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 150ms ease;
    text-align: center;
}

.output-section {
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.output-header h3 {
    font-size: 22px;
    font-weight: 600;
    line-height: 28px;
    color: #d1d5db;
}

.results-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.results-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.result-item {
    flex: 1 1 calc(50% - 6px);
    min-width: 140px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    background-color: #1a1a1a;
    border-radius: 6px;
    text-align: center;
}

.result-item.highlight {
    background-color: #1e3a5f;
    border: 1px solid #3b82f6;
}

.result-label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-value {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
}

.result-sub {
    font-size: 12px;
    color: #9ca3af;
}

.result-value.positive {
    color: #22c55e;
}

.result-value.negative {
    color: #ef4444;
}

.result-value.neutral {
    color: #f59e0b;
}

.results-error {
    background-color: #7f1d1d;
    border: 1px solid #dc2626;
    color: #fca5a5;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
}

.chart-container {
    background-color: #1a1a1a;
    border-radius: 8px;
    padding: 16px;
    position: relative;
}

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

.profit-calculator {
    background-color: #1a1a1a;
    border-radius: 8px;
    padding: 16px;
}

.profit-calculator h4 {
    font-size: 14px;
    font-weight: 600;
    color: #d1d5db;
    margin-bottom: 12px;
}

.profit-calc-row {
    display: flex;
    align-items: flex-end;
    gap: 16px;
}

.profit-calc-row .input-group {
    flex: 1;
}

.profit-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 16px;
    background-color: #141414;
    border-radius: 6px;
    min-width: 140px;
}

.profit-label {
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
}

.profit-value {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
}

.profit-value.positive {
    color: #22c55e;
}

.profit-value.negative {
    color: #ef4444;
}

.result-actions {
    display: flex;
    gap: 12px;
}

.result-actions .button-secondary {
    flex: 1;
}

.pro-section {
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 8px;
    overflow: hidden;
    opacity: 0.7;
    transition: opacity 150ms ease;
}

.pro-section:hover {
    opacity: 0.85;
}

.pro-section.unlocked {
    opacity: 1;
}

.pro-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #2a2a2a;
}

.pro-section-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #d1d5db;
}

.pro-badge {
    color: #0a0a0a;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

.pro-section-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pro-section-desc {
    font-size: 14px;
    color: #9ca3af;
}

.sensitivity-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.sensitivity-controls .input-group {
    flex: 1;
    min-width: 140px;
}

.sensitivity-controls .button-secondary {
    height: 44px;
}

.sensitivity-results {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid #2a2a2a;
}

.sensitivity-table-wrapper {
    overflow-x: auto;
}

.sensitivity-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.sensitivity-table th {
    text-align: left;
    padding: 10px 8px;
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #374151;
    white-space: nowrap;
}

.sensitivity-table td {
    padding: 8px;
    color: #e5e7eb;
    border-bottom: 1px solid #2a2a2a;
    white-space: nowrap;
}

.sensitivity-table tbody tr:nth-child(even) {
    background-color: #1a1a1a;
}

.sensitivity-table tbody tr.baseline {
    background-color: #1e3a5f;
    font-weight: 600;
}

.sensitivity-table .change-positive {
    color: #22c55e;
}

.sensitivity-table .change-negative {
    color: #ef4444;
}

.scenario-add-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.scenario-add-row .input-group {
    flex: 1;
    min-width: 120px;
}

.scenario-add-row .button-secondary {
    height: 44px;
}

.scenario-table-wrapper {
    overflow-x: auto;
    margin-top: 16px;
}

.scenario-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.scenario-table th {
    text-align: left;
    padding: 10px 8px;
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #374151;
    white-space: nowrap;
}

.scenario-table td {
    padding: 8px;
    color: #e5e7eb;
    border-bottom: 1px solid #2a2a2a;
    white-space: nowrap;
}

.scenario-table tbody tr:nth-child(even) {
    background-color: #1a1a1a;
}

.scenario-table tbody tr:hover {
    background-color: #1e1e1e;
}

.scenario-table .best-performer {
    color: #22c55e;
    font-weight: 600;
}

.scenario-table .worst-performer {
    color: #ef4444;
    font-weight: 600;
}

.scenario-table .remove-btn {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    transition: color 150ms ease;
}

.scenario-table .remove-btn:hover {
    color: #ef4444;
}

.target-profit-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.target-profit-row .input-group {
    flex: 1;
}

.target-profit-row .button-secondary {
    height: 44px;
}

.target-profit-results {
    padding-top: 16px;
    border-top: 1px solid #2a2a2a;
}

.export-actions {
    display: flex;
    gap: 12px;
}

.export-actions .button-secondary {
    flex: 1;
}

.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1a1a1a;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 300;
    animation: toastIn 200ms ease;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.footer {
    background-color: #0a0a0a;
    border-top: 1px solid #374151;
    padding: 32px 24px;
    text-align: center;
    margin-top: auto;
}

.footer p {
    font-size: 14px;
    color: #6b7280;
}

@media (max-width: 768px) {
        padding: 32px 16px;
    }

        font-size: 28px;
        line-height: 36px;
    }

        font-size: 14px;
    }

    .tool-main {
        padding: 24px 16px 100px;
    }

    .tool-container {
        gap: 12px;
    }

    .input-section {
        padding: 16px;
    }

    .output-section {
        padding: 16px;
    }

    .result-item {
        flex: 1 1 calc(50% - 6px);
    }

    .result-value {
        font-size: 20px;
    }

    .result-actions {
        flex-direction: column;
    }

    .profit-calc-row {
        flex-direction: column;
        align-items: stretch;
    }

    .profit-result {
        flex-direction: row;
        justify-content: space-between;
    }

    .pro-section-header {
        padding: 16px;
    }

    .pro-section-body {
        padding: 16px;
    }

    .sensitivity-controls {
        flex-direction: column;
    }

    .sensitivity-controls .input-group {
        width: 100%;
    }

    .scenario-add-row {
        flex-direction: column;
    }

    .scenario-add-row .input-group {
        width: 100%;
    }

    .target-profit-row {
        flex-direction: column;
    }

    .export-actions {
        flex-direction: column;
    }

        padding: 0 16px;
    }

    .sensitivity-table,
    .scenario-table {
        font-size: 11px;
    }

    .sensitivity-table th,
    .sensitivity-table td,
    .scenario-table th,
    .scenario-table td {
        padding: 6px 4px;
    }
}

@media (max-width: 480px) {
    .result-item {
        flex: 1 1 100%;
    }
}