/* ================================================================
   style.css — HoJin Choi Portfolio
   공통 스타일 (index.html / project.html / article.html 공유)
   ================================================================ */

/* ── CSS 변수 ── */
:root {
    --primary-color: #3b82f6;
    --secondary-color: #2563eb;
    --accent-color: #60a5fa;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-dark: #0f172a;
    --border-color: #1e3a5f;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.5);
    --aviation-blue: #3b82f6;
    --tech-green: #10b981;
}

/* ── 리셋 & 기본 ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; line-height: 1.6; color: var(--text-primary); background-color: var(--bg-primary); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ── 공통 버튼 ── */
.btn { padding: 12px 24px; border: none; border-radius: 8px; font-weight: 600; text-decoration: none; cursor: pointer; transition: all 0.3s ease; display: inline-block; font-size: 1rem; font-family: inherit; }
.btn-primary { background: #1e3a8a; color: #e0f2fe; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--secondary-color); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-secondary { background: transparent; color: var(--aviation-blue); border: 2px solid var(--aviation-blue); }
.btn-secondary:hover { background: #1e3a8a; color: #e0f2fe; transform: translateY(-2px); }

/* ── 섹션 제목 ── */
.section-title { font-size: 2.5rem; font-weight: 700; text-align: center; margin-bottom: 3rem; color: var(--text-primary); position: relative; }
.section-title::after { content: ''; position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); width: 60px; height: 3px; background: var(--aviation-blue); border-radius: 2px; }

/* ── 애니메이션 ── */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
.fade-in-up { animation: fadeInUp 0.6s ease-out; }

/* ── 헤더 / 네비 (index용) ── */
.header { position: fixed; top: 0; left: 0; right: 0; background: var(--bg-primary); box-shadow: var(--shadow); z-index: 1000; transition: all 0.3s ease; }
.nav-container { display: flex; justify-content: space-between; align-items: center; padding: 1rem 2rem; max-width: 1200px; margin: 0 auto; }
.nav-logo h1 { font-size: 1.5rem; font-weight: 700; color: var(--aviation-blue); }
.nav-menu { display: flex; list-style: none; gap: 2rem; }
.nav-link { text-decoration: none; color: var(--text-primary); font-weight: 500; transition: color 0.3s ease; position: relative; }
.nav-link:hover { color: var(--aviation-blue); }

/* ── 페이지 히어로 ── */
.page-hero { padding: 4rem 1rem 2rem; text-align: center; background: linear-gradient(to bottom, #1e293b, #0f172a); }
.page-hero h1 { font-size: 2.5rem; margin-bottom: 0.5rem; }
.page-hero p { color: var(--text-secondary); }

/* ── 필터 버튼 ── */
.filters { display: flex; justify-content: center; gap: 0.75rem; margin: 2rem 0; flex-wrap: wrap; }
.filter-btn { padding: 0.5rem 1.2rem; border-radius: 999px; border: 1px solid var(--border-color); background: transparent; color: var(--text-secondary); cursor: pointer; transition: all 0.3s ease; }
.filter-btn.active, .filter-btn:hover { background: var(--aviation-blue); color: white; border-color: var(--aviation-blue); }

/* ── 그리드 ── */
.projects-grid, .articles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 2rem; max-width: 1200px; margin: 0 auto; padding: 0 1.5rem 4rem; }

/* ── 카드 공통 ── */
.project-card, .article-card { background: var(--bg-secondary); border-radius: 16px; border: 1px solid var(--border-color); overflow: hidden; transition: all 0.3s ease; display: flex; flex-direction: column; cursor: pointer; }
.project-card:hover, .article-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--accent-color); }

.project-image { height: 160px; background: linear-gradient(135deg, #3b82f6, #1d4ed8); display: flex; align-items: center; justify-content: center; font-size: 4rem; }
.project-content, .card-body { padding: 1.5rem; flex-grow: 1; }

.card-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; gap: 1rem; }
.card-meta .card-date { margin-left: auto; white-space: nowrap; }
.project-type, .cat-badge { display: inline-block; padding: 0.25rem 0.75rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; border: 1px solid rgba(255,255,255,0.1); }
.type-aviation, .cat-insight { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.type-ai, .cat-review { background: rgba(168, 85, 247, 0.2); color: #c084fc; }
.type-data { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.type-statistics, .cat-statistics { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.cat-certificate { background: rgba(16, 185, 129, 0.2); color: #34d399; }

.project-title, .card-title { font-size: 1.25rem; margin-bottom: 0.75rem; }
.project-description, .card-excerpt { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 1.25rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.project-tech { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tech-tag { background: rgba(255,255,255,0.05); padding: 0.2rem 0.6rem; border-radius: 8px; font-size: 0.7rem; color: var(--text-secondary); border: 1px solid var(--border-color); }

/* ── 카드 푸터 (버튼 영역) ── */
.card-footer-bar { padding: 1rem 1.5rem; border-top: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; background: rgba(0,0,0,0.1); }
.card-date { font-size: 0.8rem; color: var(--text-secondary); }
.view-hint, .card-read { color: var(--aviation-blue); font-size: 0.9rem; font-weight: 500; }

.card-actions { display: flex; gap: 0.5rem; align-items: center; }
.edit-btn, .delete-btn { padding: 0.35rem 0.8rem; border-radius: 6px; font-size: 0.8rem; cursor: pointer; transition: all 0.3s ease; font-family: inherit; }
.edit-btn { background: transparent; border: 1px solid var(--aviation-blue); color: var(--accent-color); }
.edit-btn:hover { background: rgba(59, 130, 246, 0.1); }
.delete-btn { background: transparent; border: 1px solid #ef4444; color: #f87171; }
.delete-btn:hover { background: rgba(239, 68, 68, 0.1); }

/* ── 모달 공통 ── */
.modal-overlay, .write-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 1rem; }
.modal-overlay.active, .write-overlay.active { display: flex; }
.modal-box, .write-modal { background: var(--bg-secondary); width: 100%; max-width: 800px; max-height: 90vh; border-radius: 20px; position: relative; padding: 2.5rem; overflow-y: auto; border: 1px solid var(--border-color); }
.modal-close-btn, .write-modal-close { position: absolute; top: 1.25rem; right: 1.25rem; background: none; border: none; color: var(--text-secondary); font-size: 1.5rem; cursor: pointer; }

/* ── 디테일 뷰 (Article 전용) ── */
#detailView { max-width: 800px; margin: 0 auto; padding: 4rem 1.5rem; display: none; }
.back-btn { background: none; border: none; color: var(--aviation-blue); cursor: pointer; margin-bottom: 2rem; font-size: 1rem; }
.detail-meta { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 1rem; }
#detailContent h1 { font-size: 2.5rem; margin-bottom: 2rem; line-height: 1.2; }

/* ── 글쓰기 폼 스타일 ── */
.wm-label { display: block; margin: 1.2rem 0 0.5rem; font-weight: 600; font-size: 0.9rem; color: var(--accent-color); text-transform: uppercase; letter-spacing: 0.05em; }
.wm-input, .wm-select, .wm-textarea { width: 100%; padding: 0.8rem; background: #1e293b; border: 1px solid #334155; border-radius: 8px; color: white; font-family: inherit; }
.wm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.wm-submit { width: 100%; padding: 1rem; margin-top: 2rem; background: var(--aviation-blue); border: none; border-radius: 8px; color: white; font-weight: 700; cursor: pointer; transition: all 0.3s ease; }
.wm-submit:hover { background: #2563eb; transform: translateY(-2px); }

/* ── Quill 에디터 커스텀 ── */
.editor-container { margin-bottom: 1.5rem; }
.ql-toolbar.ql-snow { border-color: #334155 !important; background: #0f172a; border-radius: 8px 8px 0 0; }
.ql-container.ql-snow { border-color: #334155 !important; border-radius: 0 0 8px 8px; font-size: 1rem; min-height: 200px; }
.ql-editor.ql-blank::before { color: #64748b !important; }

/* ── FAB ── */
.fab-group { position: fixed; bottom: 2rem; right: 2rem; display: flex; flex-direction: column; gap: 1rem; z-index: 999; }
.fab { width: 56px; height: 56px; border-radius: 50%; background: var(--bg-secondary); border: 2px solid var(--border-color); color: white; font-size: 1.5rem; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,0.4); transition: all 0.3s ease; }
.fab:hover { transform: scale(1.1); border-color: var(--accent-color); }

/* ── 토스트 ── */
.toast { position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%) translateY(100px); background: #10b981; color: white; padding: 0.8rem 1.5rem; border-radius: 999px; font-weight: 600; z-index: 2000; transition: transform 0.3s ease; }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { background: #ef4444; }

/* 모달 상세 설명 */
.modal-detail-content { line-height: 1.8; color: #cbd5e1; }
.modal-section { margin-bottom: 1.5rem; }
.modal-title { margin-top: 0.75rem; margin-bottom: 1.5rem; }
.modal-section h3 { font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: #94a3b8; margin-bottom: 0.5rem; }
.modal-section p { color: #cbd5e1; line-height: 1.8; margin: 0; }
.modal-detail-content p { margin-bottom: 1rem; }
.modal-detail-content h1, .modal-detail-content h2, .modal-detail-content h3 { margin-top: 1rem; margin-bottom: 0.5rem; color: #f1f5f9; }
.modal-detail-content strong { color: #e0f2fe; font-weight: 600; }
.modal-detail-content em { color: #cbd5e1; }
.modal-detail-content ul, .modal-detail-content ol { margin-left: 1.5rem; margin-bottom: 1rem; }
.modal-detail-content li { margin-bottom: 0.5rem; }
.modal-detail-content blockquote { border-left: 3px solid #3b82f6; padding-left: 1rem; margin-left: 0; margin-bottom: 1rem; color: #94a3b8; }
.modal-detail-content code { background: #0f172a; padding: 0.2rem 0.4rem; border-radius: 4px; color: #fbbf24; font-family: 'Courier New', monospace; }
.modal-detail-content pre { background: #0f172a; padding: 1rem; border-radius: 8px; overflow-x: auto; margin-bottom: 1rem; }
.modal-detail-content pre code { background: none; padding: 0; color: #cbd5e1; }
