/* css/auth.css - أنماط المصادقة */

.auth-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.auth-form-container {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 3rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  max-width: 400px;
  width: 90%;
  text-align: center;
}

.auth-header {
  margin-bottom: 2rem;
}

.auth-header .app-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.auth-header .app-logo i {
  font-size: 2.5rem;
}

.auth-header .app-logo span {
  font-size: 2rem;
  font-weight: 700;
}

.auth-header h2 {
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 500;
  margin: 0;
}

.auth-form {
  display: none;
  text-align: right;
}

.auth-form.active {
  display: block;
}

.auth-form h3 {
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  text-align: center;
}

.form-group {
  position: relative;
  margin-bottom: 1.5rem;
}

.form-group input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-size: 1rem;
  background: white;
  color: var(--text-primary);
  transition: border-color 0.3s ease;
  direction: rtl;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.1);
}

.form-group i {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 1rem;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(74, 222, 128, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.auth-switch {
  margin-top: 1.5rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.auth-switch a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.auth-switch a:hover {
  color: var(--primary-dark);
}

.debug-link {
  margin-top: 1rem;
  text-align: center;
  padding: 0.5rem;
  background: rgba(255, 193, 7, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(255, 193, 7, 0.3);
}

.debug-link small {
  color: #856404;
  font-size: 0.85rem;
}

.debug-link a {
  color: #856404;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.debug-link a:hover {
  color: #533606;
}

/* حالات الإشعارات */
.notification.success {
  background-color: #10b981;
}

.notification.error {
  background-color: #ef4444;
}

.notification.info {
  background-color: #3b82f6;
}

/* حالة عدم وجود محادثات */
.no-conversations,
.no-messages {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
  color: var(--text-secondary);
  height: 100%;
}

.no-conversations i,
.no-messages i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.no-conversations p,
.no-messages p {
  margin: 0.5rem 0;
  font-size: 1rem;
}

.no-conversations p:first-of-type,
.no-messages p:first-of-type {
  font-weight: 600;
  color: var(--text-primary);
}

/* تحسينات الرسائل */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: var(--background-color);
}

.message {
  display: flex;
  margin-bottom: 1rem;
  max-width: 80%;
}

.message.own {
  margin-left: auto;
  flex-direction: row-reverse;
}

.message.other {
  margin-right: auto;
}

.message-avatar {
  flex-shrink: 0;
  margin: 0 0.5rem;
}

.message-avatar img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.message-content {
  flex: 1;
}

.message-bubble {
  background: var(--message-bg);
  padding: 0.75rem 1rem;
  border-radius: 18px;
  margin-bottom: 0.25rem;
  word-wrap: break-word;
}

.message.own .message-bubble {
  background: var(--message-own-bg);
  color: white;
}

.message-bubble p {
  margin: 0;
  line-height: 1.4;
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 0 0.5rem;
}

.message.own .message-meta {
  justify-content: flex-end;
}

.message-status i {
  font-size: 0.8rem;
}

.message-status.read i {
  color: var(--primary-color);
}

/* تحسينات متجاوبة */
@media (max-width: 768px) {
  .auth-form-container {
    padding: 2rem 1.5rem;
    margin: 1rem;
  }
  
  .auth-header h2 {
    font-size: 1.1rem;
  }
  
  .message {
    max-width: 90%;
  }
}

/* تحسينات الرسوم المتحركة */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-form-container {
  animation: fadeInUp 0.5s ease-out;
}

.message {
  animation: fadeInUp 0.3s ease-out;
}
