@font-face {
    font-family: Vazir;
    src: url("../fonts/Vazirmatn-RD-FD-Regular.woff2") format("woff2");
    font-style: normal;
    font-weight: 300;
    font-display: swap;
}

@font-face {
    font-family: Vazir;
    src: url("../fonts/Vazirmatn-RD-FD-Bold.woff2") format("woff2");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}

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

body {
    font-family: Vazir, sans-serif;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: #333;
    min-height: 100vh;
    padding: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chat-container {
    width: 100%;
    max-width: 800px;
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 95vh;
}

.chat-header {
    background: linear-gradient(to right, #4b6cb7, #182848);
    color: white;
    padding: 15px 20px;
    text-align: center;
    flex-shrink: 0;
}

.chat-header h1 {
    font-size: 20px;
    margin-bottom: 5px;
}

.chat-header p {
    opacity: 0.9;
    font-size: 13px;
    margin-top: 5px;
}

.username-section {
    padding: 20px 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #eaeaea;
    text-align: center;
    flex-shrink: 0;
}

.username-form {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.username-input {
    padding: 12px 15px;
    border: 2px solid #4b6cb7;
    border-radius: 10px;
    font-size: 16px;
    width: 250px;
    max-width: 100%;
    transition: all 0.3s;
    font-family: inherit;
}

.username-input:focus {
    outline: none;
    border-color: #182848;
    box-shadow: 0 0 0 3px rgba(75, 108, 183, 0.2);
}

.btn {
    padding: 12px 25px;
    background: linear-gradient(to right, #4b6cb7, #182848);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
    font-family: inherit;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.chat-section {
    display: none;
    flex-direction: column;
    height: 100%;
    flex: 1;
    overflow: hidden;
}

.messages-container {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f8f9fa;
    min-height: 0;
}

.message {
    margin-bottom: 12px;
    padding: 10px 15px;
    border-radius: 15px;
    max-width: 50%;
    word-wrap: break-word;
    animation: fadeIn 0.3s ease-in-out;
    line-height: 1.5;
}

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

.message.user {
    background: linear-gradient(to left, #4b6cb7, #182848);
    color: white;
    margin-left: auto;
    margin-right: 0;
    border-bottom-right-radius: 5px;
    border-bottom-left-radius: 15px;
}

.message.other {
    background-color: white;
    color: #333;
    border: 1px solid #eaeaea;
    margin-right: auto;
    margin-left: 0;
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 15px;
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 11px;
    opacity: 0.8;
}

.message-content {
    line-height: 1.5;
    font-size: 15px;
}

.input-section {
    padding: 15px;
    border-top: 1px solid #eaeaea;
    display: flex;
    gap: 10px;
    background-color: white;
    flex-shrink: 0;
}

.message-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #eaeaea;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s;
    font-family: inherit;
    min-width: 0;
}

.message-input:focus {
    outline: none;
    border-color: #4b6cb7;
}

.message-input:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.status {
    text-align: center;
    padding: 10px;
    font-size: 14px;
    color: #666;
}

.info-box {
    background-color: #e7f3ff;
    border-radius: 10px;
    padding: 10px 15px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #0056b3;
    text-align: center;
    border-right: 4px solid #4b6cb7;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    padding: 10px 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #eaeaea;
    flex-shrink: 0;
}

.user-info i {
    color: #4b6cb7;
}

/* رسپانسیو برای موبایل */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .chat-container {
        height: 100vh;
        max-height: -webkit-fill-available;
        border-radius: 15px;
    }
    
    .chat-header {
        padding: 12px 15px;
    }
    
    .chat-header h1 {
        font-size: 18px;
    }
    
    .chat-header p {
        font-size: 12px;
    }
    
    .username-section {
        padding: 15px 10px;
    }
    
    .username-form {
        flex-direction: column;
        width: 100%;
    }
    
    .username-input {
        width: 100%;
        max-width: 100%;
        padding: 10px 12px;
    }
    
    .btn {
        /*width: 100%;*/
        padding: 10px 20px;
    }
    
    .messages-container {
        padding: 10px;
    }
    
    .message {
        max-width: 90%;
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .input-section {
        padding: 10px;
        flex-wrap: nowrap;
    }
    
    .message-input {
        padding: 10px 12px;
        font-size: 15px;
        min-height: 44px;
    }
    
    .send-btn {
        padding: 10px 15px;
        min-width: 60px;
    }
}

@media (max-width: 480px) {
    .chat-container {
        border-radius: 10px;
    }
    
    .chat-header h1 {
        font-size: 16px;
    }
    
    .message {
        max-width: 95%;
    }
    
    .message-header {
        font-size: 10px;
    }
    
    .message-content {
        font-size: 14px;
    }
    
    .info-box {
        font-size: 12px;
        padding: 8px 10px;
    }
}
.emoji-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    margin-left: 10px;
    transition: all 0.3s;
}

.emoji-btn:hover {
    background: #f0f0f0;
}

.emoji-picker {
    position: absolute;
    bottom: 70px;
    width: 320px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: none;
    border: 1px solid #e0e0e0;
    overflow: hidden;
}

.emoji-picker-header {
    background: #f8f9fa;
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.emoji-picker-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.close-emoji-picker {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
}

.close-emoji-picker:hover {
    color: #333;
}

.recent-emojis {
    padding: 10px 15px;
    border-bottom: 1px solid #e0e0e0;
}

.recent-emojis h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #666;
}

.recent-emoji-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.emoji-container {
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.emoji-btn-small {
    background: none;
    border: none;
    font-size: 24px;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-btn-small:hover {
    background: #f0f0f0;
    transform: scale(1.2);
}

.input-wrapper {
    display: flex;
    flex: 1;
    background: #f8f9fa;
    border: 2px solid #eaeaea;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s;
}

.input-wrapper:focus-within {
    border-color: #4b6cb7;
}

.message-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 15px;
    font-size: 16px;
    font-family: inherit;
}

.emoji-in-message {
    font-size: 20px;
    vertical-align: middle;
    margin: 0 2px;
}

@media (max-width: 768px) {
    .emoji-picker {
        width: 100%;
        right: 0;
        left: 0;
        bottom: 70px;
        border-radius: 0;
    }
    
    .emoji-container {
        grid-template-columns: repeat(7, 1fr);
    }
}