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

.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-message {
    background-color: #7f1d1d;
    border: 1px solid #dc2626;
    color: #fca5a5;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
}

.warning-message {
    background-color: #78350f;
    border: 1px solid #f59e0b;
    color: #fde68a;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
}

.file-info-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 8px;
    gap: 16px;
}

.file-info-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.file-info-name {
    font-size: 15px;
    font-weight: 500;
    color: #e5e7eb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.mode-selector {
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 6px;
}

.mode-tabs {
    display: flex;
    gap: 4px;
}

.mode-tab {
    flex: 1;
    background: none;
    border: 1px solid transparent;
    color: #9ca3af;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 150ms ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.mode-tab.pro-tab .pro-badge {
    font-size: 9px;
    padding: 1px 4px;
}

.mode-controls {
    padding: 20px;
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 8px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-item > label {
    font-size: 14px;
    font-weight: 500;
    color: #e5e7eb;
}

.setting-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.setting-content > label {
    font-size: 14px;
    font-weight: 500;
    color: #e5e7eb;
}

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

input[type="number"].text-input {
    -moz-appearance: textfield;
}

input[type="number"].text-input::-webkit-inner-spin-button,
input[type="number"].text-input::-webkit-outer-spin-button {
    opacity: 1;
}

.inline-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.inline-input {
    width: 100px;
}

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

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

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

.selection-count {
    font-size: 13px;
    font-weight: 500;
    color: #3b82f6;
}

.mode-instruction {
    font-size: 14px;
    color: #9ca3af;
}

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

.info-hint {
    font-size: 13px;
    color: #9ca3af;
    padding: 10px 16px;
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 6px;
}

.chunk-options {
    padding: 20px;
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.settings-title {
    font-size: 18px;
    font-weight: 500;
    color: #d1d5db;
}

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

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

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

.batch-item-info {
    flex: 1;
    min-width: 0;
}

.batch-item-name {
    font-size: 13px;
    color: #e5e7eb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.batch-item-size {
    font-size: 12px;
    color: #9ca3af;
}

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

.batch-item-remove:hover {
    color: #ef4444;
}

.batch-item-status {
    font-size: 12px;
    font-weight: 500;
}

.batch-item-status.done {
    color: #10b981;
}

.batch-item-status.pending {
    color: #9ca3af;
}

.batch-item-status.error {
    color: #ef4444;
}

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

.thumbnail-grid-container {
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 16px;
    background-color: #141414;
}

.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.thumbnail-card {
    position: relative;
    cursor: pointer;
    border: 2px solid #374151;
    border-radius: 6px;
    overflow: hidden;
    background-color: #1a1a1a;
    transition: border-color 150ms ease, box-shadow 150ms ease;
    min-height: 44px;
}

.thumbnail-card:hover {
    border-color: #6b7280;
}

.thumbnail-card.selected {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.thumbnail-card.group-highlight {
    border-color: #3b82f6;
}

.thumbnail-canvas-wrap {
    width: 100%;
    aspect-ratio: 3 / 4;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: #1a1a1a;
}

.thumbnail-canvas-wrap canvas {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.thumbnail-placeholder {
    width: 100%;
    aspect-ratio: 3 / 4;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 12px;
}

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

.thumbnail-page-number {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: #e5e7eb;
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    padding: 8px 4px 4px;
}

.thumbnail-check {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    background-color: #3b82f6;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
}

.thumbnail-card.selected .thumbnail-check {
    display: flex;
}

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

.preview-title {
    font-size: 14px;
    font-weight: 500;
    color: #d1d5db;
    margin-bottom: 12px;
}

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

.preview-item {
    font-size: 13px;
    color: #9ca3af;
    padding: 6px 10px;
    background-color: #1a1a1a;
    border-radius: 4px;
}

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

.split-action .button-primary {
    width: 100%;
}

.empty-selection-hint {
    font-size: 13px;
    color: #9ca3af;
    text-align: center;
}

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

.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%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

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

.output-header h3 {
    font-size: 22px;
    font-weight: 600;
    line-height: 28px;
    color: #d1d5db;
}

.processing-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px;
}

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

.progress-bar {
    width: 100%;
    max-width: 400px;
    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;
}

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

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

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

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

.result-meta {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 2px;
}

.result-download {
    background-color: #1a1a1a;
    border: 1px solid #3b82f6;
    color: #3b82f6;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 150ms ease;
    flex-shrink: 0;
}

.result-download:hover {
    background-color: #3b82f6;
    color: #ffffff;
}

.zip-download {
    padding-top: 8px;
}

.start-over {
    padding-top: 8px;
    text-align: center;
}

.start-over .button-secondary {
    width: 100%;
}

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

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

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

.batch-result-group-header {
    font-size: 14px;
    font-weight: 500;
    color: #d1d5db;
    padding-bottom: 4px;
    border-bottom: 1px solid #2a2a2a;
}

.batch-result-group-error {
    font-size: 13px;
    color: #ef4444;
    padding: 8px 12px;
    background-color: #1a1a1a;
    border-radius: 4px;
}

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

.modal-feature-label {
    font-size: 14px;
    color: #9ca3af;
    margin-bottom: 16px;
}

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

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

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

    .thumbnail-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
    }

    .mode-tabs {
        flex-wrap: wrap;
    }

    .mode-tab {
        flex: 1 1 calc(50% - 2px);
    }

    .mode-controls {
        padding: 16px;
    }

    .output-section {
        padding: 16px;
    }

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

    .file-info-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

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

        padding: 0 16px;
    }

    .result-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .result-download {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .thumbnail-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }

    .mode-tab {
        padding: 8px 8px;
        font-size: 12px;
    }

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

    .selection-actions .button-small {
        width: 100%;
    }

    .batch-item {
        flex-wrap: wrap;
    }

    .inline-input {
        width: 80px;
    }
}

.modal-hidden {
    display: none;
}