/**
 * Inquiry Modal Component Styles
 * 코스 요청/문의 모달 컴포넌트
 */

/* ===================================
   Sidebar Header Actions
   =================================== */

.sidebar-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===================================
   Inquiry Button
   =================================== */

.inquiry-button {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    background: transparent;
    border: 1.5px solid #3b82f6;
    color: #3b82f6;
}

.inquiry-button:hover {
    background: #3b82f6;
    color: white;
    transform: translateY(-1px);
}

/* ===================================
   Inquiry Modal
   =================================== */

.inquiry-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.inquiry-modal-content {
    background: var(--bg-primary);
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.inquiry-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
}

.inquiry-modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.inquiry-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.inquiry-modal-close:hover {
    color: var(--text-primary);
}

.inquiry-modal-body {
    padding: 24px;
}

.inquiry-modal-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

/* ===================================
   Textarea
   =================================== */

.inquiry-textarea {
    width: 100%;
    min-height: 160px;
    padding: 12px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--bg-primary);
    color: var(--text-primary);
    resize: vertical;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.inquiry-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.inquiry-textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* ===================================
   Character Counter
   =================================== */

.inquiry-char-counter {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.inquiry-char-counter.warning {
    color: #f59e0b;
}

.inquiry-char-counter.error {
    color: #ef4444;
}

/* ===================================
   Footer
   =================================== */

.inquiry-modal-footer {
    display: flex;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
}

.inquiry-submit-btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--accent-primary);
    border: none;
    color: white;
}

.inquiry-submit-btn:hover {
    background: var(--accent-secondary);
}

.inquiry-submit-btn.inquiry-btn-inactive {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===================================
   Success State
   =================================== */

.inquiry-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
}

.inquiry-success-icon {
    width: 60px;
    height: 60px;
    background: #22c55e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    margin-bottom: 16px;
}

.inquiry-success h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.inquiry-success p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===================================
   Error Message
   =================================== */

.inquiry-error {
    padding: 10px 14px;
    margin-bottom: 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    display: none;
}

/* ===================================
   Mobile Responsive
   =================================== */

@media (max-width: 768px) {
    .inquiry-modal {
        padding: 16px;
        align-items: center;
    }

    .inquiry-modal-content {
        max-width: 100%;
        max-height: 80vh;
        border-radius: 12px;
    }

    .inquiry-button {
        padding: 5px 10px;
        font-size: 12px;
    }
}

/* ==========================================
   탭
   ========================================== */

.inquiry-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-primary, #e5e5e5);
    padding: 0 20px;
    gap: 4px;
}

.inquiry-tab {
    padding: 12px 14px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary, #888);
    cursor: pointer;
}

.inquiry-tab.active {
    color: var(--text-primary, #222);
    border-bottom-color: #2b7a4b;
}

/* ==========================================
   작성 폼 — 분류 / 제목
   ========================================== */

.inquiry-category-group {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.inquiry-category-chip input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.inquiry-category-chip span {
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid var(--border-primary, #ddd);
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    color: var(--text-secondary, #666);
}

.inquiry-category-chip input:checked + span {
    background: #2b7a4b;
    border-color: #2b7a4b;
    color: #fff;
}

.inquiry-title-input {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 10px;
    border: 1px solid var(--border-primary, #ddd);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    background: transparent;
    color: var(--text-primary, #222);
    box-sizing: border-box;
}

/* ==========================================
   내 문의 내역
   ========================================== */

.inquiry-loading,
.inquiry-empty {
    text-align: center;
    padding: 28px 0;
    font-size: 14px;
    color: var(--text-secondary, #888);
}

.inquiry-history-item {
    border: 1px solid var(--border-primary, #e5e5e5);
    border-radius: 10px;
    margin-bottom: 8px;
    overflow: hidden;
}

.inquiry-history-item.expanded {
    border-color: #2b7a4b;
}

.inquiry-history-head {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 14px 4px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    color: inherit;
}

.inquiry-history-title {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inquiry-history-date {
    font-size: 11px;
    color: var(--text-secondary, #999);
    white-space: nowrap;
}

.inquiry-history-sub {
    padding: 0 14px 12px 14px;
    font-size: 12px;
    color: var(--text-secondary, #999);
}

.inquiry-history-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.inquiry-history-badge.is-open { background: #f44336; color: #fff; }
.inquiry-history-badge.is-answered { background: #2b7a4b; color: #fff; }
.inquiry-history-badge.is-closed { background: #9e9e9e; color: #fff; }

.inquiry-history-body {
    padding: 0 14px 14px;
    border-top: 1px solid var(--border-primary, #eee);
}

/* 대화 */

.inquiry-thread {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 0;
}

.inquiry-bubble {
    padding: 10px 12px;
    border-radius: 10px;
    max-width: 88%;
    font-size: 13px;
}

.inquiry-bubble.from-me {
    background: rgba(0, 0, 0, 0.05);
    align-self: flex-end;
}

.inquiry-bubble.from-admin {
    background: rgba(43, 122, 75, 0.1);
    border-left: 3px solid #2b7a4b;
    align-self: flex-start;
}

.inquiry-bubble-head {
    display: flex;
    gap: 8px;
    align-items: baseline;
    margin-bottom: 4px;
    font-size: 11px;
}

.inquiry-bubble-head span { color: var(--text-secondary, #999); }

.inquiry-bubble-body {
    white-space: pre-wrap;
    line-height: 1.6;
}

/* 이어서 질문 */

.inquiry-followup-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-primary, #ddd);
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    resize: vertical;
    background: transparent;
    color: var(--text-primary, #222);
    box-sizing: border-box;
}

.inquiry-followup-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.inquiry-followup-btn,
.inquiry-delete-btn {
    padding: 7px 16px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    border: 1px solid transparent;
}

.inquiry-followup-btn {
    background: #2b7a4b;
    color: #fff;
}

.inquiry-delete-btn {
    background: transparent;
    border-color: var(--border-primary, #ddd);
    color: var(--text-secondary, #888);
}
