/* 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 {
    font-size: 14px;
    font-weight: 500;
    color: #e5e7eb;
    display: block;
    margin-bottom: 8px;
}

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

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

.mode-btn {
    background-color: #1a1a1a;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Fira Code', 'Courier New', monospace;
    cursor: pointer;
    transition: all 150ms ease;
}

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

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

.direction-section {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.direction-toggle {
    display: flex;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #374151;
}

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

.direction-btn:hover {
    color: #e5e7eb;
}

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

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

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

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

.auto-detect-label input[type="checkbox"]:checked + .checkbox-custom::after,
.toggle-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);
}

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

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

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

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

.text-area {
    background-color: #111111;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 16px;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Fira Code', 'Courier New', monospace;
    line-height: 1.6;
    resize: vertical;
    min-height: 160px;
    outline: none;
    width: 100%;
    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;
    gap: 12px;
}

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

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

.action-btn {
    background-color: #1a1a1a;
    border: 1px solid #374151;
    color: #e5e7eb;
    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;
}

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

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

.summary-section {
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 20px 24px;
}

.summary-header {
    font-size: 14px;
    font-weight: 500;
    color: #9ca3af;
    margin-bottom: 12px;
}

.summary-content {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

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

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

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

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

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

.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-desc {
    font-size: 14px;
    color: #9ca3af;
}

.url-components {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.component-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.component-label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 80px;
    flex-shrink: 0;
}

.component-value-wrap {
    flex: 1;
    display: flex;
    gap: 6px;
}

.component-input {
    flex: 1;
    background-color: #0a0a0a;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'Fira Code', 'Courier New', monospace;
    outline: none;
    min-width: 0;
}

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

.component-copy {
    background-color: #1a1a1a;
    border: 1px solid #374151;
    color: #9ca3af;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 150ms ease;
}

.component-copy:hover {
    background-color: #374151;
    color: #e5e7eb;
}

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

.query-builder-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

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

.query-param-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background-color: #0a0a0a;
    border: 1px solid #374151;
    border-radius: 6px;
}

.query-param-row input {
    flex: 1;
    background-color: #141414;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'Fira Code', 'Courier New', monospace;
    outline: none;
    min-width: 0;
}

.query-param-row input:focus {
    border-color: #3b82f6;
}

.query-param-row input::placeholder {
    color: #6b7280;
}

.query-param-separator {
    color: #6b7280;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

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

.query-param-remove:hover {
    color: #ef4444;
}

.query-param-reorder {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    transition: color 150ms ease;
    flex-shrink: 0;
}

.query-param-reorder:hover {
    color: #e5e7eb;
}

.query-output {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.query-output-wrap {
    display: flex;
    gap: 6px;
}

.query-output-wrap .text-input {
    flex: 1;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 13px;
}

.text-input {
    background-color: #141414;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    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[readonly] {
    background-color: #0d0d0d;
    cursor: default;
}

.double-encoding-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.double-encoding-warning {
    background-color: #451a03;
    border: 1px solid #b45309;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 14px;
    color: #fcd34d;
}

.double-encoding-match {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    background-color: #78350f;
    border-radius: 3px;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 13px;
    margin: 2px;
}

.double-encoding-arrow {
    color: #9ca3af;
    font-size: 12px;
}

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

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

.batch-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    background-color: #0a0a0a;
    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 {
    background-color: #1a1a1a;
    border: 1px solid #374151;
    color: #9ca3af;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 150ms ease;
}

.batch-result-copy:hover {
    background-color: #374151;
    color: #e5e7eb;
}

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

.base64-output {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.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: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 150ms ease;
    text-align: center;
}

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

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

.copied-feedback {
    color: #10b981;
    font-size: 13px;
    font-weight: 500;
}

.batch-results-list::-webkit-scrollbar {
    width: 6px;
}

.batch-results-list::-webkit-scrollbar-track {
    background-color: #0a0a0a;
    border-radius: 3px;
}

.batch-results-list::-webkit-scrollbar-thumb {
    background-color: #374151;
    border-radius: 3px;
}

.batch-results-list::-webkit-scrollbar-thumb:hover {
    background-color: #4b5563;
}

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

    .mode-buttons {
        gap: 6px;
    }

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

    .direction-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

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

    .pro-section {
        padding: 16px;
    }

    .output-section {
        padding: 16px;
    }

    .summary-section {
        padding: 16px;
    }

    .component-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .component-label {
        min-width: unset;
    }

    .component-value-wrap {
        width: 100%;
    }

    .query-param-row {
        flex-wrap: wrap;
    }

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

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

        padding: 0 16px;
    }
}

@media (max-width: 480px) {
    .mode-btn {
        flex: 1 1 calc(50% - 4px);
        text-align: center;
    }

    .query-builder-actions {
        flex-direction: column;
    }
}