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

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

.file-upload-zone.has-error {
    border-color: #dc2626;
    background-color: #7f1d1d;
}

.file-upload-zone.has-file {
    border-style: solid;
    border-color: #374151;
    padding: 24px;
}

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

.error-banner {
    background-color: #7f1d1d;
    border: 1px solid #dc2626;
    color: #fca5a5;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.error-text {
    flex: 1;
}

.error-dismiss {
    background: none;
    border: none;
    color: #fca5a5;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    padding: 4px 8px;
    transition: opacity 150ms ease;
}

.error-dismiss:hover {
    opacity: 0.7;
}

.library-error {
    background-color: #7f1d1d;
    border: 1px solid #dc2626;
    color: #fca5a5;
    padding: 24px;
    border-radius: 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    font-size: 14px;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 32px;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #374151;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 14px;
    color: #9ca3af;
}

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

.file-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.file-info-row {
    display: flex;
    gap: 8px;
    font-size: 14px;
}

.file-info-label {
    color: #6b7280;
    font-weight: 500;
    min-width: 50px;
}

.file-info-value {
    color: #e5e7eb;
    word-break: break-all;
}

.field-summary {
    padding: 10px 14px;
    background-color: #1a1a1a;
    border-radius: 6px;
}

.field-summary-text {
    font-size: 13px;
    color: #9ca3af;
}

.xfa-warning {
    background-color: #78350f;
    border: 1px solid #d97706;
    color: #fde68a;
    padding: 14px 16px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
}

.no-fields-message {
    text-align: center;
    padding: 24px;
    color: #9ca3af;
    font-size: 14px;
}

.no-fields-message p {
    margin-bottom: 8px;
}

.no-fields-hint {
    color: #6b7280;
    font-size: 13px;
}

.field-list-panel {
    border: 1px solid #374151;
    border-radius: 6px;
    overflow: hidden;
}

.field-list-toggle {
    width: 100%;
    background-color: #1a1a1a;
    border: none;
    color: #e5e7eb;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color 150ms ease;
}

.field-list-toggle:hover {
    background-color: #252525;
}

.toggle-arrow {
    font-size: 12px;
    color: #6b7280;
    transition: transform 200ms ease;
}

.toggle-arrow.open {
    transform: rotate(180deg);
}

.field-list-body {
    padding: 0;
}

.field-list {
    list-style: none;
    max-height: 240px;
    overflow-y: auto;
}

.field-list li {
    padding: 8px 16px;
    font-size: 13px;
    color: #d1d5db;
    border-top: 1px solid #252525;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background-color 150ms ease;
}

.field-list li:hover {
    background-color: #1a1a1a;
}

.field-type-icon {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 24px;
}

.field-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 12px 0;
    position: sticky;
    top: 60px;
    background-color: #141414;
    z-index: 10;
    border-bottom: 1px solid #252525;
}

.page-nav-btn {
    padding: 6px 14px;
    font-size: 13px;
}

.page-nav-info {
    font-size: 14px;
    font-weight: 500;
    color: #d1d5db;
    min-width: 100px;
    text-align: center;
}

.pdf-preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    overflow: visible;
}

.page-wrapper {
    position: relative;
    display: inline-block;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    overflow: hidden;
    max-width: 100%;
}

.page-wrapper canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.page-label {
    text-align: center;
    font-size: 12px;
    color: #6b7280;
    margin-top: 6px;
}

.field-overlay {
    position: absolute;
    z-index: 5;
}

.field-overlay input[type="text"],
.field-overlay textarea {
    background-color: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: 2px;
    color: #1a1a1a;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    padding: 2px 4px;
    width: 100%;
    height: 100%;
    resize: none;
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field-overlay input[type="text"]:focus,
.field-overlay textarea:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

.field-overlay input[type="text"].readonly,
.field-overlay textarea.readonly {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: rgba(107, 114, 128, 0.4);
}

.field-overlay input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 100%;
    background-color: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    transition: all 150ms ease;
}

.field-overlay input[type="checkbox"]:checked {
    background-color: rgba(99, 102, 241, 0.3);
    border-color: #6366f1;
}

.field-overlay input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30%;
    height: 55%;
    border: solid #1a1a1a;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -60%) rotate(45deg);
}

.field-overlay input[type="checkbox"]:focus {
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

.field-overlay select {
    background-color: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: 2px;
    color: #1a1a1a;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    padding: 1px 4px;
    width: 100%;
    height: 100%;
    outline: none;
    cursor: pointer;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field-overlay select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

.field-overlay select option {
    background-color: #1a1a1a;
    color: #e5e7eb;
}

.field-overlay input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 100%;
    background-color: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    transition: all 150ms ease;
}

.field-overlay input[type="radio"]:checked {
    background-color: rgba(99, 102, 241, 0.3);
    border-color: #6366f1;
}

.field-overlay input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40%;
    height: 40%;
    background-color: #1a1a1a;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.field-overlay input[type="radio"]:focus {
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

@keyframes field-pulse {
    0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
    50% { box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15); }
    100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
}

.field-highlight {
    animation: field-pulse 2s ease-in-out 3;
}

.annotation-overlay {
    position: absolute;
    z-index: 10;
    cursor: move;
}

.annotation-overlay .annotation-input {
    background-color: rgba(251, 191, 36, 0.1);
    border: 1px dashed rgba(251, 191, 36, 0.6);
    border-radius: 2px;
    color: #1a1a1a;
    font-family: 'Helvetica', 'Inter', sans-serif;
    padding: 2px 4px;
    outline: none;
    resize: both;
    min-width: 80px;
    min-height: 20px;
    transition: border-color 150ms ease;
}

.annotation-overlay .annotation-input:focus {
    border-color: #fbbf24;
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.2);
}

.annotation-delete {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 18px;
    height: 18px;
    background-color: #dc2626;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 150ms ease;
}

.annotation-overlay:hover .annotation-delete {
    opacity: 1;
}

.annotation-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background-color: #1a1a1a;
    border: 1px solid #374151;
    border-radius: 6px;
}

.annotation-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #e5e7eb;
}

.annotation-hint {
    font-size: 13px;
    color: #6b7280;
}

.annotation-settings {
    display: flex;
    gap: 12px;
}

.annotation-settings .setting-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.annotation-settings .setting-item label {
    font-size: 12px;
    font-weight: 500;
    color: #9ca3af;
}

.annotation-settings .text-input {
    width: 80px;
    padding: 6px 10px;
    font-size: 13px;
}

.annotation-mode-active {
    cursor: crosshair;
}

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

.save-load-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background-color: #1a1a1a;
    border: 1px solid #374151;
    border-radius: 6px;
}

.save-load-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #e5e7eb;
}

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

.save-load-buttons .button-secondary {
    flex: 1;
}

.saved-progress-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background-color: #064e3b;
    border: 1px solid #059669;
    border-radius: 6px;
    font-size: 13px;
    color: #6ee7b7;
}

.saved-progress-notice .button-secondary {
    padding: 6px 14px;
    font-size: 13px;
}

.batch-fill-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background-color: #1a1a1a;
    border: 1px solid #374151;
    border-radius: 6px;
}

.batch-fill-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #e5e7eb;
}

.batch-fill-hint {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

.batch-upload-row {
    display: flex;
    gap: 12px;
}

.csv-mapping {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.csv-mapping-title {
    font-size: 14px;
    font-weight: 500;
    color: #d1d5db;
}

.csv-mapping-table-wrap {
    overflow-x: auto;
}

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

.csv-mapping-table th {
    text-align: left;
    padding: 10px 12px;
    background-color: #252525;
    color: #9ca3af;
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #374151;
}

.csv-mapping-table td {
    padding: 8px 12px;
    color: #d1d5db;
    border-bottom: 1px solid #252525;
}

.csv-mapping-table tr:nth-child(even) td {
    background-color: #1f1f1f;
}

.csv-mapping-table select {
    background-color: #141414;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
}

.csv-mapping-table select:focus {
    border-color: #3b82f6;
}

.csv-info {
    font-size: 13px;
    color: #9ca3af;
}

.batch-progress {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.batch-progress-text {
    font-size: 13px;
    color: #9ca3af;
}

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

.batch-results-text {
    font-size: 13px;
    font-weight: 500;
    color: #10b981;
}

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

.progress-fill {
    height: 100%;
    background-color: #3b82f6;
    border-radius: 2px;
    width: 0%;
    transition: width 200ms ease;
}

.reset-row {
    padding-top: 12px;
    border-top: 1px solid #374151;
}

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

.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-download {
    background-color: #059669;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: background-color 150ms ease;
    text-align: center;
    width: 100%;
}

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

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

.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: #064e3b;
    border: 1px solid #059669;
    color: #6ee7b7;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 300;
    opacity: 0;
    transition: opacity 300ms ease;
    pointer-events: none;
}

.toast.toast-visible {
    opacity: 1;
}

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

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

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

    .page-nav {
        gap: 10px;
    }

    .page-nav-btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .page-nav-info {
        font-size: 13px;
    }

    .save-load-buttons {
        flex-direction: column;
    }

    .saved-progress-notice {
        flex-direction: column;
        text-align: center;
    }

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

        padding: 0 16px;
    }

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

    .annotation-controls {
        padding: 12px;
    }

    .save-load-controls {
        padding: 12px;
    }

    .batch-fill-section {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .page-wrapper {
        width: 100%;
    }

    .page-wrapper canvas {
        width: 100%;
    }

    .csv-mapping-table th,
    .csv-mapping-table td {
        padding: 6px 8px;
        font-size: 12px;
    }
}