/**
 * YAML ↔ JSON Converter Styles
 * YAML-JSON 변환기 전용 스타일 (2컬럼 레이아웃)
 *
 * @package Zipper
 */

/* ===== 툴바 ===== */
.yj-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    margin-bottom: 12px;
    align-items: center;
}

.yj-toolbar-group {
    display: flex;
    gap: 4px;
    align-items: center;
}

.yj-toolbar-divider {
    width: 1px;
    height: 24px;
    background: #e8e4dc;
    margin: 0 4px;
}

.yj-toolbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    background: #faf9f7;
    color: #5f5a56;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.yj-toolbar-btn:hover {
    border-color: #d4af37;
    color: #d4af37;
}

.yj-toolbar-btn.active {
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    border-color: #d4af37;
    color: #fff;
}

.yj-toolbar-btn i {
    font-size: 14px;
}

.yj-toolbar-btn.yj-btn-primary {
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    border-color: #d4af37;
    color: #fff;
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.25);
}

.yj-toolbar-btn.yj-btn-primary:hover {
    background: linear-gradient(135deg, #b8860b 0%, #8b6914 100%);
}

/* 변환 방향 토글 */
.yj-direction-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
}

.yj-direction-btn {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #5f5a56;
    cursor: pointer;
    transition: all 0.2s;
}

.yj-direction-btn.active {
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    color: #fff;
}

.yj-direction-arrow {
    color: #a09a94;
    font-size: 12px;
}

/* 샘플 드롭다운 */
.yj-sample-dropdown {
    position: relative;
}

.yj-sample-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    min-width: 220px;
    margin-top: 4px;
    padding: 4px 0;
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: none;
}

.yj-sample-dropdown.open .yj-sample-menu {
    display: block;
}

.yj-sample-item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-size: 12px;
    text-align: left;
    border: none;
    background: none;
    color: #2d2a26;
    cursor: pointer;
    transition: background 0.2s;
}

.yj-sample-item:hover {
    background: #faf9f7;
    color: #d4af37;
}

.yj-sample-item i {
    margin-right: 6px;
    color: #a09a94;
}

.yj-sample-item:hover i {
    color: #d4af37;
}

/* 옵션 셀렉트 */
.yj-toolbar-select {
    padding: 6px 8px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    background: #faf9f7;
    color: #2d2a26;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 80px;
}

.yj-toolbar-select:hover {
    border-color: #d4af37;
}

.yj-toolbar-select:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.1);
}

.yj-toolbar-label {
    font-size: 11px;
    color: #5f5a56;
    font-weight: 500;
    margin-right: 4px;
}

/* 파일 업로드 */
.yj-file-input {
    display: none;
}

/* ===== 2컬럼 레이아웃 (데스크탑) ===== */
.yj-main-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: stretch;
    min-height: 450px;
}

.yj-input-col,
.yj-output-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* 컬럼 헤더 */
.yj-col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-bottom: none;
    border-radius: 12px 10px 0 0;
}

.yj-col-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #2d2a26;
}

.yj-col-title i {
    color: #d4af37;
}

.yj-col-actions {
    display: flex;
    gap: 4px;
}

.yj-col-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid #e8e4dc;
    border-radius: 4px;
    background: #fff;
    color: #5f5a56;
    cursor: pointer;
    transition: all 0.2s;
}

.yj-col-btn:hover {
    border-color: #d4af37;
    color: #d4af37;
}

/* ===== 에디터 영역 ===== */
.yj-editor-wrapper {
    flex: 1;
    display: flex;
    border: 1px solid #e8e4dc;
    border-top: none;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
    background: #fff;
}

.yj-line-numbers {
    flex-shrink: 0;
    padding: 12px 8px 12px 12px;
    background: #faf9f7;
    color: #a09a94;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 20px;
    text-align: right;
    user-select: none;
    border-right: 1px solid #e8e4dc;
    min-width: 48px;
    overflow: hidden;
}

.yj-line-numbers-inner {
    display: flex;
    flex-direction: column;
}

.yj-line-numbers .yj-line-num {
    display: block;
    height: 20px;
    line-height: 20px;
}

.yj-editor-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.yj-editor-highlight,
.yj-editor-textarea {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    padding: 12px;
    box-sizing: border-box;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 20px;
    white-space: pre;
    overflow: auto;
    word-wrap: normal;
    -webkit-font-smoothing: antialiased;
}

.yj-editor-highlight {
    pointer-events: none;
    color: #2d2a26;
}

.yj-editor-textarea {
    border: none;
    outline: none;
    resize: none;
    background: transparent;
    color: transparent;
    caret-color: #d4af37;
}

.yj-editor-textarea::placeholder {
    color: #a09a94;
}

/* YAML 구문 강조 색상 */
.yj-editor-highlight .yj-key {
    color: #0550ae;
    font-weight: 600;
}

.yj-editor-highlight .yj-string {
    color: #a40e26;
}

.yj-editor-highlight .yj-number {
    color: #8250df;
}

.yj-editor-highlight .yj-boolean {
    color: #cf222e;
    font-weight: 600;
}

.yj-editor-highlight .yj-null {
    color: #6e7781;
    font-style: italic;
}

.yj-editor-highlight .yj-comment {
    color: #6e7781;
    font-style: italic;
}

.yj-editor-highlight .yj-bracket {
    color: #1f2328;
}

.yj-editor-highlight .yj-colon {
    color: #5f5a56;
}

.yj-editor-highlight .yj-dash {
    color: #cf222e;
}

.yj-editor-highlight .yj-anchor {
    color: #6639ba;
}

/* JSON 구문 강조 색상 */
.yj-editor-highlight .yj-json-key {
    color: #0550ae;
}

.yj-editor-highlight .yj-json-string {
    color: #a40e26;
}

.yj-editor-highlight .yj-json-number {
    color: #8250df;
}

.yj-editor-highlight .yj-json-boolean {
    color: #cf222e;
    font-weight: 600;
}

.yj-editor-highlight .yj-json-null {
    color: #6e7781;
    font-style: italic;
}

/* ===== 결과 영역 ===== */
.yj-output-wrapper {
    flex: 1;
    display: flex;
    border: 1px solid #e8e4dc;
    border-top: none;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
    background: #fff;
}

.yj-output-highlight {
    flex: 1;
    margin: 0;
    padding: 12px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 20px;
    white-space: pre;
    overflow: auto;
    word-wrap: normal;
    color: #2d2a26;
    background: #fff;
}

/* ===== 유효성 검증 영역 ===== */
.yj-validation {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-top: none;
    font-size: 12px;
}

.yj-validation.valid {
    background: rgba(39, 174, 96, 0.08);
    border-color: rgba(39, 174, 96, 0.3);
}

.yj-validation.valid i {
    color: #27ae60;
}

.yj-validation.invalid {
    background: rgba(231, 76, 60, 0.08);
    border-color: rgba(231, 76, 60, 0.3);
}

.yj-validation.invalid i {
    color: #e74c3c;
}

.yj-validation-text {
    color: #5f5a56;
}

.yj-validation.valid .yj-validation-text {
    color: #27ae60;
}

.yj-validation.invalid .yj-validation-text {
    color: #e74c3c;
}

/* ===== 통계 영역 ===== */
.yj-stats-section {
    display: flex;
    gap: 16px;
    padding: 12px;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    margin-top: 12px;
}

.yj-stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.yj-stat-label {
    font-size: 12px;
    color: #5f5a56;
}

.yj-stat-value {
    font-size: 13px;
    font-weight: 600;
    color: #2d2a26;
}

/* ===== 자동 저장 표시 ===== */
.yj-autosave-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #a09a94;
    margin-left: auto;
}

.yj-autosave-indicator i {
    font-size: 12px;
}

.yj-autosave-indicator.saving {
    color: #f39c12;
}

.yj-autosave-indicator.saved {
    color: #27ae60;
}

/* ===== 면책조항 ===== */
.yj-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: rgba(108, 117, 125, 0.08);
    border-radius: 8px;
    margin-top: 12px;
}

.yj-disclaimer i {
    color: #6c757d;
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

.yj-disclaimer-text {
    font-size: 12px;
    color: #5f5a56;
    line-height: 1.5;
}

/* ===== 반응형 - 태블릿 ===== */
@media (max-width: 900px) {
    .yj-main-layout {
        min-height: 350px;
    }

    .yj-toolbar {
        gap: 6px;
        padding: 10px;
    }

    .yj-toolbar-btn {
        padding: 5px 8px;
        font-size: 11px;
    }

    .yj-toolbar-btn span {
        display: none;
    }

    .yj-toolbar-btn i {
        font-size: 16px;
    }

    .yj-toolbar-select {
        min-width: 70px;
        padding: 5px 6px;
        font-size: 11px;
    }

    .yj-toolbar-label {
        display: none;
    }

    .yj-direction-btn {
        padding: 5px 8px;
        font-size: 11px;
    }

    .yj-stats-section {
        flex-wrap: wrap;
        gap: 12px;
    }
}

/* ===== 반응형 - 모바일 ===== */
@media (max-width: 768px) {
    .yj-main-layout {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .yj-input-col,
    .yj-output-col {
        min-height: 280px;
    }

    .yj-toolbar-divider {
        display: none;
    }

    .yj-toolbar-group {
        flex-wrap: wrap;
    }

    .yj-line-numbers {
        padding: 10px 6px 10px 8px;
        font-size: 12px;
        line-height: 18px;
        min-width: 36px;
    }

    .yj-line-numbers .yj-line-num {
        height: 18px;
        line-height: 18px;
    }

    .yj-editor-textarea,
    .yj-editor-highlight,
    .yj-output-highlight {
        padding: 10px;
        font-size: 12px;
        line-height: 18px;
    }

    .yj-validation {
        border-radius: 0 0 10px 10px;
    }
}

/* ===== 반응형 - 작은 모바일 ===== */
@media (max-width: 480px) {
    .yj-toolbar {
        padding: 8px;
    }

    .yj-toolbar-btn {
        padding: 4px 6px;
        font-size: 10px;
    }

    .yj-col-header {
        padding: 8px 10px;
    }

    .yj-col-title {
        font-size: 12px;
    }

    .yj-col-btn {
        width: 24px;
        height: 24px;
    }

    .yj-input-col,
    .yj-output-col {
        min-height: 220px;
    }

    .yj-stats-section {
        flex-direction: column;
        gap: 8px;
    }

    .yj-direction-toggle {
        width: 100%;
        justify-content: center;
    }

    .yj-direction-btn {
        flex: 1;
        text-align: center;
    }
}
