/* JSON Formatter & Validator Styling */

/* JSON Textarea */
.json-textarea {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    tab-size: 2;
}

/* JSON Output Container */
.json-output {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    overflow-x: auto;
    min-height: 200px;
    max-height: 600px;
}

.json-pre {
    margin: 0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #212529;
}

/* Syntax Highlighting */
.json-key {
    color: #0066cc;
    font-weight: 500;
}

.json-string {
    color: #009900;
}

.json-number {
    color: #cc6600;
}

.json-boolean {
    color: #9900cc;
    font-weight: 600;
}

.json-null {
    color: #999999;
    font-style: italic;
}

/* Dark Mode */
[data-bs-theme="dark"] .json-output {
    background: #1a1d23;
    border-color: #343a40;
}

[data-bs-theme="dark"] .json-pre {
    color: #e9ecef;
}

[data-bs-theme="dark"] .json-key {
    color: #5eb3f6;
}

[data-bs-theme="dark"] .json-string {
    color: #7ec699;
}

[data-bs-theme="dark"] .json-number {
    color: #f5a97f;
}

[data-bs-theme="dark"] .json-boolean {
    color: #d19fe8;
}

[data-bs-theme="dark"] .json-null {
    color: #9ca3af;
}

/* Statistics Container */
.stats-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    min-width: 120px;
}

.stat-label {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 20px;
    font-weight: 600;
    color: #212529;
}

[data-bs-theme="dark"] .stats-container {
    background: #1a1d23;
    border-color: #343a40;
}

[data-bs-theme="dark"] .stat-label {
    color: #9ca3af;
}

[data-bs-theme="dark"] .stat-value {
    color: #e9ecef;
}

/* Validation Status */
#validationStatus {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#validationMessage {
    margin-bottom: 0;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
}

/* Alert Colors */
.alert-success {
    background-color: #d1e7dd;
    border-color: #badbcc;
    color: #0f5132;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c2c7;
    color: #842029;
}

.alert-info {
    background-color: #cff4fc;
    border-color: #b6effb;
    color: #055160;
}

[data-bs-theme="dark"] .alert-success {
    background-color: #0f5132;
    border-color: #146c43;
    color: #d1e7dd;
}

[data-bs-theme="dark"] .alert-danger {
    background-color: #842029;
    border-color: #a52834;
    color: #f8d7da;
}

[data-bs-theme="dark"] .alert-info {
    background-color: #055160;
    border-color: #087990;
    color: #cff4fc;
}

/* Button Styling */
.toolBtn {
    transition: all 0.2s ease;
    border-radius: 6px;
    font-weight: 500;
    padding: 8px 16px;
}

.toolBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.toolBtn:active {
    transform: translateY(0);
}

/* Custom Validate Button - Purple */
.btn-validate {
    background-color: #7c3aed;
    border-color: #7c3aed;
    color: #ffffff;
}

.btn-validate:hover {
    background-color: #6d28d9;
    border-color: #6d28d9;
    color: #ffffff;
}

.btn-validate:focus,
.btn-validate:active {
    background-color: #5b21b6;
    border-color: #5b21b6;
    color: #ffffff;
    box-shadow: 0 0 0 0.25rem rgba(124, 58, 237, 0.25);
}

[data-bs-theme="dark"] .btn-validate {
    background-color: #8b5cf6;
    border-color: #8b5cf6;
}

[data-bs-theme="dark"] .btn-validate:hover {
    background-color: #7c3aed;
    border-color: #7c3aed;
}

[data-bs-theme="dark"] .btn-validate:focus,
[data-bs-theme="dark"] .btn-validate:active {
    background-color: #6d28d9;
    border-color: #6d28d9;
}

/* Responsive Design */
@media (max-width: 768px) {
    .json-output {
        font-size: 12px;
        padding: 10px;
    }

    .json-pre {
        font-size: 12px;
    }

    .stats-container {
        gap: 10px;
        padding: 10px;
    }

    .stat-item {
        min-width: 90px;
    }

    .stat-label {
        font-size: 11px;
    }

    .stat-value {
        font-size: 16px;
    }

    .toolBtn {
        width: 100%;
        margin-bottom: 5px;
    }
}

/* Scrollbar Styling */
.json-output::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.json-output::-webkit-scrollbar-track {
    background: #f1f3f5;
    border-radius: 4px;
}

.json-output::-webkit-scrollbar-thumb {
    background: #adb5bd;
    border-radius: 4px;
}

.json-output::-webkit-scrollbar-thumb:hover {
    background: #868e96;
}

[data-bs-theme="dark"] .json-output::-webkit-scrollbar-track {
    background: #2d3239;
}

[data-bs-theme="dark"] .json-output::-webkit-scrollbar-thumb {
    background: #495057;
}

[data-bs-theme="dark"] .json-output::-webkit-scrollbar-thumb:hover {
    background: #6c757d;
}

/* Loading Animation */
.toolBtn.loading {
    position: relative;
    pointer-events: none;
}

.toolBtn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

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