/* تنظیمات کلی */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #1a2980, #26d0ce);
    color: #333;
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* صفحه ورود */
.login-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    text-align: center;
    width: 90%;
    max-width: 500px;
}

.login-container h1 {
    color: #1a2980;
    margin-bottom: 30px;
    font-size: 1.8rem;
}

.login-container input {
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    transition: border 0.3s;
}

.login-container input:focus {
    border-color: #26d0ce;
    outline: none;
}

.login-container button {
    background: linear-gradient(to right, #1a2980, #26d0ce);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.3s;
}

.login-container button:hover {
    transform: translateY(-3px);
}

.note {
    margin-top: 20px;
    color: #666;
    font-size: 0.9rem;
}

/* صفحه چت */
.chat-container {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    width: 95%;
    max-width: 1200px;
    height: 95vh;
    display: flex;
    flex-direction: column;
}

/* هدر */
.chat-header {
    background: linear-gradient(to right, #1a2980, #26d0ce);
    color: white;
    padding: 20px 30px;
    text-align: center;
    position: relative;
    flex-shrink: 0;
}

.chat-header h1 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.9rem;
    opacity: 0.9;
}

.info-row {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.server-clock {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
}

/* فرم ارسال پیام */
.message-form {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px 30px;
    background: #f8f9fa;
    border-top: 2px solid #eee;
    flex-shrink: 0;
}

.message-input {
    flex: 1;
    min-height: 80px;
    max-height: 150px;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 12px;
    font-size: 1rem;
    resize: vertical;
    line-height: 1.5;
    transition: all 0.3s;
    background: white;
}

.message-input:focus {
    border-color: #26d0ce;
    outline: none;
    box-shadow: 0 0 0 3px rgba(38, 208, 206, 0.2);
}

.send-btn {
    background: linear-gradient(to right, #1a2980, #26d0ce);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    height: 80px;
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:hover {
    background: linear-gradient(to right, #26d0ce, #1a2980);
    transform: translateY(-2px);
}

.input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.char-count {
    font-size: 0.85rem;
    color: #666;
    padding: 0 5px;
    text-align: left;
}

/* نمایش چت */
.chat-box {
    flex: 1;
    padding: 20px 30px;
    overflow-y: auto;
    background: #f0f4ff;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    background: white;
    padding: 15px;
    border-radius: 12px;
    max-width: 75%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border-right: 4px solid #26d0ce;
}

.own-message {
    align-self: flex-end;
    background: #e3f2fd;
    border-right-color: #1a2980;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.sender-name {
    font-weight: bold;
    color: #1a2980;
    font-size: 0.95rem;
}

.message-time {
    direction: ltr;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: #666;
}

.message-text {
    line-height: 1.5;
    font-size: 0.95rem;
    padding: 6px 0;
    color: #333;
    word-wrap: break-word;
}

.message-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #eee;
    font-size: 0.8rem;
    color: #666;
}

.empty-chat {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 1.1rem;
}

/* فوتو */
.chat-footer {
    background: #f8f9fa;
    padding: 12px 30px;
    color: #666;
    font-size: 0.85rem;
    border-top: 2px solid #eee;
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* اسکرول بار */
.chat-box::-webkit-scrollbar {
    width: 8px;
}

.chat-box::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #26d0ce, #1a2980);
    border-radius: 4px;
}

.chat-box::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #1a2980, #26d0ce);
}

/* ریسپانسیو */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .chat-container {
        height: 100vh;
        border-radius: 0;
        width: 100%;
    }
    
    .message-form {
        flex-direction: column;
        gap: 12px;
    }
    
    .message-input {
        width: 100%;
    }
    
    .send-btn {
        width: 100%;
        height: 50px;
        min-width: auto;
    }
    
    .message {
        max-width: 90%;
    }
    
    .chat-footer {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}