:root {
    --bg: #0a0a0a;
    --surface: #141414;
    --surface-light: #1e1e1e;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --text: #e5e7eb;
    --text-muted: #9ca3af;
    --error: #ef4444;
    --success: #10b981;
    --border: #262626;
    --font-sans: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
}

#app {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.screen {
    display: none;
    height: 100%;
    width: 100%;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

/* Landing Screen */
#landing-screen {
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at 50% 50%, #1a1a1a 0%, #0a0a0a 100%);
}

.container {
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.logo {
    font-size: 3rem;
    font-weight: 600;
    letter-spacing: -0.05em;
    margin-bottom: 0.5rem;
    background: linear-gradient(to bottom right, #fff, #666);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tagline {
    color: var(--text-muted);
    margin-bottom: 3rem;
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.btn {
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

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

.btn.primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn.secondary {
    background-color: var(--surface-light);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn.secondary:hover {
    background-color: #2a2a2a;
}

.btn.danger {
    background-color: var(--error);
    color: white;
}

.btn.small {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}

.divider span {
    padding: 0 1rem;
}

.join-box {
    display: flex;
    gap: 0.5rem;
}

#room-code-input {
    flex: 1;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.8rem;
    color: white;
    font-family: var(--font-mono);
    text-transform: uppercase;
    text-align: center;
    letter-spacing: 0.2em;
}

#room-code-input:focus {
    outline: none;
    border-color: var(--primary);
}

.error {
    color: var(--error);
    margin-top: 1rem;
    font-size: 0.9rem;
    min-height: 1.2rem;
}

/* Room Screen */
.room-header {
    padding: 1rem;
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.room-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.room-info .label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.room-info .code {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--primary);
    letter-spacing: 0.1em;
}

#copy-code-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

#copy-code-btn:hover {
    background-color: var(--surface-light);
    color: white;
}

.status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #4b5563;
}

.status-dot.online {
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
}

/* Chat Area */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.messages {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
}

.system-msg {
    align-self: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    background-color: var(--surface);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    margin: 1rem 0;
}

.message {
    max-width: 80%;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    position: relative;
    line-height: 1.4;
}

.message.you {
    align-self: flex-end;
    background-color: var(--primary);
    color: white;
    border-bottom-right-radius: 2px;
}

.message.stranger {
    align-self: flex-start;
    background-color: var(--surface-light);
    color: var(--text);
    border-bottom-left-radius: 2px;
}

.message .sender {
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    opacity: 0.7;
}

.message.code-snippet {
    font-family: var(--font-mono);
    white-space: pre-wrap;
    background-color: #1a1a1a;
    border: 1px solid var(--border);
    font-size: 0.9rem;
    width: 100%;
}

.file-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: inherit;
    text-decoration: none;
}

.file-link:hover {
    text-decoration: underline;
}

/* Input Area */
.input-area {
    padding: 1rem;
    background-color: var(--surface);
    border-top: 1px solid var(--border);
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
}

.input-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
}

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

.input-panel {
    display: none;
    gap: 0.8rem;
}

.input-panel.active {
    display: flex;
}

#message-input {
    flex: 1;
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.8rem;
    color: white;
}

#message-input:focus {
    outline: none;
    border-color: var(--primary);
}

.file-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background-color: var(--surface-light);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}

.file-label:hover {
    background-color: #2a2a2a;
    color: white;
}

.send-btn {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    width: 45px;
    height: 45px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:hover {
    background-color: var(--primary-hover);
}

#code-input-panel {
    flex-direction: column;
}

#code-input {
    width: 100%;
    height: 150px;
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.8rem;
    color: white;
    font-family: var(--font-mono);
    resize: none;
}

#code-input:focus {
    outline: none;
    border-color: var(--primary);
}

#send-code-btn {
    width: 100%;
    height: auto;
    padding: 0.8rem;
}

.typing-indicator {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 0.5rem;
    height: 1rem;
    opacity: 0;
    transition: opacity 0.2s;
    padding: 0 1.5rem;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
}

.typing-indicator.visible {
    opacity: 1;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 350px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.modal-content h3 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.modal-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #333;
}
