/* ==========================================
   VibePlan AI - Cyberpunk Neon Glassmorphism CSS
   ========================================== */

/* 1. 디자인 토큰 및 변수 */
:root {
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* 사이버펑크 네온 색상 */
    --color-bg-dark: #070614;
    --color-neon-purple: hsl(280, 100%, 65%);
    --color-neon-cyan: hsl(190, 100%, 55%);
    --color-neon-gold: hsl(45, 100%, 60%);
    --color-neon-danger: hsl(355, 90%, 65%);
    
    --color-text-primary: rgba(255, 255, 255, 0.95);
    --color-text-secondary: rgba(255, 255, 255, 0.68);
    --color-text-muted: rgba(255, 255, 255, 0.45);
    
    /* 글래스모피즘 설정 */
    --glass-bg: rgba(20, 18, 38, 0.55);
    --glass-bg-hover: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-border-cyan: rgba(0, 229, 255, 0.3);
    --glass-border-purple: rgba(186, 85, 211, 0.3);
    --glass-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
    
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-bounce: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 2. 전역 스타일 및 사이버펑크 배경 */
body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    color: var(--color-text-primary);
    background: linear-gradient(135deg, #05040d 0%, #100a20 50%, #030208 100%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 3. 전체 레이아웃 (2단 구조) */
.app-container {
    display: grid;
    grid-template-columns: 340px 1fr;
    min-height: 100vh;
    width: 100%;
}

/* 4. 왼쪽 컨트롤 패널 */
.control-panel {
    background: rgba(8, 7, 18, 0.85);
    border-right: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 30px 24px;
    display: flex;
    flex-direction: column;
    height: 100vh;
    box-sizing: border-box;
    position: sticky;
    top: 0;
    z-index: 10;
    overflow-y: auto;
}

/* 스크롤바 커스텀 */
.control-panel::-webkit-scrollbar {
    width: 4px;
}
.control-panel::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}

.panel-header {
    margin-bottom: 30px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 28px;
    height: 28px;
}

.logo h1 {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.5px;
    color: white;
}

.accent-text {
    color: var(--color-neon-cyan);
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
    font-style: italic;
}

.logo-sub {
    font-size: 11px;
    color: var(--color-text-secondary);
    margin: 6px 0 0 0;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* 섹션 타이틀 */
.section-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--color-neon-purple);
    text-shadow: 0 0 8px rgba(186, 85, 211, 0.3);
    margin-bottom: 12px;
    text-transform: uppercase;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 8px;
    margin-top: 25px;
    margin-bottom: 15px;
    text-transform: uppercase;
}

/* 입력 세션 */
.input-section {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

#vibe-input {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    padding: 14px;
    font-size: 13.5px;
    line-height: 1.6;
    height: 110px;
    resize: none;
    outline: none;
    transition: var(--transition-smooth);
    font-family: var(--font-body);
}

#vibe-input:focus {
    border-color: var(--color-neon-purple);
    box-shadow: 0 0 15px rgba(186, 85, 211, 0.25);
    background: rgba(0, 0, 0, 0.55);
}

/* 폼 그룹 */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 15px;
}

.form-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.form-group input, .form-group select {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: white;
    padding: 10px 12px;
    font-size: 13px;
    outline: none;
    transition: var(--transition-smooth);
    width: 100%;
    box-sizing: border-box;
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--color-neon-cyan);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}

.form-group select option {
    background: #0f0e1c;
    color: white;
}

/* 네온 버튼 스타일 */
.neon-btn {
    background: transparent;
    border: 1px solid var(--color-neon-purple);
    color: white;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 15px rgba(186, 85, 211, 0.15);
}

.neon-btn:hover {
    background: var(--color-neon-purple);
    box-shadow: 0 0 25px rgba(186, 85, 211, 0.55);
    transform: translateY(-2px);
}

.neon-btn:active {
    transform: translateY(0);
}

/* 사이드바 하단 */
.panel-footer {
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 15px;
}

.footer-note {
    font-size: 10px;
    color: var(--color-text-muted);
    line-height: 1.5;
    margin-top: 0;
    margin-bottom: 10px;
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-neon-cyan);
    font-size: 11px;
    text-decoration: none;
    font-weight: 600;
}

.footer-links a:hover {
    text-shadow: 0 0 6px rgba(0, 229, 255, 0.6);
}

/* 5. 오른쪽 메인 워크스페이스 */
.workspace {
    padding: 40px;
    height: 100vh;
    box-sizing: border-box;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* 웰컴 화면 */
.welcome-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
}

.welcome-box {
    text-align: center;
    max-width: 500px;
    padding: 40px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.welcome-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 20px;
}

.welcome-box h2 {
    font-family: var(--font-heading);
    font-size: 28px;
    margin-top: 0;
    margin-bottom: 12px;
}

.welcome-box p {
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.hint-text {
    font-size: 12px !important;
    color: var(--color-text-muted) !important;
}

/* 추천 리스트 화면 */
.recommend-view {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin-top: auto;
    margin-bottom: auto;
}

.view-title {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 800;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.view-sub {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-top: 0;
    margin-bottom: 30px;
}

.recommend-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
}

.recommend-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--glass-shadow);
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 250px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.recommend-card:hover {
    border-color: var(--color-neon-cyan);
    box-shadow: 0 10px 30px rgba(0, 229, 255, 0.15);
    transform: translateY(-5px);
}

.card-emoji {
    font-size: 32px;
    margin-bottom: 16px;
    display: block;
}

.recommend-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 10px;
    color: white;
}

.card-summary {
    font-size: 13.5px;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
    flex-grow: 1;
}

.select-concept-btn {
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid var(--color-neon-cyan);
    color: var(--color-neon-cyan);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: var(--transition-smooth);
}

.select-concept-btn:hover {
    background: var(--color-neon-cyan);
    color: #05040d;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.45);
}

/* 6. 상세 기획 플래너 워크스페이스 */
.planner-workspace {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.workspace-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.active-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    color: var(--color-neon-cyan);
}

#active-project-title {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 800;
    margin: 6px 0 4px 0;
}

#active-project-summary {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin: 0;
}

.action-buttons {
    display: flex;
    gap: 12px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--color-text-secondary);
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.action-btn:hover {
    background: var(--glass-bg-hover);
    color: white;
    border-color: var(--color-text-secondary);
}

.btn-danger:hover {
    border-color: var(--color-neon-danger);
    color: var(--color-neon-danger);
}

/* 탭 버튼 스타일 */
.tabs-container {
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-smooth);
}

.tab-btn.active {
    background: var(--glass-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--color-neon-cyan);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* 탭 본문 */
.tab-contents {
    flex-grow: 1;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--glass-shadow);
    overflow-y: auto;
    height: calc(100vh - 280px);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 마크다운 스타일링 (매우 중요) */
.markdown-body {
    line-height: 1.8;
    font-size: 14.5px;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
    font-family: var(--font-heading);
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 700;
    color: white;
}

.markdown-body h1 {
    font-size: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

.markdown-body h2 {
    font-size: 19px;
    color: var(--color-neon-cyan);
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.15);
}

.markdown-body h3 {
    font-size: 16px;
}

.markdown-body p {
    margin-bottom: 16px;
    color: var(--color-text-secondary);
}

.markdown-body ul, .markdown-body ol {
    padding-left: 20px;
    margin-bottom: 16px;
    color: var(--color-text-secondary);
}

.markdown-body li {
    margin-bottom: 8px;
}

/* 마크다운 테이블 디자인 (글래스모피즘 테이블) */
.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
    margin-top: 12px;
}

.markdown-body th, .markdown-body td {
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
}

.markdown-body th {
    background: rgba(255, 255, 255, 0.04);
    font-weight: 600;
    color: white;
}

.markdown-body tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

/* 4장 프롬프트 가이드 스타일 */
.prompt-instruction-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 229, 255, 0.05);
    border: 1px solid rgba(0, 229, 255, 0.15);
    border-radius: 12px;
    padding: 12px 20px;
    margin-bottom: 24px;
}

.prompt-instruction-banner i {
    width: 20px;
    height: 20px;
    color: var(--color-neon-cyan);
    flex-shrink: 0;
}

.prompt-instruction-banner p {
    margin: 0;
    font-size: 13.5px;
    color: var(--color-text-secondary);
}

.prompt-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.prompt-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
}

.prompt-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.prompt-card-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: white;
}

.copy-prompt-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    color: var(--color-text-secondary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.copy-prompt-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.copy-prompt-btn.copied {
    border-color: var(--color-neon-gold);
    color: var(--color-neon-gold);
    background: rgba(255, 191, 0, 0.06);
}

.prompt-body {
    padding: 20px;
}

.prompt-body pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13.5px;
    color: var(--color-text-secondary);
    line-height: 1.7;
}

/* 7. 로딩 오버레이 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(3, 2, 7, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.loader-box {
    text-align: center;
    max-width: 400px;
}

.neon-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(0, 229, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--color-neon-cyan);
    border-bottom-color: var(--color-neon-purple);
    margin: 0 auto 24px auto;
    animation: spin 1.2s linear infinite;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.25);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-status {
    font-size: 16px;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
}

.loading-sub {
    font-size: 12px;
    color: var(--color-text-muted);
    margin: 0;
}

/* 네온 펄스 애니메이션 */
.glow-purple {
    filter: drop-shadow(0 0 6px var(--color-neon-purple));
}
.glow-cyan {
    filter: drop-shadow(0 0 6px var(--color-neon-cyan));
}

.glow-cyan-border {
    border: 1px solid var(--color-neon-cyan);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.25);
}

/* 8. 반응형 모바일 디자인 */
@media (max-width: 1024px) {
    .app-container {
        grid-template-columns: 1fr;
    }
    
    .control-panel {
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
        position: relative;
    }
    
    .workspace {
        height: auto;
        padding: 24px;
    }
    
    .recommend-grid {
        grid-template-columns: 1fr;
    }
    
    .tab-contents {
        height: auto;
        min-height: 400px;
    }
}
