/* JSON 포매터 전용 스타일 */
/* 공통 style.css 이후에 로드됨 */

.json-tool-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ✅ 상단 툴바: 상태(왼쪽) + 버튼(오른쪽) */
.status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-bottom: 6px;
    border-bottom: 1px solid #eef2f7;
}

/* 상태 배지 */
.status-badge {
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #4b5563;

    /* ✅ 한 줄 고집 X */
    white-space: normal;

    /* ✅ 너무 길면 적당히 */
    max-width: 520px;
}

/* 상태 색상 */
.status-ok {
    background: #ecfdf3;
    color: #15803d;
}

.status-error {
    background: #fef2f2;
    color: #b91c1c;
}

/* 버튼들: 가로 정렬 */
.json-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
}

/* ✅ 전역 button 스타일(특히 width:100%) 강제 덮어쓰기 */
.json-actions button {
    width: auto !important;
    display: inline-flex !important;
}

/* 공통 버튼(보조) */
.sub-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #374151;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.1s ease, transform 0.1s ease, border-color 0.15s ease;
}

.sub-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
    transform: translateY(-1px);
}

/* 메인 버튼 */
.primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 10px;
    border: none;
    background: #4f46e5;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.1s ease;
}

.primary-btn:hover {
    background: #4338ca;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
    transform: translateY(-1px);
}

.primary-btn:disabled {
    background: #9ca3af;
    cursor: default;
    box-shadow: none;
    transform: none;
}

/* ✅ 입력/출력 영역: 핵심이니 더 크게 */
.json-grid {
    margin-top: 8px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px 20px;
}

.json-panel h2 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
}

.json-panel textarea {
    width: 100%;
    min-height: 420px; /* ✅ 여기 올리면 체감 확 좋아짐 */
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    background: #f9fafb;
    color: #111827;
    box-sizing: border-box;
}

.json-panel textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.3);
    background: #ffffff;
}

.panel-help {
    margin-top: 6px;
    font-size: 12px;
    color: #6b7280;
}

/* info / faq (기존 그대로) */
.info-section,
.faq-section {
    max-width: 720px;
    margin: 40px auto 0;
    padding: 0 16px;
}

.info-section h2,
.faq-section h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 16px;
}

.info-section p {
    margin-bottom: 12px;
    line-height: 1.7;
    color: #444;
    font-size: 14px;
}

.info-list {
    margin: 8px 0 14px;
    padding-left: 18px;
    font-size: 14px;
    color: #444;
}

.info-list li {
    margin-bottom: 3px;
}

.faq-item {
    border-bottom: 1px solid #e0e0e0;
    padding: 6px 0;
}

.faq-question {
    position: relative;
    width: 100%;
    background: #f9fafb;
    border: none;
    text-align: left;
    padding: 10px 12px 10px 30px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.4;
    color: #111827;
    border-radius: 8px;
}

.faq-question::before {
    content: "▶";
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    color: #6b7280;
}

.faq-item.active .faq-question::before {
    content: "▼";
}

.faq-question:hover {
    background: #eef2ff;
}

.faq-question:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35);
}

.faq-answer {
    display: none;
    padding: 6px 2px 12px;
    color: #555;
    font-size: 14px;
    line-height: 1.7;
}

.faq-item.active .faq-answer {
    display: block;
}

.page-wrapper .footer-text {
    margin-top: 28px;
}

/* 반응형 */
@media (max-width: 900px) {
    .json-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 700px) {
    .status-row {
        flex-direction: column;
        align-items: stretch;
    }

    .json-actions {
        justify-content: flex-start;
    }

    .status-badge {
        max-width: 100%;
    }
}
