:root {
    --bg-color: #0f172a;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --danger-color: #ef4444;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --msg-mine: #3b82f6;
    --msg-other: #334155;
    --radius: 12px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at top right, #1e293b, #0f172a);
    color: var(--text-color);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
    height: 100%;
}

.main-menu {
    display: flex;
    justify-content: center;
    align-items: center;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

h1, h2 {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

input[type="text"], textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-color);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

input[type="text"]:focus, textarea:focus {
    border-color: var(--primary-color);
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    border: none;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

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

.btn.outline {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn.outline:hover {
    background: rgba(59, 130, 246, 0.1);
}

.btn.danger {
    background: transparent;
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
}

.btn.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.btn.icon-btn {
    padding: 0.75rem;
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    flex-shrink: 0;
}

.btn.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Chat Layout */
.chat-container {
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
}

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

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #10b981; /* green */
    box-shadow: 0 0 10px #10b981;
}

.status-indicator.offline {
    background-color: var(--danger-color);
    box-shadow: 0 0 10px var(--danger-color);
}

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

.chat-window {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
}

.messages-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    max-width: 80%;
    padding: 1rem;
    border-radius: var(--radius);
    word-break: break-word;
    position: relative;
    animation: fadeIn 0.3s ease-out;
}

.message-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    display: flex;
    justify-content: space-between;
}

.message-content {
    line-height: 1.4;
}

.message.mine {
    align-self: flex-end;
    background: var(--msg-mine);
    border-bottom-right-radius: 2px;
}

.message.mine .message-meta {
    color: rgba(255,255,255,0.7);
}

.message.other {
    align-self: flex-start;
    background: var(--msg-other);
    border-bottom-left-radius: 2px;
}

.chat-input-area {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    margin-top: 1rem;
}

.chat-input-area textarea {
    flex: 1;
    resize: none;
    height: 45px;
    margin: 0;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal {
    width: 90%;
    max-width: 400px;
}

/* Attachments */
.attachment-img {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 0.5rem;
}
.attachment-file {
    display: block;
    margin-top: 0.5rem;
    color: #fff;
    text-decoration: underline;
}
.audio-player {
    margin-top: 0.5rem;
    width: 200px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
    .actions .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}
