/* Scoped styles for the JSON Formatter App */

:root {
    --jf-bg: rgba(17, 24, 39, 0.7);
    --jf-primary: #3b82f6;
    --jf-primary-hover: #2563eb;
    --jf-border: rgba(255, 255, 255, 0.1);
}

.app-container {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.main-card {
    background: var(--jf-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--jf-border);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    width: 100%;
    max-width: 1100px;
    overflow: hidden;
    min-height: 580px;
    margin-top: 2rem;
}

/* Common Section Styles */
.input-section,
.display-section {
    padding: 2.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Left Section */
.input-section {
    border-right: 1px solid var(--jf-border);
}

.brand {
    margin-bottom: 1.25rem;
}

.brand h1 {
    font-size: 2.2rem;
    font-weight: 600;
    background: linear-gradient(to right, #60a5fa, #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.brand p {
    color: #94a3b8;
    font-size: 1rem;
}

/* Action Bar */
.action-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.action-btn {
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    border: 1px solid var(--jf-border);
    background: rgba(15, 23, 42, 0.6);
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s ease;
}

.action-btn:hover {
    border-color: var(--jf-primary);
    color: var(--jf-primary);
}

.action-btn.primary-btn {
    background: linear-gradient(135deg, var(--jf-primary), var(--jf-primary-hover));
    color: white;
    border-color: transparent;
}

.action-btn.primary-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* Input Group */
.input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 0;
}

.input-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.input-label-row label {
    font-size: 0.9rem;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.small-btn {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.small-btn:hover {
    color: var(--jf-primary);
}

#json-input {
    flex: 1;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--jf-border);
    border-radius: 12px;
    padding: 1rem;
    color: #f8fafc;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    outline: none;
    resize: none;
    line-height: 1.6;
    transition: border-color 0.3s ease;
    min-height: 200px;
}

#json-input:focus {
    border-color: var(--jf-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

#json-input::placeholder {
    color: #475569;
}

/* Status Bar */
.status-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-bar.status-valid {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.status-bar.status-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* Right Section */
.display-section {
    background: rgba(15, 23, 42, 0.3);
    overflow-y: auto;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}

.result-header label {
    font-size: 0.9rem;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.result-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--jf-primary);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.icon-btn:hover {
    background: rgba(59, 130, 246, 0.1);
}

#indent-select {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--jf-border);
    color: #94a3b8;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    outline: none;
    cursor: pointer;
}

#indent-select:focus {
    border-color: var(--jf-primary);
}

/* Placeholder */
.placeholder {
    text-align: center;
    color: #94a3b8;
    margin: auto;
}

/* JSON Output */
.json-output {
    flex: 1;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--jf-border);
    border-radius: 12px;
    padding: 1rem;
    overflow: auto;
    margin: 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #e2e8f0;
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 200px;
}

/* Syntax Highlighting */
.json-key { color: #93c5fd; }
.json-string { color: #86efac; }
.json-number { color: #fbbf24; }
.json-boolean { color: #c084fc; }
.json-null { color: #94a3b8; font-style: italic; }
.json-bracket { color: #64748b; }

/* Stats Bar */
.stats-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #64748b;
    flex-shrink: 0;
}

.stat-sep {
    color: #334155;
}

.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .main-card {
        flex-direction: column;
        height: auto;
    }

    .input-section {
        border-right: none;
        border-bottom: 1px solid var(--jf-border);
        padding: 2rem;
    }

    .display-section {
        padding: 2rem;
        min-height: 350px;
    }

    .brand h1 {
        font-size: 1.8rem;
    }

    .action-bar {
        flex-wrap: wrap;
    }
}
