

/* تنظیمات عمومی */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "MyFont";

}

@font-face {
  font-family: "MyFont";
  src: url("Vazir.woff") format("woff");
  font-weight: normal;
  font-style: normal;
}

body {
    background: linear-gradient(135deg, #86ff76 0%, #3ca071 100%);
    min-height: 100dvh;
    direction:rtl;
    
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.chat-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    height: calc(90vh - 90px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    background: linear-gradient(135deg, #a4ff91 0%, #3ca071 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h1 {
    margin: 0;
    font-size: 24px;
}

.user-info {
    display: flex;
    gap: 10px;
    align-items: center;
}

#connection-status {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 5px;
    font-weight: bold;
}

.status-online {
    background: #28a745;
    color: white;
}

.status-offline {
    background: #dc3545;
    color: white;
}

#username-input {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    width: 150px;
}

.btn {
    padding: 8px 16px;
    border: none;
    background: linear-gradient(135deg, #66eab7 0%, #3ca071 100%);;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
    color: white;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;

}

.btn-primary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-primary:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.welcome-message {
    text-align: center;
    color: #666;
    padding: 40px 20px;
}

.welcome-message p {
    margin-bottom: 10px;
    line-height: 1.6;
}

.note {
    font-size: 12px;
    color: #888;
    font-style: italic;
}

.message {
    margin-bottom: 15px;
    padding: 12px 16px;
    border-radius: 20px;
    max-width: 70%;
    word-wrap: break-word;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.own {
    background: linear-gradient(135deg, #66ea99 0%, #3ca071 100%);
    color: white;
    margin-left: auto;
}

.message.other {
    background: #e9ecef;
    color: #333;
    margin-right: auto;
}

.message-user {
    font-weight: bold;
    font-size: 12px;
    margin-bottom: 4px;
    opacity: 0.8;
}

.message-time {
    font-size: 10px;
    opacity: 0.6;
    margin-top: 4px;
}

.chat-input {
    border-top: 1px solid #dee2e6;
    padding: 20px;
    background: white;
}

.message-form {
    display: flex;
    gap: 10px;
}

.message-form input {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.message-form input:focus {
    outline: none;
    border-color: #667eea;
}

.message-form button {
    padding: 12px 24px;
    background: linear-gradient(135deg, #66eab7 0%, #3ca071 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
}

.message-form button:hover:not(:disabled) {
    background: linear-gradient(135deg, #6fd85a 0%, #3ca071 100%);
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .chat-container {
        height: calc(90vh - 40px);
    }

    .chat-header {
        padding: 15px;
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .user-info {
        width: 100%;
    }

    #username-input {
        flex: 1;
    }

    .chat-messages {
        padding: 15px;
    }

    .message {
        max-width: 85%;
    }

    .chat-input {
        padding: 15px;
    }

    .message-form {
        flex-direction: column;
    }

    .message-form button {
        width: 100%;
    }
}

/* نوتیفیکیشن‌ها */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 15px 20px;
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-width: 300px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.error {
    background: #dc3545;
}

.notification.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}
.file-controls {
  display: flex;
  align-items: center;
  gap: 10px; 
  margin-top: 10px;
  flex-wrap: wrap; }

.file-controls label,
.file-controls input[type="file"],
.file-controls input[type="submit"],
.file-controls input[type="reset"] {
  margin: 0;
  padding: 0;
}

.file-controls input[type="file"] {
    width: 60%;
  padding: 5px;
  border: 1px solid #ccc;
  border-radius: 10px;}

.file-controls input[type="submit"],
.file-controls input[type="reset"] {
  padding: 5px 10px;
  background: linear-gradient(135deg, #66eab7 0%, #3ca071 100%);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.file-controls input[type="submit"]:hover,
.file-controls input[type="reset"]:hover {
  background: linear-gradient(135deg, #66eab7 0%, #3ca071 100%);
}



a {
  padding: 5px;
  border-radius: 5px;
  background: linear-gradient(135deg, #66eab7 0%, #3ca071 100%);
  color: white;
  text-decoration: none;
  font-size: small;
}

.file-controls a:hover {
  text-decoration: underline;
}