/* ==========================================
   역타로 (易Tarot) 메인 스타일 시트
========================================== */

:root { 
    --bg-color: #121212; 
    --panel-bg: #1e1e1e; 
    --primary-color: #d4af37; 
    --text-color: #f4f4f4; 
    --text-muted: #a0a0a0; 
    --card-bg: #2a2a2a; 
    --border-color: #333; 
}

body { font-family: 'Pretendard', sans-serif; background-color: var(--bg-color); color: var(--text-color); display: flex; justify-content: center; align-items: flex-start; min-height: 100vh; margin: 0; padding: 20px 20px 100px; box-sizing: border-box; }
.app-container { background-color: var(--panel-bg); width: 100%; max-width: 600px; border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,0.8); overflow: hidden; border: 1px solid var(--border-color); position: relative; margin-top: 20px; }
.header h1, .tab, .hexagram-name, .period-card h3, .tarot-name, .modal-title, #boardTitle { font-family: 'Gowun Batang', serif; }

.header { text-align: center; padding: 35px 20px 25px; border-bottom: 1px solid var(--border-color); cursor: pointer; position: relative; }
.header h1 { margin: 0; color: var(--primary-color); font-size: 30px; letter-spacing: 1px; font-weight: 700; }
.header p { color: var(--text-muted); font-size: 14.5px; margin-top: 10px; font-weight: 300; }

.auth-bar { position: absolute; top: 15px; right: 20px; display: flex; align-items: center; gap: 8px; }
.user-chip { font-size: 12px; color: var(--primary-color); font-weight: bold; }
#authBtn { background: transparent; color: var(--text-muted); border: 1px solid #555; padding: 6px 12px; border-radius: 20px; font-size: 12px; cursor: pointer; transition: 0.2s; }
#authBtn:hover { color: #fff; border-color: var(--primary-color); }

.tabs { display: flex; background-color: #1a1a1a; }
.tab { flex: 1; padding: 18px 0; text-align: center; cursor: pointer; color: var(--text-muted); font-weight: bold; font-size: 15.5px; transition: 0.3s; word-break: keep-all; position: relative; }
.tab.active { color: var(--primary-color); border-bottom: 2px solid var(--primary-color); background-color: var(--panel-bg); }

.content-section { display: none; padding: 30px 20px; text-align: center; animation: fadeIn 0.4s ease-out; }
.content-section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.floating-nav { position: fixed; bottom: 25px; left: 50%; transform: translateX(-50%); width: 95%; max-width: 500px; background: rgba(30, 30, 30, 0.95); border: 1px solid var(--primary-color); border-radius: 40px; display: flex; justify-content: space-around; padding: 10px 5px; box-shadow: 0 8px 32px rgba(0,0,0,0.6); z-index: 999; backdrop-filter: blur(10px); }
.nav-item { display: flex; flex-direction: column; align-items: center; color: var(--text-muted); font-size: 11px; cursor: pointer; flex: 1; gap: 4px; transition: 0.3s; position: relative; }
.nav-item .icon { font-size: 20px; }
.nav-item.active { color: var(--primary-color); font-weight: bold; transform: translateY(-2px); }

.num-badge { position: absolute; top: -5px; right: -10px; background-color: #ff4d4d; color: white; font-size: 10px; font-weight: bold; min-width: 16px; height: 16px; border-radius: 10px; display: flex; align-items: center; justify-content: center; padding: 0 4px; box-shadow: 0 2px 5px rgba(0,0,0,0.5); border: 1.5px solid #1e1e1e; z-index: 10; font-family: 'Pretendard', sans-serif;}
.unread-count { background-color: #ff4d4d; color: white; font-size: 11px; font-weight: bold; min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 5px; box-shadow: 0 2px 5px rgba(0,0,0,0.5); margin-top: 4px;}

.input-group { margin-bottom: 15px; text-align: left; display: flex; gap: 10px; }
.input-group input, .input-group select, .community-form input, .community-form textarea { flex: 1; padding: 14px; border-radius: 8px; border: 1px solid #444; background-color: var(--card-bg); color: white; font-size: 15px; box-sizing: border-box; width: 100%; transition: all 0.3s ease; }
.community-form input:focus, .community-form textarea:focus, .input-group input:focus, .input-group select:focus { border-color: var(--primary-color); box-shadow: 0 0 10px rgba(212, 175, 55, 0.2), inset 0 2px 5px rgba(0,0,0,0.5); outline: none; transform: translateY(-1px); }

.action-btn { background-color: var(--primary-color); color: #000; border: none; width: 100%; padding: 16px; font-size: 16px; font-weight: bold; border-radius: 8px; cursor: pointer; margin-top: 15px; transition: 0.2s; }
.action-btn:hover:not(:disabled) { background-color: #b5952f; transform: translateY(-2px); }
.action-btn:disabled { background-color: #555; color: #888; cursor: not-allowed; }

.button-group { display: flex; gap: 10px; margin-top: 25px; flex-direction: column;}
.button-group div { display: flex; gap: 10px; width: 100%; }
.button-group button { flex: 1; padding: 15px; border-radius: 8px; font-size: 15px; font-weight: bold; cursor: pointer; transition: 0.2s; }
.reset-btn { background: transparent; color: var(--text-muted); border: 1px solid #555; }
.reset-btn:hover { background-color: #333; color: white; border-color: var(--primary-color); }

.hexagram-area { background-color: var(--card-bg); padding: 30px 20px; border-radius: 12px; margin-bottom: 25px; text-align: center; border-top: 4px solid var(--primary-color); box-shadow: 0 8px 20px rgba(0,0,0,0.5); }
.hexagram-symbol { font-size: 75px; color: var(--primary-color); line-height: 1; margin-bottom: 10px; text-shadow: 0 0 15px rgba(212, 175, 55, 0.4); }
.hexagram-name { font-weight: bold; font-size: 28px; margin-bottom: 10px; color: #fff; }
.hexagram-theme { font-size: 16px; font-weight: bold; color: var(--primary-color); margin-bottom: 15px; display: block; }

.period-card { background-color: var(--card-bg); border-radius: 12px; padding: 20px; margin-bottom: 15px; text-align: left; border-left: 4px solid var(--primary-color); }
.period-card h3 { margin-top: 0; font-size: 18px; color: var(--primary-color); border-bottom: 1px solid #444; padding-bottom: 10px; margin-bottom: 15px; }
.period-content { display: flex; gap: 15px; align-items: flex-start; }
.period-tarot-img { width: 90px; border-radius: 6px; border: 1px solid var(--primary-color); flex-shrink: 0; background-color: #111;}
.period-text .tarot-name { font-weight: bold; color: var(--primary-color); font-size: 17px; margin-bottom: 8px; display: block; }
.period-text p { font-size: 14.5px; line-height: 1.6; color: #ccc; margin: 0; word-break: keep-all; }

.guide-card { background: linear-gradient(145deg, #1a1a1a, #2a2a2a); border-radius: 12px; padding: 20px; margin-top: 25px; text-align: left; border-left: 4px solid var(--primary-color); box-shadow: 0 6px 15px rgba(0,0,0,0.4); }
.guide-card h3 { margin-top: 0; font-size: 19px; color: #fff; border-bottom: 1px dashed #555; padding-bottom: 10px; margin-bottom: 15px; }
.guide-list { list-style: none; padding: 0; margin: 0; font-size: 15px; line-height: 1.8; color: #ddd; }
.guide-list li { margin-bottom: 10px; word-break: keep-all; }
.guide-list b { color: var(--primary-color); margin-right: 5px; }

.sub-tabs { display: flex; gap: 10px; margin-bottom: 20px; }
.sub-tab { flex: 1; padding: 10px; text-align: center; background: #1a1a1a; color: #888; border-radius: 8px; border: 1px solid #333; cursor: pointer; font-size: 14px; font-weight: bold; transition: 0.2s; }
.sub-tab.active { background: rgba(212, 175, 55, 0.15); color: var(--primary-color); border-color: var(--primary-color); }

.pinned-notice { background: rgba(244, 67, 54, 0.1); border-left: 3px solid #ff4d4d; padding: 12px 15px; border-radius: 8px; margin-bottom: 15px; cursor: pointer; text-align: left;}
.pinned-notice-title { font-size: 14px; color: #ffcdd2; font-weight: bold; }

.community-form { background-color: var(--card-bg); padding: 20px; border-radius: 12px; margin-bottom: 25px; border-top: 3px solid var(--primary-color); text-align: left;}
.profile-label { color: var(--primary-color); font-size: 13.5px; font-weight: bold; margin-top: 15px; margin-bottom: 8px; display: block; }

.msg-card { background-color: #222; border-radius: 12px; padding: 20px; margin-bottom: 15px; text-align: left; border-left: 3px solid #555; position: relative; transition: 0.3s;}
.cat-badge { display: inline-block; padding: 4px 8px; border-radius: 4px; font-size: 11px; font-weight: bold; margin-bottom: 10px; }
.cat-badge.prescription { background-color: rgba(212, 175, 55, 0.15); color: var(--primary-color); border: 1px solid var(--primary-color); }
.cat-badge.counseling { background-color: rgba(156, 39, 176, 0.15); color: #e1bee7; border: 1px solid #ce93d8; }
.cat-badge.social { background-color: rgba(76, 175, 80, 0.15); color: #c8e6c9; border: 1px solid #a5d6a7; }
.cat-badge.notice { background-color: rgba(244, 67, 54, 0.15); color: #ffcdd2; border: 1px solid #ef9a9a; }

.msg-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.msg-name { font-weight: bold; color: #fff; font-size: 15px; font-family: 'Gowun Batang', serif;}
.clickable-name { cursor: pointer; text-decoration: underline; text-decoration-color: #555; text-underline-offset: 4px; transition: 0.2s;}
.clickable-name:hover { color: var(--primary-color); text-decoration-color: var(--primary-color); }
.msg-date { font-size: 12px; color: var(--text-muted); }
.msg-content { font-size: 15px; line-height: 1.6; color: #eee; word-break: keep-all; margin: 0 0 15px 0; }

.mini-prescription { background:#111; border:1px dashed var(--primary-color); padding:15px; border-radius:8px; margin-bottom:15px; display:flex; flex-direction:column; }
.mini-hex { font-size:40px; color:var(--primary-color); line-height:1; }
.mini-info { flex:1; overflow:hidden; }
.mini-title { font-weight:bold; color:var(--primary-color); font-size:14px; margin-bottom:10px; }
.mini-cards { display:flex; gap:10px; overflow-x:auto; padding-bottom:4px; scrollbar-width:none; }
.mini-cards::-webkit-scrollbar { display: none; }
.mini-card-wrapper { text-align:center; width:45px; flex-shrink:0; }
.mini-card-img { width:100%; height:auto; border-radius:4px; border:1px solid #555; background:#222; }
.mini-card-name { font-size:9px; color:#ccc; margin-top:4px; line-height:1.2; word-break:keep-all; }
.mini-guide { margin-top: 12px; padding-top: 12px; border-top: 1px dashed #444; font-size: 12px; color: #ddd; line-height: 1.6; }

.counseling-title { cursor: pointer; padding: 14px 15px; background-color: #1a1a1a; border-radius: 8px; border: 1px solid #444; color: var(--primary-color); font-weight: bold; font-size: 15px; margin-bottom: 5px; transition: 0.2s; display: flex; justify-content: space-between; align-items: center; }
.counseling-title:hover { background-color: #222; border-color: var(--primary-color); }

.msg-action-bar { display:flex; justify-content:space-between; align-items:center; margin-top:10px; border-top:1px solid #333; padding-top:12px; }
.action-group { display:flex; gap:12px; }
.action-group button { background:transparent; border:none; font-size:12px; cursor:pointer; padding:0; font-family:'Pretendard', sans-serif; transition:0.2s; display:flex; align-items:center; gap:4px; color:#aaa; }
.action-group button:hover { color:#fff; }
.btn-like.active, .btn-scrap.active { color: var(--primary-color); font-weight:bold; }
.btn-danger { color: #ff6b6b !important; }

.comments-section { border-top: 1px solid #444; padding-top: 15px; margin-top: 15px; }
.comment-item { background: #1a1a1a; padding: 10px 15px; border-radius: 8px; margin-bottom: 8px; font-size: 14px; position: relative; }
.comment-header { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 12px; color: #888; }
.comment-input-area { display: flex; gap: 8px; margin-top: 10px; }
.comment-input-area input { flex: 1; padding: 10px; border-radius: 6px; border: 1px solid #444; background: #111; color: white; outline: none; }
.comment-input-area input:focus { border-color: var(--primary-color); }
.comment-input-area button { padding: 10px 15px; border-radius: 6px; background: #444; color: white; border: none; cursor: pointer; font-weight: bold; transition: 0.2s;}
.comment-input-area button:hover { background: var(--primary-color); color: black;}
.comment-actions { display: flex; gap: 8px; margin-top: 5px; }
.comment-actions button { background: transparent; border: none; font-size: 11px; cursor: pointer; padding: 0; color: #888; transition: 0.2s; }
.comment-actions button:hover { color: var(--primary-color); text-decoration: underline; }

.messenger-container { text-align: left; }
.friend-list-wrap { display: flex; gap: 20px; flex-wrap: wrap; padding: 10px 0 20px; }
.friend-avatar-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; transition: 0.2s; }
.friend-avatar-wrap:hover { transform: translateY(-3px); }
.friend-avatar { width: 50px; height: 50px; border-radius: 20px; background: linear-gradient(135deg, var(--primary-color), #8b6b1c); display: flex; align-items: center; justify-content: center; font-size: 20px; box-shadow: 0 4px 10px rgba(0,0,0,0.3); }
.friend-name { font-size: 12px; color: #ccc; font-weight: bold; max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chat-list-vertical { display: flex; flex-direction: column; gap: 5px; }
.chat-room-item { display: flex; justify-content: space-between; align-items: center; padding: 15px; background: #1a1a1a; border-radius: 12px; cursor: pointer; transition: 0.2s; border: 1px solid transparent; text-align: left; margin-bottom: 8px;}
.chat-room-item:hover { background: #222; border-color: #333; }
.chat-info { display: flex; align-items: center; gap: 15px; flex: 1; overflow: hidden; }
.chat-avatar { width: 45px; height: 45px; border-radius: 16px; background: #333; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.chat-text { display: flex; flex-direction: column; gap: 5px; overflow: hidden; }
.chat-title { color: #fff; font-size: 15px; font-weight: bold; margin-bottom: 4px; }
.chat-last-msg { color: #888; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.chat-time { color: #555; font-size: 11px; }

.chat-modal-content { background: var(--panel-bg); width: 100%; height: 100%; max-width: 600px; display: flex; flex-direction: column; position: relative; animation: slideUp 0.3s ease-out; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.chat-header { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; background: #1a1a1a; border-bottom: 1px solid #333; z-index: 10; }
.chat-header-title { font-size: 16px; color: #fff; font-weight: bold; }
.chat-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 15px; background: #121212; }
.msg-bubble-wrap { display: flex; flex-direction: column; max-width: 75%; }
.msg-bubble-wrap.me { align-self: flex-end; align-items: flex-end; }
.msg-bubble-wrap.other { align-self: flex-start; align-items: flex-start; }
.msg-bubble { padding: 10px 14px; border-radius: 14px; font-size: 14.5px; line-height: 1.5; word-break: break-all; }
.msg-bubble-wrap.me .msg-bubble { background: var(--primary-color); color: #000; border-top-right-radius: 4px; }
.msg-bubble-wrap.other .msg-bubble { background: #2a2a2a; color: #eee; border-top-left-radius: 4px; }
.msg-time { font-size: 10px; color: #666; margin-top: 4px; }
.chat-input-area { display: flex; padding: 10px 15px; background: #1a1a1a; border-top: 1px solid #333; gap: 10px; align-items: flex-end; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
.chat-input-area textarea { flex: 1; background: #111; color: #fff; border: 1px solid #444; border-radius: 20px; padding: 10px 15px; font-size: 14px; outline: none; resize: none; max-height: 100px; font-family: 'Pretendard', sans-serif; }
.chat-input-area button { background: var(--primary-color); color: #000; border: none; width: 40px; height: 40px; border-radius: 50%; font-size: 16px; font-weight: bold; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }

.profile-card-header { text-align: center; margin-bottom: 25px; padding: 25px 20px; background: linear-gradient(145deg, #1a1a1a, #222); border-radius: 16px; border: 1px solid #333; box-shadow: 0 8px 20px rgba(0,0,0,0.5); }
.profile-avatar { font-size: 45px; margin-bottom: 12px; text-shadow: 0 0 20px rgba(212, 175, 55, 0.3); }
.profile-greeting { font-family: 'Gowun Batang', serif; font-size: 17px; color: #ddd; line-height: 1.6; word-break: keep-all; }
.profile-greeting span { color: var(--primary-color); font-weight: bold; font-size: 19px; }

.activity-tabs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.activity-btn { border-radius: 12px; padding: 15px 5px; font-size: 12.5px; background: #1a1a1a; display: flex; flex-direction: column; align-items: center; gap: 8px; border: 1px solid #333; color: #888; cursor: pointer; transition: 0.3s; font-weight: bold; }
.activity-btn span { font-size: 22px; transition: transform 0.3s; }
.activity-btn:hover { background: #222; border-color: #555; color: #ddd; }
.activity-btn:hover span { transform: scale(1.15); }
.activity-btn.active { background: rgba(212, 175, 55, 0.1); border-color: var(--primary-color); color: var(--primary-color); box-shadow: inset 0 0 10px rgba(212, 175, 55, 0.1); }
.activity-btn.active span { transform: scale(1.15); }

.profile-save-btn { margin-top: 25px; box-shadow: 0 4px 10px rgba(212, 175, 55, 0.2); }
.profile-save-btn:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 0 6px 15px rgba(212, 175, 55, 0.3); }

.danger-zone { padding: 25px 20px; border-radius: 16px; border: 1px dashed #ff4d4d; background: rgba(255, 77, 77, 0.03); text-align: center; margin-top: 30px; }
.danger-zone-title { color: #ff4d4d; font-size: 15px; font-weight: bold; margin-bottom: 10px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.btn-danger-zone { background: transparent; color: #ff4d4d; border: 1px solid #ff4d4d; padding: 12px 25px; border-radius: 8px; font-size: 14px; font-weight: bold; cursor: pointer; transition: 0.3s; }
.btn-danger-zone:hover { background: #ff4d4d; color: #fff; box-shadow: 0 4px 15px rgba(255, 77, 77, 0.3); }

.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 10000; justify-content: center; align-items: center; backdrop-filter: blur(4px); opacity: 0; transition: opacity 0.3s ease; }
.modal-overlay.show { opacity: 1; display: flex !important; }
.modal-content { background: var(--panel-bg); padding: 30px; border-radius: 16px; border: 1px solid #555; width: 85%; max-width: 420px; text-align: center; position: relative; box-shadow: 0 15px 50px rgba(0,0,0,0.9); }

#loadingScreen { display: none; padding: 50px 20px; text-align: center; }
.loader { width: 60px; height: 60px; border-radius: 50%; border: 3px solid transparent; border-top-color: var(--primary-color); border-bottom-color: var(--primary-color); animation: spin 1.5s linear infinite; margin: 0 auto 25px; position: relative; }
.loader::before { content: ''; position: absolute; top: 8px; left: 8px; right: 8px; bottom: 8px; border-radius: 50%; border: 2px solid transparent; border-left-color: #f4f4f4; border-right-color: #f4f4f4; animation: spin-reverse 1s linear infinite; }
@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes spin-reverse { 100% { transform: rotate(-360deg); } }

#toast { visibility: hidden; min-width: 250px; background-color: var(--primary-color); color: #000; font-weight: bold; text-align: center; border-radius: 30px; padding: 15px; position: fixed; z-index: 20000; left: 50%; bottom: 100px; transform: translateX(-50%); font-size: 14.5px; opacity: 0; transition: opacity 0.5s; box-shadow: 0 5px 15px rgba(0,0,0,0.5); }
#toast.show { visibility: visible; opacity: 1; }

.setting-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid #333; font-size: 14px; color: #ccc; }
.setting-item:last-child { border-bottom: none; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #444; transition: .4s; border-radius: 24px; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--primary-color); }
input:checked + .slider:before { transform: translateX(20px); background-color: #000;}

.auth-warning { background: rgba(244, 67, 54, 0.1); border: 1px solid #ef9a9a; color: #ffcdd2; padding: 15px; border-radius: 8px; text-align: center; margin-bottom: 20px; font-size: 14.5px; line-height: 1.5;}
.activity-item { transition: 0.2s; }
.activity-item:hover { background-color: #333 !important; }

.footer { text-align: center; padding: 30px 20px 20px; margin-top: 40px; border-top: 1px dashed #333; color: #666; font-size: 12px; line-height: 1.6; word-break: keep-all; }
.footer-links { margin: 10px 0; }
.footer-links a { color: #888; text-decoration: none; margin: 0 8px; transition: 0.2s; font-weight: bold; }
.footer-links a:hover { color: var(--primary-color); }

.terms-agree { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12px; color: #aaa; margin-bottom: 20px; text-align: left; line-height: 1.4; word-break: keep-all;}
.terms-agree input[type="checkbox"] { accent-color: var(--primary-color); width: 16px; height: 16px; cursor: pointer; flex-shrink: 0;}
.terms-agree a { color: var(--primary-color); text-decoration: underline; text-underline-offset: 2px; }