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

.section-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #e5e7eb;
    margin-bottom: 10px;
}

.format-section {
    display: flex;
    flex-direction: column;
}

.format-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.format-btn {
    background-color: #1a1a1a;
    border: 1px solid #374151;
    color: #d1d5db;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 150ms ease;
}

.format-btn:hover {
    background-color: #374151;
    color: #ffffff;
}

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

.direction-section {
    display: flex;
    flex-direction: column;
}

.direction-toggle {
    display: flex;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #374151;
    width: fit-content;
}

.direction-btn {
    background-color: #1a1a1a;
    border: none;
    color: #d1d5db;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 150ms ease;
}

.direction-btn:first-child {
    border-right: 1px solid #374151;
}

.direction-btn:hover {
    background-color: #374151;
    color: #ffffff;
}

.direction-btn.active {
    background-color: #3b82f6;
    color: #ffffff;
}

.input-section,
.output-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.textarea-wrapper {
    position: relative;
}

.text-area {
    width: 100%;
    min-height: 160px;
    background-color: #111111;
    border: 1px solid #374151;
    border-radius: 8px;
    color: #e5e7eb;
    padding: 16px;
    font-size: 14px;
    font-family: 'Fira Code', 'Courier New', monospace;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

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

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

.text-area[readonly] {
    background-color: #0d0d0d;
    cursor: default;
}

.stats-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
}

.char-count {
    font-size: 12px;
    color: #6b7280;
}

.stats-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    background-color: #1a1a1a;
    border: 1px solid #374151;
    color: #d1d5db;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 150ms ease;
}

.action-btn:hover {
    background-color: #374151;
    color: #ffffff;
}

.action-btn-primary {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
}

.action-btn-primary:hover {
    background-color: #2563eb;
}

.summary-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.summary-content {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px;
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 8px;
}

.summary-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background-color: #1a1a1a;
    border: 1px solid #374151;
    border-radius: 4px;
    font-size: 12px;
    color: #d1d5db;
    font-family: 'Fira Code', 'Courier New', monospace;
}

.summary-badge-char {
    color: #3b82f6;
    font-weight: 600;
}

.summary-badge-count {
    color: #9ca3af;
    font-weight: 400;
}

.summary-total {
    font-size: 13px;
    color: #9ca3af;
    width: 100%;
    margin-bottom: 4px;
}

.pro-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-top: 20px;
    border-top: 1px solid #374151;
}

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

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

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

.pro-feature-title {
    font-size: 18px;
    font-weight: 500;
    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-desc {
    font-size: 14px;
    color: #9ca3af;
    line-height: 1.5;
}

.pro-unlock-btn {
    align-self: flex-start;
}

.batch-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.batch-delimiter-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.batch-delimiter-group > label {
    font-size: 13px;
    font-weight: 500;
    color: #e5e7eb;
}

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

.batch-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.batch-results-header h4 {
    font-size: 15px;
    font-weight: 500;
    color: #d1d5db;
}

.batch-results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
}

.batch-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background-color: #1a1a1a;
    border: 1px solid #374151;
    border-radius: 6px;
}

.batch-result-text {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-family: 'Fira Code', 'Courier New', monospace;
    color: #e5e7eb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.batch-result-copy {
    flex-shrink: 0;
}

.custom-rules-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

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

.rules-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rule-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background-color: #1a1a1a;
    border: 1px solid #374151;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Fira Code', 'Courier New', monospace;
    color: #e5e7eb;
}

.rule-arrow {
    color: #6b7280;
}

.rule-remove {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 4px;
    margin-left: auto;
    transition: color 150ms ease;
}

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

.preset-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    border-top: 1px solid #374151;
    padding-top: 12px;
}

.preset-controls .text-input {
    flex: 1;
    min-width: 120px;
}

.chain-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.chain-steps {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chain-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background-color: #1a1a1a;
    border: 1px solid #374151;
    border-radius: 6px;
}

.chain-step-number {
    font-size: 12px;
    font-weight: 600;
    color: #3b82f6;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(59, 130, 246, 0.1);
    border-radius: 50%;
    flex-shrink: 0;
}

.chain-step-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #e5e7eb;
}

.chain-step-actions {
    display: flex;
    gap: 4px;
}

.chain-step-btn {
    background: none;
    border: 1px solid #374151;
    color: #9ca3af;
    cursor: pointer;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 150ms ease;
}

.chain-step-btn:hover {
    background-color: #374151;
    color: #ffffff;
}

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

.chain-results {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid #374151;
    padding-top: 12px;
}

.chain-result-step {
    padding: 12px;
    background-color: #1a1a1a;
    border: 1px solid #374151;
    border-radius: 6px;
}

.chain-result-label {
    font-size: 12px;
    font-weight: 500;
    color: #3b82f6;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chain-result-text {
    font-size: 13px;
    font-family: 'Fira Code', 'Courier New', monospace;
    color: #e5e7eb;
    word-break: break-all;
    white-space: pre-wrap;
}

.file-upload-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.file-upload-zone {
    background-color: #0a0a0a;
    border: 2px dashed #374151;
    border-radius: 12px;
    padding: 48px 32px;
    text-align: center;
    cursor: pointer;
    transition: all 150ms ease;
    position: relative;
    outline: none;
}

.upload-icon {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    opacity: 0.7;
    color: #6b7280;
    letter-spacing: 2px;
}

.upload-primary {
    font-size: 16px;
    font-weight: 400;
    color: #e5e7eb;
    margin-bottom: 4px;
}

.upload-secondary {
    font-size: 14px;
    font-weight: 400;
    color: #9ca3af;
}

.file-preview {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #e5e7eb;
    padding: 10px 12px;
    background-color: #1a1a1a;
    border: 1px solid #374151;
    border-radius: 6px;
}

.select-input {
    background-color: #141414;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    -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 10px center;
    padding-right: 32px;
    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;
}

.text-input {
    background-color: #141414;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    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::placeholder {
    color: #6b7280;
}

.button-primary {
    background-color: #3b82f6;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: background-color 150ms ease;
    text-align: center;
    white-space: nowrap;
}

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

.modal-hidden {
    display: none;
}

.pro-cta-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    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;
}

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

.copy-feedback {
    font-size: 12px;
    font-weight: 500;
    color: #10b981;
    transition: opacity 150ms ease;
}

@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: 24px;
    }

    .format-buttons {
        gap: 6px;
    }

    .format-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .direction-btn {
        padding: 8px 18px;
        font-size: 13px;
    }

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

    .rule-add-row {
        flex-wrap: wrap;
    }

    .chain-add-row {
        flex-wrap: wrap;
    }

    .chain-add-row .select-input,
    .chain-add-row .button-primary {
        flex: 1;
    }

    .file-upload-zone {
        padding: 32px 16px;
    }

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

        padding: 0 16px;
    }

    .preset-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .batch-delimiter-group {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    .format-btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    .stats-bar {
        flex-direction: column;
        gap: 6px;
        align-items: flex-start;
    }

    .chain-step {
        flex-wrap: wrap;
    }
}