:root {
    --primary: #3B5A45;       /* 포레스트 세이지 그린 */
    --accent: #E07A5F;        /* 로맨틱 테라코타 코랄 */
    --accent-light: #FFF0EB;
    --bg-main: #F7F5F0;       /* 따뜻한 크림 베이지 */
    --card-bg: #FFFFFF;
    --text-main: #2D3142;
    --text-muted: #8D99AE;
    --kakao-yellow: #FEE500;
    --kakao-bg: #BACEE0;
    --radius: 16px;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
}

/* 헤더 */
.app-header {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.header-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.sub-brand {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 600;
    background: var(--accent-light);
    padding: 2px 10px;
    border-radius: 12px;
}

.nav-tabs {
    display: flex;
    gap: 8px;
}

.tab-btn {
    border: none;
    background: transparent;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active, .tab-btn:hover {
    color: var(--primary);
    background: rgba(59, 90, 69, 0.1);
}

.header-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    background: #fff;
    border: 1px solid #ddd;
    padding: 8px 15px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #f0f0f0;
}

.chat-upload-btn {
    background: var(--kakao-yellow);
    border-color: #e5ce00;
    color: #3C1E1E;
}

/* 메인 컨테이너 */
.main-container {
    max-width: 1240px;
    margin: 24px auto;
    padding: 0 20px;
}

.tab-content {
    display: none;
}

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

/* 히어로 배너 */
.hero-banner {
    background: linear-gradient(135deg, #3B5A45, #223327);
    border-radius: var(--radius);
    color: #fff;
    padding: 44px 36px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.hero-overlay h2 {
    font-family: 'Nanum Myeongjo', serif;
    font-size: 2rem;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.hero-overlay p {
    font-size: 1.05rem;
    opacity: 0.92;
    margin-bottom: 18px;
}

.stats-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 0.88rem;
}

/* 카테고리 필터 바 */
.category-filter-bar {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.cat-btn {
    border: 1px solid #ddd;
    background: #fff;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.92rem;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.cat-btn.active, .cat-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* 트립 그리드 (폴라로이드 스타일) */
.trip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.trip-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.25s;
    display: flex;
    flex-direction: column;
}

.trip-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.1);
}

.trip-cover {
    width: 100%;
    height: 230px;
    object-fit: cover;
    background: #e9ecef;
}

.trip-card-content {
    padding: 22px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.trip-badge-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.trip-category-badge {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    background: #eef2f5;
    color: #495057;
}

.trip-date {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 600;
}

.trip-card-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.35;
}

.trip-location {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.trip-summary-snippet {
    font-size: 0.92rem;
    color: #555;
    line-height: 1.55;
    flex-grow: 1;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.trip-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f2f2f2;
    padding-top: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* 지도 섹션 (국내 및 해외) */
.map-container-wrap {
    display: flex;
    gap: 20px;
    height: 680px;
}

.map-sidebar {
    width: 340px;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    overflow-y: auto;
}

.map-view {
    flex-grow: 1;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.map-trip-item {
    padding: 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    border-radius: 8px;
    margin-bottom: 6px;
    transition: background 0.2s;
}

.map-trip-item:hover {
    background: #F7F5F0;
}

/* 모달 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    z-index: 200;
    overflow-y: auto;
    padding: 40px 20px;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--radius);
    max-width: 950px;
    width: 100%;
    padding: 34px;
    position: relative;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
}

.modal-header h2 {
    font-size: 1.7rem;
    color: var(--primary);
    margin-bottom: 6px;
}

.modal-meta {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* AI 커플 다이어리 카드 */
.ai-diary-card {
    background: #FAF8F5;
    border-left: 4px solid var(--accent);
    padding: 22px;
    border-radius: 10px;
    margin-bottom: 28px;
}

.diary-badge {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 12px;
}

.mini-btn {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 0.82rem;
    cursor: pointer;
}

.diary-text {
    font-size: 0.98rem;
    line-height: 1.85;
    color: #333;
    white-space: pre-line;
}

/* 갤러리 그리드 */
.detail-tabs {
    display: flex;
    gap: 12px;
    border-bottom: 2px solid #eee;
    margin-bottom: 20px;
}

.dtab-btn {
    border: none;
    background: none;
    padding: 10px 18px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.dtab-btn.active {
    color: var(--primary);
    border-color: var(--primary);
}

.dtab-content {
    display: none;
}

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

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}

.gallery-thumb {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s;
}

.gallery-thumb:hover {
    transform: scale(1.03);
}

/* 카카오톡 대화방 뷰 */
.kakaotalk-room {
    background: var(--kakao-bg);
    border-radius: 12px;
    padding: 22px;
    max-height: 520px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-bubble-wrap {
    display: flex;
    flex-direction: column;
    max-width: 75%;
}

.chat-bubble-wrap.left {
    align-self: flex-start;
}

.chat-bubble-wrap.right {
    align-self: flex-end;
}

.chat-sender {
    font-size: 0.78rem;
    color: #555;
    margin-bottom: 2px;
}

.chat-row {
    display: flex;
    align-items: flex-end;
    gap: 6px;
}

.chat-bubble-wrap.right .chat-row {
    flex-direction: row-reverse;
}

.chat-bubble {
    padding: 9px 14px;
    border-radius: 14px;
    font-size: 0.92rem;
    line-height: 1.4;
    word-break: break-word;
}

.chat-bubble-wrap.left .chat-bubble {
    background: #fff;
    border-top-left-radius: 2px;
}

.chat-bubble-wrap.right .chat-bubble {
    background: var(--kakao-yellow);
    border-top-right-radius: 2px;
}

.chat-time {
    font-size: 0.72rem;
    color: #666;
}

/* 단일 사진 라이트박스 */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 300;
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-inner {
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-inner img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 8px;
    object-fit: contain;
}

.lightbox-info {
    color: #fff;
    margin-top: 14px;
    text-align: center;
}

.lightbox-close {
    position: absolute;
    top: 24px;
    right: 28px;
    font-size: 2.5rem;
    color: #fff;
    cursor: pointer;
}

/* 로그인 */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-card {
    background: #fff;
    padding: 44px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-header .login-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px;
}

.login-form input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    margin: 20px 0;
}

.login-submit-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}
