/* JSON Validator - Tool-specific styles */

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

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

.tab-bar {
    display: flex;
    gap: 4px;
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 4px;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: #9ca3af;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tab-btn:hover {
    color: #e5e7eb;
    background-color: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    background-color: #2563eb;
    color: #ffffff;
}

.input-mode {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.code-input {
    width: 100%;
    min-height: 200px;
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 16px;
    color: #e5e7eb;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
}

.code-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.code-input::placeholder {
    color: #6b7280;
}

.file-upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    background-color: #141414;
    border: 2px dashed #374151;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.file-upload-zone:hover,
.file-upload-zone.dragover {
    border-color: #2563eb;
    background-color: rgba(37, 99, 235, 0.05);
}

.upload-icon {
    font-size: 24px;
    color: #6b7280;
    margin-bottom: 16px;
}

.upload-text {
    text-align: center;
}

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

.upload-secondary {
    color: #6b7280;
    font-size: 14px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 8px;
}

.file-name {
    flex: 1;
    color: #e5e7eb;
    font-weight: 500;
}

.file-size {
    color: #6b7280;
    font-size: 14px;
}

.file-remove {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 14px;
}

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

.button-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background-color: #2563eb;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.button-primary:hover {
    background-color: #1d4ed8;
}

.button-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.button-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background-color: transparent;
    color: #e5e7eb;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid #374151;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.button-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: #4b5563;
}

.output-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.section-hidden {
    display: none !important;
}

/* Validation Result */
.validation-result {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border-radius: 8px;
    border: 1px solid #374151;
}

.validation-result.valid {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
}

.validation-result.invalid {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

.result-icon {
    font-size: 32px;
    font-weight: bold;
}

.validation-result.valid .result-icon {
    color: #10b981;
}

.validation-result.invalid .result-icon {
    color: #ef4444;
}

.result-text {
    flex: 1;
}

.result-text h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.validation-result.valid .result-text h3 {
    color: #10b981;
}

.validation-result.invalid .result-text h3 {
    color: #ef4444;
}

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

/* Error Details */
.error-details {
    padding: 20px 24px;
    background-color: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
}

.error-title {
    font-size: 14px;
    font-weight: 600;
    color: #ef4444;
    margin-bottom: 12px;
}

.error-message {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 13px;
    color: #e5e7eb;
    background-color: #141414;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 12px;
    overflow-x: auto;
}

.error-position {
    font-size: 14px;
    color: #9ca3af;
    margin-bottom: 12px;
}

.error-suggestion {
    font-size: 14px;
    color: #60a5fa;
    padding-left: 16px;
    border-left: 3px solid #2563eb;
}

/* Valid Preview */
.valid-preview {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.preview-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #e5e7eb;
}

.preview-stats {
    display: flex;
    gap: 16px;
}

.preview-stats span {
    font-size: 13px;
    color: #6b7280;
}

.code-output {
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
    max-height: 400px;
}

.code-output code {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    color: #e5e7eb;
    white-space: pre;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    background-color: #1f2937;
    color: #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 1000;
}

.toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.toast-success {
    background-color: #065f46;
}

/* Responsive */
@media (max-width: 640px) {
    .tool-main {
        padding: 24px 16px 100px;
    }

    .code-input {
        min-height: 150px;
    }

    .validation-result {
        flex-direction: column;
        text-align: center;
    }

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

    .action-buttons button {
        width: 100%;
    }
}
