/* JSON Validator & Repair Tool Styles */

/* ---- Tab navigation ---- */
.tab-button {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    border-bottom: 2px solid transparent;
    color: #9CA3AF;
    background: transparent;
    border-radius: 0;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
}

.tab-button:hover {
    color: #D1D5DB;
    border-bottom-color: #6B7280;
}

.tab-button.active {
    color: #3B82F6;
    border-bottom-color: #3B82F6;
    background: rgba(59, 130, 246, 0.1);
}

.tab-button i {
    font-size: 0.875rem;
}

/* ---- Mobile tab nav ---- */
.tab-navigation-mobile {
    position: relative;
    width: 100%;
}

#dropdownDefaultButton {
    background: #374151 !important;
    border: 1px solid #4B5563 !important;
    color: #E5E7EB !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
}

#dropdownDefaultButton:hover {
    background: #4B5563 !important;
    border-color: #6B7280 !important;
    color: white !important;
}

#dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: #374151;
    border: 1px solid #4B5563;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.3), 0 4px 6px -2px rgba(0,0,0,0.2);
    overflow: hidden;
    display: block;
    visibility: visible;
    opacity: 1;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#dropdown.hidden {
    visibility: hidden;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

.dropdown-option {
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    color: #E5E7EB;
    font-size: 14px;
    display: flex;
    align-items: center;
    font-family: inherit;
}

.dropdown-option:hover {
    background-color: #4B5563;
    color: white;
}

.dropdown-option i {
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

/* ---- Layout ---- */
.json-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 767px) {
    .json-panels {
        grid-template-columns: 1fr;
    }
}

/* ---- Editor container (validate tab) with line numbers ---- */
.editor-container {
    display: flex;
    background: #0d1117;
    border: 2px solid #30363d;
    border-radius: 0.5rem;
    overflow: hidden;
    height: 360px;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.editor-container.focused {
    border-color: #3b82f6;
}

.editor-container.valid {
    border-left: 4px solid #22c55e;
}

.editor-container.invalid {
    border-left: 4px solid #ef4444;
}

/* Line numbers column */
.line-numbers {
    background: #0d1117;
    color: #3a4253;
    padding: 1rem 0.625rem 1rem 0.625rem;
    font-family: 'Monaco', 'Cascadia Code', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.6;
    text-align: right;
    user-select: none;
    -webkit-user-select: none;
    min-width: 2.5rem;
    border-right: 1px solid #161b22;
    overflow: hidden;
    flex-shrink: 0;
    pointer-events: none;
}

.line-numbers div {
    /* line-height inherited */
}

/* Textarea inside editor-container (validate tab) */
.editor-container .json-editor {
    border: none !important;
    border-radius: 0 !important;
    height: 100% !important;
    resize: none !important;
    flex: 1;
    padding-left: 0.75rem;
    min-width: 0;
}

/* ---- Code editor textarea (standalone — repair tab) ---- */
.json-editor {
    font-family: 'Monaco', 'Cascadia Code', 'Consolas', monospace;
    font-size: 14px;
    background: #0d1117;
    color: #e6edf3;
    border: 2px solid #30363d;
    border-radius: 0.5rem;
    padding: 1rem;
    width: 100%;
    height: 360px;
    resize: vertical;
    outline: none;
    line-height: 1.6;
    display: block;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.json-editor:focus {
    border-color: #3b82f6;
}

.json-editor.valid {
    border-left: 4px solid #22c55e;
}

.json-editor.invalid {
    border-left: 4px solid #ef4444;
}

@media (max-width: 767px) {
    .editor-container {
        height: 220px;
    }
    .json-editor {
        height: 220px;
    }
}

/* ---- Scrollable content area inside editor-container (repair output) ---- */
.json-output-inner {
    flex: 1;
    overflow: auto;
    padding: 1rem;
    min-width: 0;
}

.json-output-inner pre {
    margin: 0;
    font-size: 13px;
    font-family: 'Monaco', 'Cascadia Code', 'Consolas', monospace;
    white-space: pre-wrap;
    word-break: break-word;
}

.json-output-inner code {
    background: transparent !important;
    padding: 0 !important;
}

/* ---- Status badge ---- */
.status-badge {
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 9999px;
    font-weight: 600;
    display: inline-block;
}

.status-badge.valid {
    background: #166534;
    color: #86efac;
}

.status-badge.invalid {
    background: #7f1d1d;
    color: #fca5a5;
}

/* ---- Stats bar ---- */
.stats-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.stat-badge {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 0.375rem;
    padding: 2px 10px;
    font-size: 12px;
    color: #9ca3af;
    font-family: monospace;
}

/* ---- Error banner ---- */
.error-banner {
    background: #450a0a;
    border: 1px solid #dc2626;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.error-banner .error-msg {
    color: #fca5a5;
    font-family: monospace;
    font-size: 13px;
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.jump-link {
    color: #60a5fa;
    text-decoration: underline;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
    background: none;
    border: none;
    padding: 0;
}

/* ---- Char counter ---- */
.char-counter {
    font-size: 12px;
    color: #6b7280;
    font-family: monospace;
}

/* ---- Keyboard shortcut badge ---- */
.shortcut-kbd {
    font-size: 10px;
    background: rgba(255,255,255,0.12);
    border-radius: 4px;
    padding: 1px 5px;
    font-family: monospace;
    color: rgba(255,255,255,0.7);
    margin-left: 4px;
}

/* ---- Repair example presets ---- */
.repair-examples {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    -webkit-overflow-scrolling: touch;
}

.example-btn {
    background: #1e293b;
    border: 1px solid #334155;
    color: #94a3b8;
    border-radius: 9999px;
    padding: 4px 14px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.example-btn:hover {
    background: #334155;
    color: #e2e8f0;
}

/* ---- Repair summary ---- */
.repair-summary {
    background: #052e16;
    border: 1px solid #16a34a;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 0.75rem;
}

.repair-summary ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.repair-summary li {
    color: #86efac;
    font-size: 13px;
    padding: 3px 0;
    font-family: monospace;
}

/* ---- Buttons ---- */

/* Blue primary action (matches AI text cleaner) */
.btn-primary {
    background: linear-gradient(135deg, #3B82F6, #1E40AF);
    border: none;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563EB, #1D4ED8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Green copy (matches pool salt calculator copy button) */
.btn-green {
    background-color: #15803d;
    border: none;
    color: white;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-green:hover {
    background-color: #166534;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.btn-green:active {
    transform: translateY(0);
}

.btn-green.copied {
    background-color: #166534;
}

/* Transparent secondary (matches pool salt calculator share/reload buttons) */
.btn-transparent {
    background-color: #1f2937;
    border: 1px solid #374151;
    color: #d1d5db;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-transparent:hover {
    background-color: #374151;
    border-color: #4B5563;
    color: white;
    transform: translateY(-1px);
}

.btn-transparent:active {
    transform: translateY(0);
}

/* Amber "Fix JSON!" button */
.btn-amber {
    background: linear-gradient(135deg, #d97706, #92400e);
    border: none;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-amber:hover {
    background: linear-gradient(135deg, #b45309, #78350f);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.4);
}

.btn-amber:active {
    transform: translateY(0);
}

/* Mobile: full-width buttons */
@media (max-width: 639px) {
    .btn-primary,
    .btn-amber,
    .btn-green,
    .btn-transparent {
        width: 100%;
        justify-content: center;
    }
}

/* ---- Responsive helpers ---- */
.hidden {
    display: none !important;
}

@media (min-width: 768px) {
    .tab-navigation-desktop { display: block !important; }
    .tab-navigation-mobile { display: none !important; }
}

@media (max-width: 767px) {
    .tab-navigation-desktop { display: none !important; }
    .tab-navigation-mobile { display: block !important; }
}
