/* 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;
    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: 14px;
    color: #6b7280;
    pointer-events: none;
    z-index: 1;
}

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

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

.input-note {
    font-size: 13px;
    color: #9ca3af;
}

.select-input {
    background-color: #141414;
    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 option {
    background-color: #1a1a1a;
}

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

.quick-select-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.quick-select-btn {
    background-color: #1a1a1a;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 150ms ease;
}

.quick-select-btn:hover {
    background-color: #374151;
}

.quick-select-btn.active {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
}

.rounding-group {
    display: flex;
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 8px;
    overflow: hidden;
}

.rounding-option {
    flex: 1;
    cursor: pointer;
    display: flex;
}

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

.rounding-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #9ca3af;
    text-align: center;
    transition: all 150ms ease;
    border-right: 1px solid #374151;
}

.rounding-option:last-child .rounding-label {
    border-right: none;
}

.rounding-option input[type="radio"]:checked + .rounding-label {
    background-color: #3b82f6;
    color: #ffffff;
}

.rounding-option:hover .rounding-label {
    background-color: #1a1a1a;
}

.rounding-option input[type="radio"]:checked + .rounding-label:hover {
    background-color: #3b82f6;
}

.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;
    flex: 1;
}

.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-small {
    padding: 8px 16px;
    font-size: 13px;
}

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

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

.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-fill, minmax(200px, 1fr));
    gap: 12px;
}

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

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

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

.split-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background-color: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
}

.split-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.split-detail-value {
    font-size: 14px;
    font-weight: 600;
    color: #e5e7eb;
}

.rounding-note {
    font-size: 13px;
    color: #9ca3af;
    padding-top: 8px;
    border-top: 1px solid #2a2a2a;
}

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

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

.pro-gated-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.lock-icon {
    font-size: 14px;
}

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

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

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

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

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

.uneven-split-editor {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

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

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

.uneven-person-row .text-input {
    flex: 1;
}

.uneven-person-row .input-with-prefix {
    flex: 0 0 140px;
}

.uneven-split-remaining {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background-color: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #e5e7eb;
}

.uneven-split-remaining.balanced {
    border-color: #059669;
    color: #10b981;
}

.uneven-split-remaining.under {
    border-color: #d97706;
    color: #fbbf24;
}

.uneven-split-remaining.over {
    border-color: #dc2626;
    color: #ef4444;
}

.item-splitter-editor {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 8px;
}

.splitter-people,
.splitter-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.splitter-people h4,
.splitter-items h4 {
    font-size: 15px;
    font-weight: 600;
    color: #d1d5db;
}

.splitter-people-list,
.splitter-items-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.splitter-person-tag,
.splitter-item-tag {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background-color: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    font-size: 14px;
    color: #e5e7eb;
}

.splitter-item-tag .item-price {
    font-weight: 500;
    color: #9ca3af;
}

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

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

.splitter-add-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.splitter-add-row .text-input {
    flex: 1;
}

.splitter-grid {
    overflow-x: auto;
}

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

.splitter-grid th,
.splitter-grid td {
    padding: 10px 12px;
    text-align: center;
    border-bottom: 1px solid #2a2a2a;
}

.splitter-grid th {
    font-weight: 500;
    color: #9ca3af;
    background-color: #141414;
    position: sticky;
    top: 0;
}

.splitter-grid td {
    color: #e5e7eb;
}

.splitter-grid td:first-child {
    text-align: left;
    font-weight: 500;
}

.splitter-grid tr:nth-child(even) {
    background-color: #1a1a1a;
}

.splitter-grid input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #3b82f6;
}

.item-unassigned {
    color: #f59e0b;
    font-size: 12px;
    font-style: italic;
}

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

.splitter-breakdown-card {
    padding: 16px;
    background-color: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.splitter-breakdown-card h5 {
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
}

.splitter-breakdown-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.splitter-breakdown-row span:first-child {
    color: #9ca3af;
}

.splitter-breakdown-row span:last-child {
    color: #e5e7eb;
    font-weight: 500;
}

.splitter-breakdown-total {
    font-weight: 600;
    color: #ffffff;
    border-top: 1px solid #2a2a2a;
    padding-top: 8px;
}

.history-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

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

.history-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background-color: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    gap: 12px;
}

.history-entry-info {
    flex: 1;
    min-width: 0;
}

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

.history-entry-venue {
    font-size: 14px;
    font-weight: 500;
    color: #e5e7eb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-entry-amounts {
    font-size: 13px;
    color: #9ca3af;
}

.history-entry-total {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    flex-shrink: 0;
}

.history-delete-btn {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
    transition: color 150ms ease;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 150ms ease, color 150ms ease;
}

.history-entry:hover .history-delete-btn {
    opacity: 1;
}

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

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

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

.settings-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 8px;
}

.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-small {
    max-width: 400px;
}

.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;
    transition: color 150ms ease;
}

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

.modal-content {
    padding: 24px;
}

.modal-content p {
    font-size: 15px;
    color: #d1d5db;
    margin-bottom: 20px;
}

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

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

.confirm-actions .button-secondary,
.confirm-actions .button-primary {
    flex: none;
    padding: 10px 20px;
}

.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.5);
    animation: toast-in 200ms ease;
}

.toast.toast-success {
    border-color: #059669;
    color: #10b981;
}

.toast.toast-error {
    border-color: #dc2626;
    color: #ef4444;
}

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

.modal-hidden {
    display: none;
}

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

    .stat-card {
        padding: 12px;
    }

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

    .quick-select-row {
        gap: 6px;
    }

    .quick-select-btn {
        padding: 6px 16px;
        font-size: 13px;
    }

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

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

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

        padding: 0 16px;
    }

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

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

    .uneven-person-row {
        flex-direction: column;
        gap: 8px;
    }

    .uneven-person-row .input-with-prefix {
        flex: none;
        width: 100%;
    }

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

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

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

    .rounding-group {
        flex-direction: column;
    }

    .rounding-label {
        border-right: none;
        border-bottom: 1px solid #374151;
    }

    .rounding-option:last-child .rounding-label {
        border-bottom: none;
    }

    .history-entry {
        flex-direction: column;
        align-items: flex-start;
    }

    .history-delete-btn {
        opacity: 1;
    }
}