:root {
    --main-color: #667eea;
    --second-color: #764ba2;
    --online-color: #4CAF50;
    --offline-color: #f44336;
    --bg-dark: #1a1a2e;
    --bg-light: #f8f9fa;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, sans-serif;
}

body {
    background: var(--bg-dark);
    color: white;
    min-height: 100vh;
    padding: 15px;
    direction: rtl;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* هدر */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, var(--main-color), var(--second-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.status {
    font-size: 14px;
    color: #aaa;
}

.status.online {
    color: var(--online-color);
}

.exit-btn {
    background: rgba(244, 67, 54, 0.2);
    color: var(--offline-color);
    border: 1px solid var(--offline-color);
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.exit-btn:hover {
    background: var(--offline-color);
    color: white;
}

/* لیست آنلاین */
.online-box {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.online-box h3 {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#online-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.user-tag {
    background: rgba(102, 126, 234, 0.2);
    padding: 6px 12px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.user-tag.talking {
    background: rgba(76, 175, 80, 0.3);
    animation: blink 1s infinite;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* کنترل صحبت */
.talk-box {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.mic-control {
    text-align: center;
    margin-bottom: 15px;
}

.mic-on, .mic-off {
    padding: 12px 25px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: 0.3s;
}

.mic-on {
    background: rgba(76, 175, 80, 0.2);
    color: var(--online-color);
    border: 1px solid var(--online-color);
}

.mic-off {
    background: rgba(244, 67, 54, 0.2);
    color: var(--offline-color);
    border: 1px solid var(--offline-color);
}

.talk-btn-container {
    text-align: center;
}

#talk-btn {
    background: linear-gradient(45deg, var(--main-color), var(--second-color));
    color: white;
    border: none;
    padding: 20px 40px;
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
    transition: transform 0.2s;
}

#talk-btn:active {
    transform: scale(0.95);
}

.hint {
    color: #aaa;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* نمایش صدا */
.sound-box {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.sound-bar {
    width: 100%;
    height: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 7px;
    margin-bottom: 10px;
    overflow: hidden;
}

.sound-level {
    height: 100%;
    background: linear-gradient(90deg, var(--main-color), var(--second-color));
    border-radius: 7px;
    width: 0%;
    transition: width 0.1s;
}

#talking-status {
    color: #aaa;
    font-size: 14px;
}

/* چت متنی */
.chat-box {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

.messages {
    height: 150px;
    overflow-y: auto;
    padding: 10px;
}

.message {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.message .name {
    color: var(--main-color);
    font-weight: bold;
    margin-left: 5px;
}

.chat-input {
    display: flex;
    padding: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-input input {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.chat-input button {
    background: var(--main-color);
    color: white;
    border: none;
    padding: 0 15px;
    margin-right: 8px;
    border-radius: 5px;
    cursor: pointer;
}

/* موبایل */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    #talk-btn {
        padding: 15px 30px;
        font-size: 16px;
    }
}