/* Claude-inspired Design System */
:root {
    --bg-color: #f6f5f1; /* Soft cream/parchment */
    --surface-color: #ffffff;
    --text-primary: #2d2d2d;
    --text-secondary: #6e6e6e;
    --accent-color: #d97757; /* Claude rust accent */
    --accent-hover: #c56546;
    --border-color: #e5e5e5;
    --chat-self-bg: #f6f5f1;
    --chat-other-bg: #ffffff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { 
    background-color: var(--bg-color); 
    color: var(--text-primary); 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; 
    line-height: 1.6; 
}

/* Typography */
h1, h2, h3 { font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif; font-weight: normal; color: #111; }

header { 
    background: var(--surface-color); 
    padding: 15px 20px; 
    border-bottom: 1px solid var(--border-color); 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}
header h1 { font-size: 1.4rem; color: var(--text-primary); font-weight: 600; font-family: -apple-system, BlinkMacSystemFont, sans-serif;}
header p { font-size: 0.9rem; color: var(--text-secondary); }

/* Buttons */
.btn {
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.btn:hover { background: #f9f9f9; }
.btn-primary { 
    background: var(--accent-color); 
    color: white; 
    border: none; 
}
.btn-primary:hover { background: var(--accent-hover); }

/* Lobby Layout */
.lobby-container { max-width: 800px; margin: 40px auto; padding: 0 20px; }
.create-box, .room-list-box { 
    background: var(--surface-color); 
    padding: 24px; 
    border-radius: 12px; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); 
    margin-bottom: 24px; 
    border: 1px solid var(--border-color);
}
.create-box h2 { font-size: 1.2rem; margin-bottom: 15px; border-bottom: none; }
.form-group { margin-bottom: 15px; }
input[type="text"], select { 
    width: 100%; 
    padding: 12px; 
    border: 1px solid var(--border-color); 
    border-radius: 8px; 
    font-size: 1rem; 
    background: #fafafa;
}
input[type="text"]:focus, select:focus { outline: none; border-color: var(--accent-color); }

/* Room List */
.room-list { list-style: none; }
.room-item { 
    padding: 16px 0; 
    border-bottom: 1px solid var(--border-color); 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}
.room-item:last-child { border-bottom: none; }
.room-name { font-weight: 500; font-size: 1.05rem; }
.badge { padding: 4px 8px; border-radius: 4px; font-size: 0.8rem; background: #eee; color: #555; }
.room-action { display: flex; align-items: center; gap: 15px; }

/* Chat Room Specifics (Claude Style) */
.room-body { display: flex; flex-direction: column; height: 100vh; background: var(--surface-color); }
.main-content { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    max-width: 900px; 
    margin: 0 auto; 
    width: 100%; 
    padding: 0; 
    position: relative;
    background: var(--surface-color);
}

/* WebRTC Video Section */
.video-section {
    padding: 15px 20px;
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
}
.video-container { display: flex; gap: 10px; margin-bottom: 10px; height: 160px; justify-content: center;}
.video-box { aspect-ratio: 4/3; background: #111; border-radius: 8px; overflow: hidden; position: relative; }
video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.video-label { position: absolute; bottom: 5px; left: 10px; color: white; background: rgba(0,0,0,0.5); padding: 2px 6px; border-radius: 4px; font-size: 0.75em; }

.webrtc-controls { display: flex; gap: 10px; justify-content: center; }

/* Chat Area - Spacious */
.chat-container { 
    flex: 1; 
    overflow-y: auto; 
    padding: 20px; 
    display: flex; 
    flex-direction: column; 
    gap: 16px; 
}
.message { 
    max-width: 80%; 
    word-wrap: break-word; 
    display: flex;
    flex-direction: column;
}
.msg-self { align-self: flex-end; align-items: flex-end;}
.msg-other { align-self: flex-start; align-items: flex-start;}

.msg-content-box {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
}
.msg-self .msg-content-box { background: var(--chat-self-bg); border: 1px solid var(--border-color); border-bottom-right-radius: 4px; }
.msg-other .msg-content-box { background: var(--chat-other-bg); border: 1px solid var(--border-color); border-bottom-left-radius: 4px; }
.msg-system { background: transparent; color: var(--text-secondary); font-size: 0.85em; text-align: center; align-self: center; margin: 10px 0; }

.msg-info { font-size: 0.8em; color: var(--text-secondary); margin-bottom: 4px; font-weight: 500; }
.msg-time { font-size: 0.7em; color: #999; margin-top: 4px; }

/* Input Area - Clean Bar */
.input-area { 
    padding: 15px 20px; 
    background: var(--surface-color); 
    border-top: 1px solid var(--border-color); 
    display: flex; 
    gap: 10px; 
    align-items: center;
}
#username { width: 120px; }
#msgText { 
    flex: 1; 
    padding: 12px 20px; 
    border: 1px solid var(--border-color); 
    border-radius: 24px; 
    outline: none; 
    font-size: 0.95rem;
    background: var(--bg-color);
}
#msgText:focus { border-color: var(--accent-color); }

.icon-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 10px;
    color: var(--text-secondary);
    border-radius: 50%;
    transition: all 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--bg-color); color: var(--text-primary); border-color: #ccc; }

/* Age Verification */
#ageGateOverlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(246, 245, 241, 0.95); z-index: 9999;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    color: var(--text-primary); text-align: center;
}
.age-gate-box { background: var(--surface-color); padding: 40px; border-radius: 12px; border: 1px solid var(--border-color); max-width: 90%; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
