/* 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-prefix {
    position: relative;
    display: flex;
    align-items: center;
}

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

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

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

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

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

.input-error {
    font-size: 13px;
    color: #ef4444;
}

.segmented-control {
    display: flex;
    background-color: #1a1a1a;
    border: 1px solid #374151;
    border-radius: 8px;
    overflow: hidden;
}

.segment {
    flex: 1;
    padding: 10px 16px;
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 150ms ease, color 150ms ease;
    text-align: center;
}

.segment:hover {
    color: #e5e7eb;
}

.segment.active {
    background-color: #646cff;
    color: #ffffff;
}

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

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

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

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

label.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 6px;
    width: 4px;
    height: 8px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.button-row {
    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;
}

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

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.stats-grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
    padding: 20px 16px;
    background-color: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    transition: border-color 150ms ease;
}

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

.stat-card-value {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.stat-highlight {
    color: #10b981;
}

.breakdown-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.breakdown-title {
    font-size: 16px;
    font-weight: 600;
    color: #d1d5db;
}

.breakdown-list {
    display: flex;
    flex-direction: column;
}

.breakdown-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dashed #2a2a2a;
}

.breakdown-line:last-child {
    border-bottom: none;
    padding-top: 12px;
    margin-top: 4px;
    border-top: 1px solid #374151;
}

.breakdown-label {
    font-size: 14px;
    color: #9ca3af;
}

.breakdown-value {
    font-size: 14px;
    font-weight: 600;
    color: #e5e7eb;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.breakdown-value.discount {
    color: #ef4444;
}

.breakdown-value.tax {
    color: #fbbf24;
}

.breakdown-value.final {
    color: #ffffff;
    font-size: 16px;
}

.copy-action {
    display: flex;
}

.discount-note {
    background-color: #1a1a1a;
    border: 1px solid #374151;
    border-left: 3px solid #fbbf24;
    padding: 12px 16px;
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    color: #d1d5db;
}

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

.pro-feature-block {
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    opacity: 0.6;
    transition: opacity 150ms ease;
}

.pro-feature-block.unlocked {
    opacity: 1;
}

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

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

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

.pro-feature-desc {
    font-size: 14px;
    color: #9ca3af;
    line-height: 1.5;
}

.stacked-discounts-content,
.bulk-pricing-content,
.reverse-discount-content,
.compare-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.stacked-layer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background-color: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    transition: border-color 150ms ease;
}

.stacked-layer:hover {
    border-color: #374151;
}

.layer-number {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #141414;
    border-radius: 4px;
    flex-shrink: 0;
}

.layer-label-input {
    background-color: #141414;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    flex: 1;
    min-width: 0;
    transition: border-color 150ms ease;
}

.layer-label-input:focus {
    border-color: #3b82f6;
}

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

.layer-percent-input {
    background-color: #141414;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    width: 70px;
    text-align: right;
    transition: border-color 150ms ease;
    -moz-appearance: textfield;
}

.layer-percent-input::-webkit-inner-spin-button,
.layer-percent-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.layer-percent-input:focus {
    border-color: #3b82f6;
}

.layer-percent-suffix {
    font-size: 13px;
    color: #6b7280;
    margin-left: -4px;
}

.layer-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.layer-btn {
    background: none;
    border: 1px solid #374151;
    color: #6b7280;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 150ms ease;
    font-family: inherit;
}

.layer-btn:hover {
    border-color: #6b7280;
    color: #e5e7eb;
}

.layer-btn.remove:hover {
    border-color: #ef4444;
    color: #ef4444;
}

.stacked-layer + .stacked-layer::before {
    display: none;
}

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

.stacked-results h4 {
    font-size: 14px;
    font-weight: 600;
    color: #d1d5db;
}

.stacked-breakdown {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stacked-step {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background-color: #1a1a1a;
    border-radius: 4px;
    font-size: 13px;
}

.stacked-step-label {
    color: #9ca3af;
}

.stacked-step-value {
    color: #e5e7eb;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.stacked-step-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px 0;
    color: #374151;
    font-size: 12px;
}

.stacked-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background-color: #1a1a1a;
    border: 1px solid #646cff;
    border-radius: 6px;
    font-size: 14px;
}

.stacked-summary-label {
    color: #d1d5db;
    font-weight: 500;
}

.stacked-summary-value {
    color: #10b981;
    font-weight: 700;
    font-size: 16px;
}

.tier-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

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

.tier-table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #374151;
}

.tier-table td {
    padding: 10px 12px;
    color: #e5e7eb;
    border-bottom: 1px solid #2a2a2a;
}

.tier-table tbody tr {
    transition: background-color 150ms ease;
}

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

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

.tier-table tbody tr.active-tier {
    border-left: 3px solid #646cff;
    background-color: rgba(100, 108, 255, 0.08);
}

.tier-table td input {
    background-color: #0a0a0a;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    width: 80px;
    transition: border-color 150ms ease;
    -moz-appearance: textfield;
}

.tier-table td input::-webkit-inner-spin-button,
.tier-table td input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.tier-table td input:focus {
    border-color: #3b82f6;
}

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

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

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

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

.reverse-result {
    padding-top: 16px;
    border-top: 1px solid #2a2a2a;
}

.compare-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

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

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

.compare-table td {
    padding: 10px 12px;
    color: #e5e7eb;
    border-bottom: 1px solid #2a2a2a;
}

.compare-table tbody tr {
    transition: background-color 150ms ease;
}

.compare-table td input {
    background-color: #0a0a0a;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    width: 90px;
    transition: border-color 150ms ease;
    -moz-appearance: textfield;
}

.compare-table td input::-webkit-inner-spin-button,
.compare-table td input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.compare-table td input:focus {
    border-color: #3b82f6;
}

.compare-table td .store-name-input {
    width: 100px;
}

.compare-rank {
    font-size: 14px;
    font-weight: 700;
    color: #6b7280;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #1a1a1a;
    border-radius: 50%;
}

.compare-rank.rank-1 {
    color: #10b981;
    background-color: rgba(16, 185, 129, 0.1);
}

.best-price-badge {
    display: inline-block;
    background-color: #22c55e;
    color: #0a0a0a;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    white-space: nowrap;
}

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

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

.compare-final-price {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.compare-savings-diff {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 2px;
}

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

.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 8px 32px rgba(0, 0, 0, 0.4);
    animation: toast-in 200ms ease;
}

@keyframes toast-in {
    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;
}

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

.success-message {
    background-color: #064e3b;
    border: 1px solid #059669;
    color: #6ee7b7;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 8px;
}

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

    .output-section {
        padding: 16px;
    }

    .stats-grid {
        gap: 8px;
    }

    .stats-grid-3 {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 16px 12px;
    }

    .stat-card-value {
        font-size: 22px;
    }

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

    .stacked-layer {
        flex-wrap: wrap;
        gap: 8px;
    }

    .layer-label-input {
        flex: 1 1 100%;
        order: 2;
    }

    .layer-percent-input {
        width: 60px;
    }

    .tier-table td input,
    .compare-table td input {
        width: 60px;
    }

    .compare-table td .store-name-input {
        width: 80px;
    }

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

        padding: 0 16px;
    }

    .button-row {
        flex-direction: column;
    }

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

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card-value {
        font-size: 24px;
    }

    .segmented-control {
        font-size: 13px;
    }

    .segment {
        padding: 8px 12px;
        font-size: 13px;
    }
}

.modal-hidden {
    display: none;
}