:root {
    --primary-color: #4a90e2;
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --text-color: #333;
    --msg-sent-bg: #95ec69;
    --msg-received-bg: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-gradient);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-color);
}

.app-container {
    width: 100%;
    max-width: 800px;
    height: 100%;
    max-height: 900px; /* On desktop, limit height */
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    overflow: hidden;
}

@media (max-width: 600px) {
    .app-container {
        border-radius: 0;
        max-height: 100vh;
    }
}

/* Header */
.glass-header {
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    background: rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.logo {
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.room-info {
    font-size: 0.9rem;
    color: #555;
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.icon-btn:hover {
    background: rgba(0,0,0,0.05);
}

/* Chat Area */
#chat-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scroll-behavior: smooth;
}

.welcome-msg {
    text-align: center;
    margin-top: 50px;
    color: #888;
    font-size: 0.9rem;
}

.sub-text {
    font-size: 0.8rem;
    margin-top: 5px;
}

/* Messages */
.message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.4;
    word-break: break-all;
    position: relative;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.sent {
    align-self: flex-end;
    background-color: var(--msg-sent-bg);
    border-top-right-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.message.received {
    align-self: flex-start;
    background-color: var(--msg-received-bg);
    border-top-left-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* File Message */
.file-card {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.file-icon {
    font-size: 2rem;
}

.file-info {
    display: flex;
    flex-direction: column;
}

.file-name {
    font-weight: 500;
}

.file-size {
    font-size: 0.75rem;
    color: #666;
}

/* Input Area */
.glass-footer {
    height: 70px;
    padding: 0 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.8);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

#message-input {
    flex: 1;
    height: 40px;
    border-radius: 20px;
    border: 1px solid #ddd;
    padding: 0 15px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

#message-input:focus {
    border-color: var(--primary-color);
}

.action-btn, .send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #555;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s;
}

.action-btn:hover {
    background: rgba(0,0,0,0.05);
}

.send-btn {
    background: var(--primary-color);
    color: white;
}

.send-btn:hover {
    background: #357abd;
}

/* Upload Overlay */
#upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.hidden {
    display: none !important;
}

.progress-box {
    background: white;
    padding: 20px;
    border-radius: 12px;
    width: 80%;
    max-width: 300px;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #eee;
    border-radius: 4px;
    margin-top: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.2s;
}
