@font-face{
    font-family: "BYekan";
    src: url("fonts/BYekan/BYekan-webfont.eot") format("eot"),
         url("fonts/BYekan/BYekan-webfont.woff") format("woff"),
         url("fonts/BYekan/BYekan-webfont.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "BYekan";
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
    direction: rtl;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    padding: 30px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

header h1 {
    color: #2d3748;
    font-size: 2.2rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

header h1 i {
    color: #667eea;
    font-size: 2.5rem;
}

.subtitle {
    color: #718096;
    font-size: 1.1rem;
}

.chat-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 30px;
}

.chat-header {
    background: linear-gradient(90deg, #667eea, #764ba2);
    color: white;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #48bb78;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.api-info {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.api-info code {
    background: rgba(255, 255, 255, 0.3);
    padding: 2px 8px;
    border-radius: 5px;
}

.chat-messages {
    height: 500px;
    overflow-y: auto;
    padding: 25px;
    background: #f8f9fa;
}

.message {
    display: flex;
    margin-bottom: 25px;
    animation: fadeIn 0.3s ease-in;
    width: 100%;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.bot .avatar {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.message.user .avatar {
    background: linear-gradient(135deg, #48bb78, #38a169);
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-left: 15px;
}

.message.user .avatar {
    margin-left: 0;
    margin-right: 15px;
}

.content {
    background: white;
    padding: 18px;
    border-radius: 15px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    width: 100%;
    position: relative;
}

.message.user .content {
    background: #e6fffa;
    border-top-right-radius: 5px;
}

.message.bot .content {
    background: #f7fafc;
    border-top-left-radius: 5px;
}

.sender {
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.message.user .sender {
    color: #2c7a7b;
}

.message.bot .sender {
    color: #5a67d8;
}

.text {
    color: #4a5568;
    line-height: 1.7;
    font-size: 1.05rem;
    margin-bottom: 10px;
}

.time {
    font-size: 0.8rem;
    color: #a0aec0;
    text-align: left;
}

.chat-input {
    padding: 25px;
    background: white;
    border-top: 1px solid #e2e8f0;
}

.input-container {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

#messageInput {
    flex: 1;
    padding: 18px 25px;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    font-size: 1.1rem;
    transition: all 0.3s;
    outline: none;
}

.border-error{
    border: 2px solid red !important;
}

#messageInput:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#sendButton {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 0 35px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

#sendButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 14px rgba(102, 126, 234, 0.3);
}

#sendButton:active {
    transform: translateY(0);
}

.examples {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
}

.examples p {
    color: #4a5568;
    margin-bottom: 15px;
}

.example-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.example-btn {
    background: white;
    border: 2px solid #e2e8f0;
    padding: 12px 20px;
    border-radius: 50px;
    font-size: 0.95rem;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.3s;
}

.example-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
}

footer {
    text-align: center;
    color: #718096;
    padding-top: 25px;
    border-top: 1px solid #e2e8f0;
    font-size: 0.95rem;
}

footer p {
    margin-bottom: 10px;
}

footer code {
    background: #f7fafc;
    padding: 3px 10px;
    border-radius: 5px;
    color: #2d3748;
}

.copyright {
    color: #a0aec0;
    font-size: 0.9rem;
    margin-top: 15px;
    direction: ltr;
    font-family: "sans-serif";
}

.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 1000;
}

.loading p {
    color: white;
    margin-top: 15px;
    font-size: 1.2rem;
}

.spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.status-dot.disconnected {
    background: #e53e3e;
    animation: none;
}

/* Responsive */

@media(max-width:576px){
    *{
        font-size: 12px !important;
    }
    .input-container{
        flex-direction: column;
        align-items: center;
    }
    #sendButton{
        padding: 10px 30px;
    }
    .chat-header{
        flex-direction: column;
        gap: 20px;
    }
    .example-btn{
        width: 100%;
        padding: 0;
    }
}
