/* ==========================================
   📔 Daily Journal Styles
   ========================================== */

/* 일기장 페이지 컨테이너 */
.daily-journal-page {
    padding: 16px 16px 100px 16px; /* 20px → 16px */
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-main);
    min-height: 100vh;
}

/* 섹션 공통 스타일 */
.journal-section {
    margin-bottom: 20px; /* 32px → 20px */
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 16px 0;
}

.section-title i {
    color: var(--primary);
    font-size: 22px;
}

/* 작은 섹션 제목 (컴팩트) */
.section-title-small {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px 0;
}

.section-title-small i {
    color: var(--primary);
    font-size: 18px;
}

.badge-count {
    display: inline-block;
    background: var(--primary);
    color: white;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    margin-left: 4px;
}

/* 헤더 */
.journal-header {
    text-align: center;
    margin-bottom: 16px;
    padding: 20px 0 0 0;
}

.journal-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.journal-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0;
}

/* 로딩 */
.journal-loading {
    text-align: center;
    padding: 60px 20px;
}

.journal-loading p {
    margin-top: 20px;
    color: var(--text-secondary);
}

/* 에러 메시지 */
.error-message {
    text-align: center;
    padding: 60px 20px;
    background: #FEF2F2;
    border-radius: 12px;
    margin: 20px 0;
}

.error-message p {
    color: #DC2626;
    margin-bottom: 20px;
}

.btn-retry {
    padding: 10px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

/* ==========================================
   날짜 네비게이션
   ========================================== */

.date-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
}

.date-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.date-nav-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.date-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.date-display {
    flex: 1;
    text-align: center;
}

.date-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.today-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--primary-color);
    color: white;
    font-size: 11px;
    border-radius: 4px;
    margin-left: 8px;
    font-weight: 600;
}

/* ==========================================
   감정 타임라인
   ========================================== */

/* 컴팩트 타임라인 (세로 1줄씩) */
.emotion-timeline-section-compact {
    margin-bottom: 16px;
}

.emotion-timeline-horizontal {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.emotion-timeline-item-compact {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

.emotion-item-hidden {
    display: none;
}

.emotion-timeline-item-compact:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateX(4px);
}

.btn-show-more-emotions {
    width: 100%;
    padding: 8px;
    margin-top: 8px;
    background: var(--bg-main);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-show-more-emotions:hover {
    background: white;
    color: var(--primary);
    border-color: var(--primary);
}

.emotion-time-compact {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    min-width: 45px;
    flex-shrink: 0;
}

.emotion-icon-inline {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}

.emotion-name-compact {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 400;
    min-width: 100px;
}

.emotion-intensity-compact {
    font-size: 14px;
    color: #FFB800;
    letter-spacing: 2px;
    margin-left: auto;
}

/* 기존 타임라인 (숨김) */
.emotion-timeline-section {
    display: none;
}

.emotion-icon-large {
    display: none;
}

/* 기존 타임라인 (숨김) */
.emotion-timeline-section {
    display: none;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title i {
    color: var(--primary-color);
}

.record-count {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-left: auto;
}

.emotion-timeline {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.timeline-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    position: relative;
}

.timeline-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 68px;
    top: 50px;
    bottom: -16px;
    width: 2px;
    background: linear-gradient(to bottom, var(--border-color), transparent);
}

.timeline-time {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 52px;
    text-align: right;
}

.timeline-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-top: 4px;
    box-shadow: 0 0 0 4px rgba(44, 95, 127, 0.1);
    flex-shrink: 0;
}

.timeline-content {
    flex: 1;
}

.timeline-emotion {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.emotion-icon {
    font-size: 24px;
}

.emotion-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 15px;
}

.emotion-intensity {
    font-size: 12px;
    letter-spacing: 2px;
}

.timeline-notes {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    padding: 8px 12px;
    background: var(--bg-main);
    border-radius: 8px;
    margin-top: 8px;
}

.timeline-strategy {
    font-size: 13px;
    color: var(--primary-color);
    margin-top: 8px;
    font-weight: 500;
}

/* 감정 기록 없음 */
.no-emotion-records {
    padding: 40px 20px;
    text-align: center;
}

.empty-state {
    background: white;
    border-radius: 16px;
    padding: 60px 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.empty-icon {
    font-size: 64px;
    color: var(--border-color);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 24px 0;
}

.btn-primary {
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: #1e4a5f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 95, 127, 0.3);
}

/* ==========================================
   감정 요약
   ========================================== */

/* 컴팩트 요약 (1줄 텍스트) */
.emotion-summary-compact {
    background: white;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

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

.summary-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* 기존 요약 (숨김) */
.emotion-summary-section {
    display: none;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.summary-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s;
}

.summary-card:hover {
    transform: translateY(-2px);
}

.summary-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.summary-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.summary-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

/* 감정 분포 */
.emotion-distribution {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.distribution-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px 0;
}

.distribution-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.distribution-label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 100px;
}

.distribution-label .emotion-icon {
    font-size: 20px;
}

.distribution-label .emotion-name {
    font-size: 14px;
    color: var(--text-primary);
}

.distribution-bar-container {
    flex: 1;
    height: 24px;
    background: var(--bg-main);
    border-radius: 6px;
    overflow: hidden;
}

.distribution-bar {
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease-out;
}

.distribution-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 80px;
    text-align: right;
}

/* ==========================================
   NeuroMetric 감정 코치 분석
   ========================================== */

/* 컴팩트 코치 섹션 */
.coach-section-compact {
    margin-bottom: 16px;
}

/* 토글 버튼 */
.btn-toggle-coach {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s;
}

.btn-toggle-coach:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.toggle-icon {
    transition: transform 0.3s;
}

/* 생성 버튼 */
.btn-generate-analysis-compact {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s;
}

.btn-generate-analysis-compact:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-generate-analysis-compact:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 분석 내용 */
.coach-analysis-content {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-top: 12px;
    box-shadow: var(--shadow-sm);
}

.analysis-content-compact {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
}

.analysis-content-compact p {
    margin: 0 0 8px 0;
}

.analysis-content-compact p:last-child {
    margin-bottom: 0;
}

.analysis-content-compact br {
    display: none;
}

.analysis-header-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
}

.analysis-header-compact i {
    color: var(--success);
}

.analysis-header-compact small {
    margin-left: auto;
    color: var(--text-secondary);
    font-size: 12px;
}

/* 재생성 버튼 */
.btn-secondary-compact {
    width: auto;
    padding: 8px 16px;
    background: var(--bg-main);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
}

.btn-secondary-compact:hover:not(:disabled) {
    background: white;
    border-color: var(--primary);
    color: var(--primary);
}

/* 기존 코치 섹션 (숨김) */
.coach-section {
    display: none;
}

.coach-analysis-section {
    margin-bottom: 24px;
}

.coach-analysis-section.disabled {
    opacity: 0.6;
}

/* 분석 표시 컨테이너 */
.coach-analysis-display {
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: var(--shadow-md);
}

.analysis-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-light);
}

.analysis-header i {
    color: var(--success);
    font-size: 24px;
}

.analysis-header span {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.analysis-header small {
    margin-left: auto;
    color: var(--text-secondary);
    font-size: 14px;
}

/* 분석 컨텐츠 */
.analysis-content {
    background: var(--bg-main);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 20px;
    line-height: 1.8;
    color: var(--text-primary);
}

.analysis-content p {
    margin: 0 0 12px 0;
}

.analysis-content p:last-child {
    margin-bottom: 0;
}

/* 인사이트 섹션 */
.analysis-insights {
    background: linear-gradient(135deg, #FFF9E6 0%, #FFF3CD 100%);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border-left: 4px solid var(--warning);
}

.analysis-insights h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 12px 0;
}

.analysis-insights i {
    color: var(--warning);
}

.analysis-insights ul {
    margin: 0;
    padding-left: 20px;
    list-style: none;
}

.analysis-insights li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 8px;
    color: var(--text-primary);
    line-height: 1.6;
}

.analysis-insights li:before {
    content: "💡";
    position: absolute;
    left: 0;
    top: 0;
}

.analysis-insights li:last-child {
    margin-bottom: 0;
}

/* 추천 행동 섹션 */
.analysis-recommendation {
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border-left: 4px solid var(--info);
}

.analysis-recommendation h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 12px 0;
}

.analysis-recommendation i {
    color: var(--error);
}

.analysis-recommendation p {
    margin: 0;
    color: var(--text-primary);
    line-height: 1.6;
}

/* 재생성 버튼 */
.btn-regenerate {
    width: 100%;
    padding: 12px;
    background: var(--bg-main);
    color: var(--text-primary);
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-regenerate:hover:not(:disabled) {
    background: white;
    border-color: var(--primary);
    color: var(--primary);
}

.btn-regenerate:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.badge-new {
    display: inline-block;
    padding: 4px 8px;
    background: #10B981;
    color: white;
    font-size: 11px;
    border-radius: 4px;
    font-weight: 600;
    margin-left: 8px;
}

.badge-completed {
    display: inline-block;
    padding: 4px 8px;
    background: var(--primary-color);
    color: white;
    font-size: 11px;
    border-radius: 4px;
    font-weight: 600;
    margin-left: 8px;
}

.coach-placeholder {
    background: white;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    color: var(--text-secondary);
}

.coach-placeholder i {
    font-size: 48px;
    color: var(--border-color);
    margin-bottom: 12px;
    display: block;
}

.coach-generate-prompt {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    color: white;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.prompt-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.coach-generate-prompt h3 {
    font-size: 20px;
    margin: 0 0 12px 0;
    font-weight: 700;
}

.coach-generate-prompt p {
    font-size: 14px;
    opacity: 0.9;
    margin: 0 0 24px 0;
    line-height: 1.6;
}

.btn-generate-analysis {
    padding: 14px 32px;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-generate-analysis:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.btn-generate-analysis:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.generate-note {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 12px !important;
}

/* 코치 분석 카드 */
.coach-analysis-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border: 2px solid #667eea;
}

.coach-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--bg-main);
    margin-bottom: 20px;
}

.coach-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.coach-info {
    flex: 1;
}

.coach-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.coach-time {
    font-size: 13px;
    color: var(--text-secondary);
}

.coach-badge {
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 감정 요약 */
.coach-emotion-summary {
    background: var(--bg-main);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.coach-emotion-summary h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-value.positive {
    color: #10B981;
}

.stat-value.negative {
    color: #EF4444;
}

/* 분석 내용 */
.coach-content {
    margin-bottom: 20px;
}

.content-section {
    margin-bottom: 20px;
}

.content-section h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.content-text {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-primary);
}

.content-text p {
    margin: 0 0 12px 0;
}

/* 인사이트 */
.insights-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.insight-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--bg-main);
    border-radius: 8px;
}

.insight-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.insight-text {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.6;
}

/* 추천사항 */
.content-section.recommendation {
    background: linear-gradient(135deg, #FCD34D 0%, #F59E0B 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.content-section.recommendation h4 {
    color: white;
}

.recommendation-card {
    display: flex;
    gap: 12px;
    align-items: start;
}

.recommendation-icon {
    font-size: 32px;
}

.recommendation-text {
    flex: 1;
    font-size: 15px;
    color: white;
    line-height: 1.7;
    font-weight: 500;
}

/* 코치 푸터 */
.coach-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 16px;
    border-top: 2px solid var(--bg-main);
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.coach-footer i {
    color: #F59E0B;
}

/* ==========================================
   사용자 일기
   ========================================== */

/* 컴팩트 일기 섹션 */
.user-journal-section-compact {
    margin-bottom: 16px;
}

/* 컴팩트 에디터 */
.journal-editor-compact {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.journal-textarea-compact {
    width: 100%;
    min-height: 100px; /* 5줄 */
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    font-family: inherit;
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.journal-textarea-compact:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(44, 95, 127, 0.1);
}

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

/* 푸터 (글자수 + 저장 버튼) */
.journal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.char-count-compact {
    font-size: 12px;
    color: var(--text-secondary);
    flex: 0 0 auto;
}

.btn-save-journal-compact {
    padding: 8px 16px;
    background: #2C5F7F !important; /* 앱 주요 색상 (청록색) */
    color: white !important;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    white-space: nowrap;
    flex: 0 0 auto;
}

.btn-save-journal-compact:hover:not(:disabled) {
    background: #1A4059 !important; /* --primary-dark */
    transform: translateY(-1px);
}

.btn-save-journal-compact:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 작성된 일기 표시 (컴팩트) */
.journal-display-compact {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.journal-content-compact {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 12px;
    max-height: 200px;
    overflow-y: auto;
}

.journal-content-compact p {
    margin: 0 0 8px 0;
}

/* 기존 일기 섹션 (숨김) */
.user-journal-section {
    display: none;
}

.journal-write-prompt {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.prompt-content p {
    font-size: 15px;
    color: var(--text-primary);
    margin: 0 0 16px 0;
    font-weight: 600;
}

.writing-tips {
    list-style: none;
    padding: 0;
    margin: 0;
}

.writing-tips li {
    font-size: 14px;
    color: var(--text-secondary);
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
}

.writing-tips li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: 700;
}

/* 일기 에디터 */
.journal-editor {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.journal-textarea {
    width: 100%;
    min-height: 300px;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-primary);
    font-family: 'Noto Sans KR', sans-serif;
    resize: vertical;
    transition: border-color 0.2s;
}

.journal-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 95, 127, 0.1);
}

.journal-textarea.edit-mode {
    background: #FFFBEB;
    border-color: #F59E0B;
}

.editor-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.word-count {
    font-size: 13px;
    color: var(--text-secondary);
}

#currentWordCount {
    font-weight: 700;
    color: var(--primary-color);
}

.btn-save-journal {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-save-journal:hover:not(:disabled) {
    background: #1e4a5f;
    transform: translateY(-1px);
}

.btn-save-journal:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 일기 카드 (작성 완료) */
.journal-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.journal-card .journal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--bg-main);
    margin-bottom: 20px;
}

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

.author-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
}

.author-info {
    flex: 1;
}

.author-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.author-time {
    font-size: 12px;
    color: var(--text-secondary);
}

.btn-edit-journal {
    padding: 8px 16px;
    background: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-edit-journal:hover {
    background: var(--primary-color);
    color: white;
}

.journal-content {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.journal-content p {
    margin: 0 0 12px 0;
}

.journal-footer {
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.journal-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.journal-stats i {
    margin-right: 4px;
}

/* 수정 버튼 그룹 */
.edit-buttons {
    display: flex;
    gap: 8px;
}

.btn-cancel-edit {
    padding: 10px 16px;
    background: white;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-cancel-edit:hover {
    background: var(--bg-main);
    border-color: var(--text-secondary);
}

/* ==========================================
   반응형 디자인
   ========================================== */

@media (max-width: 768px) {
    .daily-journal-page {
        padding: 16px 16px 100px 16px;
    }

    .journal-title {
        font-size: 24px;
    }

    .journal-subtitle {
        font-size: 14px;
    }

    .date-navigation {
        padding: 12px 16px;
    }

    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .summary-card {
        padding: 16px;
    }

    .summary-icon {
        font-size: 28px;
    }

    .summary-value {
        font-size: 18px;
    }

    .distribution-item {
        flex-wrap: wrap;
    }

    .distribution-bar-container {
        width: 100%;
        order: 3;
    }

    .distribution-value {
        min-width: auto;
    }

    .coach-generate-prompt {
        padding: 30px 20px;
    }

    .coach-generate-prompt h3 {
        font-size: 18px;
    }

    .coach-analysis-card {
        padding: 20px;
    }

    .summary-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .journal-textarea {
        min-height: 250px;
        font-size: 14px;
    }

    .editor-footer {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .btn-save-journal {
        width: 100%;
        justify-content: center;
    }

    .edit-buttons {
        width: 100%;
    }

    .btn-cancel-edit,
    .btn-save-journal {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .journal-title {
        font-size: 22px;
    }

    .date-text {
        font-size: 14px;
    }

    .section-title {
        font-size: 16px;
    }

    .timeline-item {
        gap: 12px;
    }

    .timeline-time {
        font-size: 12px;
        min-width: 46px;
    }

    .emotion-icon {
        font-size: 20px;
    }

    .emotion-name {
        font-size: 14px;
    }

    .summary-cards {
        grid-template-columns: 1fr 1fr;
    }

    .summary-card {
        padding: 12px;
    }

    .summary-icon {
        font-size: 24px;
    }

    .summary-value {
        font-size: 16px;
    }

    .coach-header {
        flex-wrap: wrap;
    }

    .coach-badge {
        width: 100%;
        justify-content: center;
    }
}
