:root {
    --kakao-yellow: #FEE500;
    --kakao-bg: #BACEE0;
    --discord-dark: #1E1F22;
    --discord-sidebar: #2B2D31;
    --discord-active: #313338;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-main: #FFFFFF;
    --text-muted: #B5BAC1;
    --success: #23A559;
}

* {
    margin: 0; padding: 0; box-sizing: border-box;
    font-family: 'Noto Sans KR', sans-serif;
}

body, html {
    height: 100%; width: 100%;
    overflow: hidden; background: #000;
}

.hidden { display: none !important; }

/* Overlay Screens (Login, Call) */
.overlay-screen {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #2B2D31 0%, #1E1F22 100%);
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.glassmorphic {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Login Components */
.login-container {
    width: 400px; padding: 40px; border-radius: 30px;
    text-align: center; color: white;
}

.login-title { font-size: 2.5rem; font-weight: 900; margin-bottom: 10px; color: var(--kakao-yellow); }
.login-subtitle { color: var(--text-muted); margin-bottom: 30px; }

.social-login-group { display: flex; flex-direction: column; gap: 12px; }

.social-btn {
    width: 100%; padding: 12px; border-radius: 12px; border: none;
    font-weight: 700; cursor: pointer; display: flex; align-items: center;
    justify-content: center; gap: 10px; transition: transform 0.2s;
}

.social-btn:hover { transform: translateY(-2px); }
.social-btn.google { background: white; color: #757575; }
.social-btn.kakao { background: #FEE500; color: #3c1e1e; }
.social-btn.naver { background: #03c75a; color: white; }
.naver-n { font-weight: 900; font-size: 1.2rem; }
.social-btn img { width: 24px; height: 24px; }

/* Auto Login Checkbox */
.auto-login-row { margin-top: 15px; display: flex; justify-content: flex-start; }
.checkbox-container {
    display: flex; align-items: center; position: relative; padding-left: 28px;
    cursor: pointer; font-size: 0.85rem; color: var(--text-muted); user-select: none;
}
.checkbox-container input { visibility: hidden; position: absolute; }
.checkmark {
    position: absolute; top: 0; left: 0; height: 20px; width: 20px;
    background-color: rgba(255,255,255,0.1); border: 1px solid var(--glass-border); border-radius: 4px;
}
.checkbox-container:hover input ~ .checkmark { background-color: rgba(255,255,255,0.2); }
.checkbox-container input:checked ~ .checkmark { background-color: var(--kakao-yellow); border: none; }
.checkmark:after {
    content: ""; position: absolute; display: none;
    left: 7px; top: 3px; width: 5px; height: 10px;
    border: solid #3c1e1e; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.checkbox-container input:checked ~ .checkmark:after { display: block; }

/* Social Mock Layers */
.social-mock {
    width: 450px; padding: 48px 40px 36px; border-radius: 8px; background: white;
    display: flex; flex-direction: column; align-items: center; color: #202124; animation: modalSlide 0.3s ease;
}
@keyframes modalSlide { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.google-style { border-radius: 28px; border: 1px solid #dadce0; }
.google-style h2 { font-size: 24px; font-weight: 400; margin: 16px 0 8px; }
.google-style p { margin-bottom: 40px; }
.google-style input { width: 100%; padding: 13px 15px; border: 1px solid #dadce0; border-radius: 4px; font-size: 16px; margin-bottom: 40px; }
.mock-footer { width: 100%; display: flex; justify-content: space-between; align-items: center; }
.mock-footer span { color: #1a73e8; font-weight: 500; cursor: pointer; font-size: 14px; }
.mock-next-btn { background: #1a73e8; color: white; border: none; padding: 10px 24px; border-radius: 4px; font-weight: 500; cursor: pointer; }

.naver-style { background: #f5f6f7; padding: 60px 40px; width: 460px; }
.naver-header { color: #03c75a; font-size: 2.5rem; font-weight: 900; margin-bottom: 30px; letter-spacing: -2px; }
.naver-input-box { border: 1px solid #dadce0; border-radius: 6px; overflow: hidden; margin-bottom: 20px; width: 100%; }
.naver-input-box input { width: 100%; padding: 15px; border: none; border-bottom: 1px solid #dadce0; outline: none; font-size: 14px; }
.naver-input-box input:last-child { border-bottom: none; }
.naver-login-btn { width: 100%; padding: 15px; background: #03c75a; color: white; border: none; border-radius: 6px; font-size: 18px; font-weight: 700; cursor: pointer; }

.kakao-style { padding: 50px 50px 60px; }
.kakao-style input { width: 100%; padding: 12px 0; border: none; border-bottom: 1px solid #ebebeb; outline: none; font-size: 16px; margin-bottom: 10px; }
.kakao-login-btn { width: 100%; padding: 14px; background: #fee500; border: none; border-radius: 4px; font-size: 16px; font-weight: 700; margin-top: 30px; cursor: pointer; color: #191919; }

.divider { margin: 20px 0; display: flex; align-items: center; color: var(--text-muted); font-size: 0.8rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--glass-border); margin: 0 10px; }

.sms-login-form { margin-top: 20px; }
.input-group { display: flex; gap: 8px; margin-bottom: 15px; }
.input-group input {
    flex: 1; padding: 12px; border-radius: 8px; border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2); color: white; outline: none;
}
.input-group button {
    padding: 0 15px; border-radius: 8px; border: none; background: var(--kakao-yellow);
    color: #3c1e1e; font-weight: 700; cursor: pointer;
}

/* Main App Layout */
.app-container {
    display: flex; height: 100vh; background: var(--discord-dark);
}

/* Sidebar 1: Servers */
.sidebar-servers {
    width: 72px; background: var(--discord-dark); padding: 12px 0;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
}

.server-icon {
    width: 48px; height: 48px; border-radius: 50%; background: var(--discord-sidebar);
    color: var(--text-main); display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s; overflow: hidden;
}

.server-icon:hover, .server-icon.active {
    border-radius: 15px; background: var(--kakao-yellow); color: #3c1e1e;
}

.server-icon.member img { width: 100%; height: 100%; object-fit: cover; }
.icon-text { font-size: 1.5rem; font-weight: 900; }
.plus { font-size: 2rem; }

.divider-small { width: 32px; height: 2px; background: var(--glass-border); margin: 4px 0; }

/* Sidebar 2: Channels */
.sidebar-channels {
    width: 240px; background: var(--discord-sidebar);
    display: flex; flex-direction: column;
}

.sidebar-header {
    height: 48px; padding: 0 16px; display: flex; align-items: center;
    justify-content: space-between; color: white; border-bottom: 1px solid rgba(0,0,0,0.2);
}

.channel-list { flex: 1; padding: 12px 8px; overflow-y: auto; }
.channel-category { text-transform: uppercase; font-size: 0.7rem; color: var(--text-muted); padding: 8px 0; }
.channel-item, .dm-item {
    padding: 8px; border-radius: 4px; color: var(--text-muted); cursor: pointer;
    display: flex; align-items: center; gap: 10px; transition: 0.1s;
}

.channel-item:hover, .dm-item:hover, .channel-item.active {
    background: var(--glass-bg); color: white;
}
.hash { font-size: 1.2rem; color: var(--text-muted); }
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; position: relative; }
.status { width: 10px; height: 10px; border-radius: 50%; background: #999; margin-left: auto; }
.status.online { background: var(--success); }

.user-footer {
    height: 52px; background: #232428; padding: 0 8px;
    display: flex; align-items: center; justify-content: space-between;
}
.user-info { display: flex; align-items: center; gap: 8px; cursor: pointer; flex: 1; }
.avatar-md { width: 32px; height: 32px; border-radius: 50%; }
.name-id { display: flex; flex-direction: column; color: white; font-size: 0.8rem; }
.my-id { font-size: 0.6rem; color: var(--text-muted); }
.user-controls { display: flex; gap: 10px; color: var(--text-muted); }
.ctrl-icon:hover { color: white; cursor: pointer; }

/* Main Chat Area: Kakao Theme */
.chat-main { flex: 1; display: flex; flex-direction: column; background: var(--kakao-bg); }

.chat-header {
    height: 48px; background: rgba(255, 255, 255, 0.4); backdrop-filter: blur(10px);
    padding: 0 16px; display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.chat-title { font-weight: 700; font-size: 1rem; color: #3c1e1e; }
.chat-actions { display: flex; gap: 20px; }
.action-btn { background: none; border: none; font-size: 1.2rem; cursor: pointer; opacity: 0.6; }
.action-btn:hover { opacity: 1; }

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

.date-divider { text-align: center; margin: 20px 0; position: relative; }
.date-divider span {
    background: rgba(0, 0, 0, 0.1); padding: 4px 12px; border-radius: 12px;
    font-size: 0.7rem; color: white;
}

.message { display: flex; gap: 10px; max-width: 80%; }
.message.received { align-self: flex-start; }
.message.sent { align-self: flex-end; flex-direction: row-reverse; }

.msg-avatar { width: 40px; height: 40px; border-radius: 15px; align-self: flex-start; }
.sender-name { font-size: 0.8rem; color: #3c1e1e; margin-bottom: 4px; margin-left: 2px; }

.bubble {
    padding: 8px 12px; border-radius: 12px; font-size: 0.95rem; line-height: 1.4;
    position: relative; box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.received .bubble { background: white; color: black; border-top-left-radius: 2px; }
.sent .bubble { background: var(--kakao-yellow); color: black; border-top-right-radius: 2px; }

.time { font-size: 0.6rem; color: rgba(0,0,0,0.4); align-self: flex-end; margin: 0 4px; }
.read-count { font-size: 0.6rem; color: var(--kakao-yellow); align-self: flex-end; margin-bottom: 4px; font-weight: 700; }

.chat-input-area {
    padding: 10px 16px; background: white; display: flex; align-items: center; gap: 12px;
}
.chat-input-area input {
    flex: 1; padding: 10px 15px; border-radius: 20px; border: 1px solid #ddd; outline: none;
}
.send-btn { background: var(--kakao-yellow); padding: 6px 15px; border-radius: 4px; border: none; font-weight: 700; cursor: pointer; }

/* Call Overlay */
.call-overlay {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(0,0,0,0.9); display: flex; align-items: center; justify-content: center;
}
.call-content { width: 90%; height: 90%; border-radius: 40px; display: flex; flex-direction: column; padding: 40px; }
.video-grid { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 30px 0; }
.video-tile {
    background: #2B2D31; border-radius: 20px; position: relative;
    display: flex; align-items: center; justify-content: center;
}
.video-tile.self { background: #3c1e1e; }
.video-tile .label { position: absolute; bottom: 15px; left: 15px; background: rgba(0,0,0,0.5); padding: 4px 10px; border-radius: 4px; color: white; font-size: 0.8rem; }

.call-controls { display: flex; justify-content: center; gap: 20px; }
.call-btn { width: 60px; height: 60px; border-radius: 50%; border: none; font-size: 1.5rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.call-btn.end { background: #FF3B30; color: white; transform: rotate(135deg); }
.call-btn.accept { background: #23A559; color: white; }
.call-btn.video.muted { position: relative; }
.call-btn.video.muted::after {
    content: ""; position: absolute; width: 40px; height: 2px;
    background: #FF3B30; transform: rotate(45deg);
}

/* Toast */
.toast {
    position: fixed; top: 20px; right: 20px; width: 300px;
    background: #fff; border-radius: 12px; padding: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2); z-index: 3000;
    animation: slideIn 0.3s ease;
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.toast-header { font-size: 0.8rem; font-weight: 700; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: #3c1e1e; }
.toast-body { font-size: 0.9rem; color: #333; }
