/* الأساسيات */
:root {
  --primary-color: #6C63FF;
  --primary-dark: #5A52E0;
  --text-color: #2D3748;
  --light-gray: #F7FAFC;
  --medium-gray: #E2E8F0;
  --dark-gray: #718096;
  --white: #FFFFFF;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --transition: all 0.3s ease;
}


/* الهيكل الرئيسي */
.main-content {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background-color: var(--light-gray) !important;
  flex: 1;

}

.content-area {
  width: 100%;
  max-width: 550px; /* تقليل العرض من 600px إلى 550px */
}

.content-wrapper {
  background-color: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  padding: 25px; /* تقليل الـ padding من 30px إلى 25px */
  transition: var(--transition);
}

/* قسم الملف الشخصي */
.profile-section {
  margin-bottom: 25px; /* تقليل المسافة قليلاً */
  text-align: center;
}

.profile-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.avatar-container {
  position: relative;
  width: 90px; /* تقليل الحجم من 100px إلى 90px */
  height: 90px;
  margin: 25px 0 15px;
}

.profile-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  z-index: 2;
  position: relative;
  transition: var(--transition);
}

.profile-avatar:hover {
  transform: scale(1.05);
}

.avatar-border {
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  z-index: 1;
  animation: rotate 6s linear infinite;
}

@keyframes rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.profile-name {
  font-size: 22px; /* تصغير بسيط */
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 6px;
}

.profile-subtitle {
  font-size: 15px;
  color: var(--dark-gray);
}

.profile-bio {
  font-size: 13px;
  color: var(--dark-gray);
  margin-top: 4px;
}

/* قسم إدخال الرسالة */
.message-section {
  margin-bottom: 15px; /* تقليل المسافة */
}

.textarea-wrapper {
  position: relative;
  border-radius: 12px;
  border: 1px solid var(--medium-gray);
  transition: var(--transition);
}

.textarea-wrapper:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(108, 99, 255, 0.2);
}

.message-textarea {
  width: 100%;
  min-height: 150px; /* تقليل الارتفاع من 180px */
  padding: 14px; /* تقليل الـ padding */
  border: none;
  border-radius: 12px;
  resize: none;
  font-size: 15px; /* تقليل الخط */
  color: var(--text-color);
  background-color: var(--white);
  transition: var(--transition);
}

.message-textarea:focus {
  outline: none;
}

.message-textarea::placeholder {
  color: var(--dark-gray);
  opacity: 0.6;
}

.char-counter {
  position: absolute;
  bottom: 8px;
  left: 10px;
  font-size: 11px;
  color: var(--dark-gray);
  background-color: rgba(255, 255, 255, 0.8);
  padding: 2px 5px;
  border-radius: 10px;
}

/* زر الإرسال */
.send-section {
  text-align: center;
}

.send-button {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: var(--white);
  border: none;
  border-radius: 12px;
  padding: 12px 24px; /* تقليل الحجم */
  font-size: 15px; /* تقليل الخط */
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(108, 99, 255, 0.3);
  width: 100%;
  max-width: 280px; /* تصغير max-width */
}

.send-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(108, 99, 255, 0.4);
}

.send-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.send-icon {
  width: 18px; /* تصغير الأيقونة */
  height: 18px;
  transition: var(--transition);
}

.loading-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* التنبيهات المخصصة */
.custom-alert {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  width: 90%;
  max-width: 500px;
  padding: 12px 18px; /* تصغير بسيط */
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 1000;
  opacity: 0;
  transition: all 0.4s ease;
}

.custom-alert.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.custom-alert.success { background-color: #28a745; color: white; }
.custom-alert.error { background-color: #dc3545; color: white; }

.custom-alert .alert-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.custom-alert .alert-message {
  flex: 1;
  padding-right: 12px;
}

.custom-alert .alert-close {
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.custom-alert .alert-close:hover {
  opacity: 0.8;
}

/* التصميم المتجاوب */
@media (max-width: 768px) {
  .content-wrapper { padding: 18px; }
  .profile-name { font-size: 19px; }
  .profile-subtitle { font-size: 13px; }
  .message-textarea { min-height: 130px; }
}

@media (max-width: 480px) {
  .main-content { padding: 8px; }
  .content-wrapper { padding: 12px; border-radius: 10px; }
  .avatar-container { width: 70px; height: 70px; }
  .send-button { padding: 10px; font-size: 14px; }
}
