/**
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 * ⚡ APC System - Modal Stylesheet
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 * 📁 파일명: /www/_acc/css/modal.css
 * 📌 버전: v1.5
 * 📅 작성일: 2025-12-16
 * 📝 설명: copy-btn-main 투명 border 추가 (높이 통일)
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 */

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 * Modal Overlay
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.modal-overlay {
    display: none;
    position: fixed; 
    z-index: 9999;
    top: 0;
    left: 0; 
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    justify-content: center; 
    align-items: center;
    padding: 40px; 
    box-sizing: border-box;
    backdrop-filter: blur(5px);
}

.modal-overlay.active {
    display: flex;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 * Modal Content
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.modal-content {
    background: #ffffff;
    width: 100%; 
    max-width: 1100px; 
    max-height: 90vh;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 * Modal Body - 데스크톱 레이아웃
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.modal-body { 
    display: grid;
    grid-template-columns: 460px 1fr;
    height: auto;
    max-height: 90vh;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 * Modal Left - 이미지 영역
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.modal-left {
    width: 460px;
    min-width: 460px;
    flex-shrink: 0;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 30px;
    box-sizing: border-box;
    overflow-y: auto;
}

.img-container { 
    width: 400px;
    height: 600px;
    min-width: 400px;
    min-height: 600px;
    flex-shrink: 0;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    overflow: hidden;
    border-radius: 12px;
    background: #f0f0f0;
}

.img-container img { 
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

/* 이미지 편집 영역 */
.edit-image-section {
    display: flex;
    flex-direction: row;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
    padding: 10px;
    background: #fef3c7;
    border-radius: 8px;
    align-items: center;
    box-sizing: border-box;
}

.edit-image-section .edit-input {
    flex: 1;
    margin-top: 0;
    min-width: 0;
}

.edit-image-section .btn-sm {
    flex-shrink: 0;
    padding: 8px 12px;
    white-space: nowrap;
    background: #d97706;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.edit-image-section .btn-sm:hover {
    background: #b45309;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 * Modal Right - 정보 영역
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.modal-right {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background: var(--bg);
}

/* 헤더 영역 - 고정 */
.modal-right-header {
    flex-shrink: 0;
    padding: 25px 25px 15px 25px;
    border-bottom: 1px solid #fde68a;
    background: transparent;
}

/* 프롬프트 영역 - 스크롤 */
.modal-right-body {
    flex: 0 0 auto;
    max-height: 40vh;
    overflow-y: auto;
    padding: 15px 25px;
    display: flex;
    flex-direction: column;
    background: transparent;
}

/* 버튼 영역 - 하단 고정 */
.modal-right-footer {
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
    background: transparent;
    border-top: 1px solid #fde68a;
}

/* Copy 버튼을 오른쪽 끝으로 */
.modal-right-footer .copy-btn-main {
    margin-left: auto;
}

/* 버튼 공통 텍스트 */
.btn-text {
    margin-left: 6px;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 * Modal 공통 요소 스타일
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #FF6B35;
    margin: 0 0 12px 0;
    line-height: 1.4;
    word-break: break-word;
}

.header-top-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

/* 관리 버튼 */
.admin-controls { 
    display: flex; 
    flex-direction: row;
    gap: 8px; 
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: background 0.2s;
    opacity: 0.5;
    color: #333;
}

.icon-btn:hover {
    opacity: 1;
}

.delete-btn:hover {
    background: #fee2e2;
    color: #ef4444;
}

.edit-btn:hover {
    background: #fef3c7;
    color: #d97706;
}

.user-text h2 { 
    margin: 0; 
    font-size: 1.4rem; 
    color: #FF6B35;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 * Tags
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.tags-display-area {
    display: flex; 
    flex-direction: row;
    gap: 8px; 
    flex-wrap: wrap; 
    margin-top: 10px;
}

.tag-pill {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-badge { 
    background: #fef3c7;
    color: #d97706;
    border: 1px solid #fde68a; 
}

.hash-tag { 
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
    font-size: 0.85rem; 
    text-transform: none;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 * Edit Inputs
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.edit-select {
    padding: 8px 12px;
    border: 1px solid #fde68a;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #92400e;
    background: #fef3c7;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
}

.edit-select:focus {
    border-color: #FF6B35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.edit-input {
    width: 100%;
    padding: 8px;
    margin-top: 10px;
    border: 1px solid #fde68a;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: monospace;
    box-sizing: border-box;
}

.edit-input:focus {
    outline: none;
    border-color: #FF6B35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.edit-textarea {
    width: 100%;
    height: 100%;
    min-height: 200px;
    padding: 10px;
    border: 1px solid #fde68a;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: monospace;
    line-height: 1.5;
    resize: none;
    box-sizing: border-box;
}

.edit-textarea:focus {
    outline: none;
    border-color: #FF6B35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.save-btn {
    background: #10b981;
    color: white;
}

.save-btn:hover {
    background: #059669;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 * 프롬프트 영역
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
/* 모달 프롬프트 줄바꿈 유지 (강제 적용) */
#modalPrompt {
    white-space: pre-wrap !important;
    word-break: break-word !important;
    margin: 0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.7;
    color: #374151;
}

.section-label { 
    display: block; 
    font-size: 0.8rem; 
    font-weight: 700; 
    color: #d97706;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.prompt-text-area {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px; 
    padding: 15px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.prompt-text-area p {
    margin: 0; 
    white-space: pre-wrap !important;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #374151;
    word-break: break-word;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 * 액션 버튼
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.action-btn {
    padding: 12px 20px; 
    border-radius: 10px; 
    font-weight: 600; 
    font-size: 0.95rem; 
    cursor: pointer; 
    border: none; 
    display: inline-flex;
    align-items: center; 
    justify-content: center; 
    gap: 6px; 
    transition: all 0.2s;
    white-space: nowrap;
}

.link-btn {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.link-btn:hover {
    background: #fde68a;
    color: #78350f;
}

.copy-btn-main {
    background: linear-gradient(135deg, #f59e0b 0%, #FF6B35 100%);
    color: white;
    border: 1px solid transparent;  /* ★ 높이 통일을 위한 투명 border */
}

.copy-btn-main:hover { 
    background: linear-gradient(135deg, #FF6B35 0%, #E91E63 100%);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3); 
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 * [A-4] 모달 메타정보 패널
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.modal-meta-panel {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    padding: 12px 15px;
    background: linear-gradient(135deg, #fef3c7 0%, #fff7ed 100%);
    border-radius: 10px;
    border: 1px solid #fde68a;
}

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

.meta-icon {
    font-size: 1rem;
}

.meta-label {
    font-size: 0.75rem;
    color: #92400e;
    font-weight: 500;
}

.meta-value {
    font-size: 0.85rem;
    color: #d97706;
    font-weight: 700;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 * [A-5] 다운로드 버튼
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.download-btn {
    background: #fff7ed;
    color: #92400e;
    border: 1px solid #fed7aa;
}

.download-btn:hover {
    background: #ffedd5;
    color: #78350f;
    border-color: #fdba74;
}

/* ★★★ 모달 푸터 버튼 높이 통일 ★★★ */
.modal-right-footer .action-btn {
    padding: 10px 16px;
    min-height: 42px;
    box-sizing: border-box;
}