:root {
    --bg-main: #0a0a0c;
    --bg-side: #121214;
    --card-bg: #1c1c1e;
    --accent: #3d8bff;
    --text-primary: #ffffff;
    --text-secondary: #a1a1a6;
    --border: rgba(255, 255, 255, 0.1);
    --input-bg: #2c2c2e;
}

[data-theme='light'] {
    --bg-main: #f2f2f7;
    --bg-side: #ffffff;
    --card-bg: #ffffff;
    --accent: #007aff;
    --text-primary: #1c1c1e;
    --text-secondary: #8e8e93;
    --border: rgba(0, 0, 0, 0.1);
    --input-bg: #e5e5ea;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Pretendard', -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    overflow: hidden;
    transition: background 0.3s;
}

.app-container {
    display: flex;
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
    height: 100vh;
}

/* 사이드바 */
.sidebar {
    width: 400px;
    background: var(--bg-side);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.chat-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-input-wrapper {
    padding: 20px;
    border-top: 1px solid var(--border);
}

/* 메인 영역 */
.main-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-main);
}

.history-strip {
    height: 110px;
    padding: 10px;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
    background: var(--bg-side);
}

.viewport {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

.image-display {
    width: 100%;
    max-width: 700px;
    aspect-ratio: 1;
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#empty-hint {
    text-align: center;
    color: var(--text-secondary);
}

#empty-hint div {
    font-size: 4rem;
    margin-bottom: 15px;
}

/* 입력창 공통 */
.prompt-box {
    background: var(--input-bg);
    border-radius: 15px;
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 10px;
    font-size: 0.95rem;
    outline: none;
    resize: none;
    font-family: inherit;
}

.btn-action {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}

.btn-action:hover { opacity: 0.9; transform: scale(1.02); }
.btn-action:disabled { opacity: 0.5; cursor: not-allowed; }

.control-bar {
    padding: 20px 40px;
}

/* 메시지 스타일 */
.message {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.5;
    max-width: 85%;
}

.user-msg { background: var(--accent); color: white; align-self: flex-end; border-bottom-right-radius: 4px; }
.ai-msg { background: var(--input-bg); color: var(--text-primary); align-self: flex-start; border-bottom-left-radius: 4px; }

/* 히스토리 카드 */
.history-card {
    width: 85px;
    height: 85px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: 0.2s;
}
.history-card:hover { transform: translateY(-5px); border-color: var(--accent); }

/* 모달 */
.modal-overlay {
    backdrop-filter: blur(10px);
}
