/* 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: 48px;
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

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

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

.text-input {
    background-color: #141414;
    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;
}

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

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

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

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

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

.mode-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mode-tab {
    background-color: #1a1a1a;
    border: 1px solid #2a2a2a;
    color: #9ca3af;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 150ms ease;
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
}

.mode-fields {
    display: none;
    flex-direction: column;
    gap: 16px;
}

.mode-fields.active {
    display: flex;
}

.radio-group {
    display: flex;
    gap: 24px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #e5e7eb;
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 18px;
    height: 18px;
    background-color: #141414;
    border: 2px solid #374151;
    border-radius: 50%;
    position: relative;
    transition: all 150ms ease;
    flex-shrink: 0;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    border-color: #3b82f6;
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 8px;
    height: 8px;
    background-color: #3b82f6;
    border-radius: 50%;
}

.action-buttons {
    display: flex;
    gap: 12px;
}

.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;
}

.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;
}

.button-danger {
    background-color: #7f1d1d;
    border-color: #dc2626;
    color: #fca5a5;
}

.button-danger:hover {
    background-color: #991b1b;
}

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

.result-card {
    background-color: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    padding: 32px 24px;
    text-align: center;
}

.result-label {
    font-size: 14px;
    font-weight: 500;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.result-value {
    font-size: 48px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.1;
    word-break: break-all;
}

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

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

.result-subtitle {
    font-size: 14px;
    font-weight: 400;
    color: #9ca3af;
    margin-top: 8px;
}

.result-subtitle.increase {
    color: #22c55e;
}

.result-subtitle.decrease {
    color: #ef4444;
}

.formula-section {
    background-color: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 20px;
}

.formula-title {
    font-size: 14px;
    font-weight: 500;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.formula-steps {
    font-family: 'SF Mono', 'Fira Code', 'Fira Mono', Menlo, Consolas, monospace;
    font-size: 14px;
    line-height: 2;
    color: #a0a0a0;
}

.formula-step {
    padding: 2px 0;
}

.formula-step.result {
    color: #e5e7eb;
    font-weight: 600;
}

.copy-actions {
    display: flex;
}

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

.pro-feature-block {
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 8px;
    overflow: hidden;
}

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

.pro-feature-header h3 {
    font-size: 16px;
    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-feature-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pro-feature-block.locked .pro-feature-body {
    opacity: 0.5;
    pointer-events: none;
}

.compound-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.compound-summary .stat-item {
    flex: 1 1 calc(33.333% - 8px);
    min-width: 120px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
    padding: 12px;
    background-color: #1a1a1a;
    border-radius: 6px;
}

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

.stat-value {
    font-size: 16px;
    font-weight: 600;
    color: #e5e7eb;
}

.stat-value.increase {
    color: #22c55e;
}

.stat-value.decrease {
    color: #ef4444;
}

.compound-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

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

.compound-table th {
    text-align: left;
    padding: 10px 12px;
    font-weight: 500;
    color: #9ca3af;
    border-bottom: 1px solid #2a2a2a;
    white-space: nowrap;
}

.compound-table td {
    padding: 10px 12px;
    color: #e5e7eb;
    border-bottom: 1px solid #1a1a1a;
}

.compound-table tbody tr:nth-child(odd) {
    background-color: #141414;
}

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

.compound-table td.gain-positive {
    color: #22c55e;
}

.compound-table td.gain-negative {
    color: #ef4444;
}

.allocation-bar-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.allocation-bar {
    width: 100%;
    height: 8px;
    background-color: #2a2a2a;
    border-radius: 4px;
    overflow: hidden;
}

.allocation-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 300ms ease, background-color 300ms ease;
    width: 0%;
}

.allocation-fill.exact {
    background-color: #22c55e;
}

.allocation-fill.over {
    background-color: #ef4444;
}

.allocation-label {
    font-size: 12px;
    font-weight: 500;
    color: #9ca3af;
}

.allocation-label.exact {
    color: #22c55e;
}

.allocation-label.over {
    color: #ef4444;
}

.share-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.share-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background-color: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
}

.share-row .text-input {
    background-color: #141414;
}

.share-name-input {
    flex: 2;
    min-width: 0;
}

.share-percent-input {
    flex: 1;
    min-width: 80px;
}

.share-value-display {
    flex: 1;
    min-width: 80px;
    font-size: 14px;
    font-weight: 600;
    color: #e5e7eb;
    text-align: right;
}

.share-remove {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    transition: color 150ms ease;
    flex-shrink: 0;
}

.share-remove:hover {
    color: #ef4444;
}

.distribution-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

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

.distribution-table th {
    text-align: left;
    padding: 10px 12px;
    font-weight: 500;
    color: #9ca3af;
    border-bottom: 1px solid #2a2a2a;
    white-space: nowrap;
}

.distribution-table td {
    padding: 10px 12px;
    color: #e5e7eb;
    border-bottom: 1px solid #1a1a1a;
}

.distribution-table tbody tr:nth-child(odd) {
    background-color: #141414;
}

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

.reverse-results .result-card {
    border: 1px solid #2a2a2a;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.history-empty {
    font-size: 14px;
    color: #6b7280;
    text-align: center;
    padding: 24px;
}

.history-entry {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 16px;
    background-color: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-left: 3px solid #3b82f6;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 150ms ease;
}

.history-entry:hover {
    background-color: #2a2a2a;
}

.history-entry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.history-entry-mode {
    font-size: 12px;
    font-weight: 500;
    color: #3b82f6;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.history-entry-date {
    font-size: 12px;
    color: #6b7280;
}

.history-entry-summary {
    font-size: 14px;
    color: #e5e7eb;
}

.history-entry-result {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.history-entry-actions {
    display: flex;
    justify-content: flex-end;
}

.history-delete {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 12px;
    padding: 4px 8px;
    transition: color 150ms ease;
}

.history-delete:hover {
    color: #ef4444;
}

.history-date-group {
    margin-top: 8px;
}

.history-date-label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 8px;
}

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

.pro-cta-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.pro-cta-text {
    font-size: 14px;
    color: #d1d5db;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 24px;
}

.modal-overlay.modal-hidden {
    display: none;
}

.modal-overlay.modal-visible {
    display: flex;
}

.modal {
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 12px;
    padding: 0;
    max-width: 480px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 24px 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 22px;
    font-weight: 600;
    color: #ffffff;
}

.modal-close {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #e5e7eb;
}

.modal-content {
    padding: 24px;
}

.modal-content p {
    font-size: 14px;
    color: #9ca3af;
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.pro-features-list {
    margin-bottom: 24px;
}

.pro-feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
}

.feature-check {
    width: 20px;
    height: 20px;
    background-color: #059669;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.feature-text {
    font-size: 15px;
    color: #e5e7eb;
}

.modal-cta {
    width: 100%;
    display: block;
}

.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;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: opacity 300ms ease, transform 300ms ease;
}

.toast.toast-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.toast-hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(8px);
    pointer-events: none;
}

.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: 32px;
    }

    .mode-selector {
        gap: 6px;
    }

    .mode-tab {
        padding: 8px 12px;
        font-size: 12px;
        flex: 1 1 calc(50% - 3px);
    }

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

    .action-buttons {
        flex-direction: column;
    }

    .button-primary,
    .button-secondary {
        width: 100%;
    }

    .compound-summary .stat-item {
        flex: 1 1 100%;
    }

    .share-row {
        flex-wrap: wrap;
    }

    .share-name-input {
        flex: 1 1 100%;
    }

    .share-percent-input {
        flex: 1;
    }

    .share-value-display {
        flex: 1;
        text-align: left;
    }

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

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

    .output-section {
        padding: 16px;
    }

    .result-card {
        padding: 24px 16px;
    }

    .formula-section {
        padding: 16px;
    }

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

        padding: 0 16px;
    }

    .pro-cta-content {
        flex-direction: column;
        gap: 10px;
    }
}

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

    .radio-group {
        flex-direction: column;
        gap: 12px;
    }

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