/* Shared UX styles: calm, minimal, accessible. */

.toast-root {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: 20px 1fr 34px;
  align-items: start;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 0 18px 40px -26px rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  transform: translateY(-8px);
  opacity: 0;
  transition: transform 180ms ease, opacity 180ms ease;
}

.toast.is-in {
  transform: translateY(0);
  opacity: 1;
}

.toast.is-out {
  transform: translateY(-8px);
  opacity: 0;
}

.toast__icon {
  margin-top: 2px;
  width: 20px;
  height: 20px;
  color: rgba(226, 232, 240, 0.92);
}

.toast__icon svg { width: 20px; height: 20px; }

.toast__title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(226, 232, 240, 0.92);
  margin-bottom: 2px;
}

.toast__text {
  font-size: 13px;
  line-height: 1.35;
  color: rgba(226, 232, 240, 0.86);
}

.toast__close {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.12);
  color: rgba(226, 232, 240, 0.85);
  transition: background 160ms ease, border-color 160ms ease, transform 120ms ease;
}

.toast__close:hover {
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.18);
}

.toast__close:active { transform: scale(0.98); }

.toast--success { border-color: rgba(34, 197, 94, 0.22); }
.toast--error   { border-color: rgba(244, 63, 94, 0.22); }
.toast--warning { border-color: rgba(234, 179, 8, 0.22); }

.is-invalid {
  outline: none !important;
  border-color: rgba(244, 63, 94, 0.45) !important;
  box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.10) !important;
}

.field-error {
  font-size: 12px;
  margin-top: 6px;
  color: rgba(253, 164, 175, 0.95);
}
/* ── Toast تحسين بصري ── */
.toast {
  font-family: 'Inter', -apple-system, sans-serif;
}

/* Light mode: خلفية فاتحة أنيقة */
html:not(.dark) .toast {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.15);
}
html:not(.dark) .toast__icon { color: #475569; }
html:not(.dark) .toast__title { color: #1e293b; }
html:not(.dark) .toast__text { color: #475569; }
html:not(.dark) .toast__close {
  border-color: rgba(148, 163, 184, 0.2);
  color: #64748b;
}
html:not(.dark) .toast__close:hover {
  background: rgba(148, 163, 184, 0.08);
}

html:not(.dark) .toast--success { border-color: rgba(34, 197, 94, 0.3); }
html:not(.dark) .toast--success .toast__icon { color: #16a34a; }
html:not(.dark) .toast--error { border-color: rgba(239, 68, 68, 0.3); }
html:not(.dark) .toast--error .toast__icon { color: #dc2626; }
html:not(.dark) .toast--warning { border-color: rgba(234, 179, 8, 0.3); }
html:not(.dark) .toast--warning .toast__icon { color: #ca8a04; }

/* Field error in light mode */
html:not(.dark) .field-error {
  color: #dc2626;
}
html:not(.dark) .is-invalid {
  border-color: rgba(239, 68, 68, 0.5) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08) !important;
}
/* ── Shake animation ── */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15%, 55% { transform: translateX(-5px); }
  35%, 75% { transform: translateX(5px); }
}
.animate-shake { animation: shake 0.4s ease-in-out; }
/* ── Table Fix ── */
.prose {
  overflow-x: auto;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  direction: rtl;
  margin: 1rem 0;
  font-size: 0.875rem;
  table-layout: auto;
}

.prose table thead tr {
  background: rgba(99, 102, 241, 0.18);
}

.prose table th {
  padding: 10px 14px;
  text-align: right;
  border: 1px solid rgba(148, 163, 184, 0.25);
  font-weight: 600;
  white-space: nowrap;
}

.prose table td {
  padding: 8px 14px;
  text-align: right;
  border: 1px solid rgba(148, 163, 184, 0.15);
  vertical-align: top;
  line-height: 1.6;
}

.prose table tr:nth-child(even) {
  background: rgba(148, 163, 184, 0.05);
}

.prose table tr:hover {
  background: rgba(99, 102, 241, 0.07);
}

/* Light mode */
html:not(.dark) .prose table thead tr {
  background: rgba(99, 102, 241, 0.1);
}

html:not(.dark) .prose table th {
  border-color: rgba(0, 0, 0, 0.12);
  color: #1e293b;
}

html:not(.dark) .prose table td {
  border-color: rgba(0, 0, 0, 0.08);
}

html:not(.dark) .prose table tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.025);
}

/* ═══════════════════════════════════════════════════════════════
   ██████╗ ███████╗███████╗██╗████████╗ ██████╗ ███╗   ██╗███████╗
   ██╔══██╗██╔════╝██╔════╝██║╚══██╔══╝██╔═══██╗████╗  ██║██╔════╝
   ██████╔╝█████╗  ███████╗██║   ██║   ██║   ██║██╔██╗ ██║███████╗
   ██╔══██╗██╔══╝  ╚════██║██║   ██║   ██║   ██║██║╚██╗██║╚════██║
   ██║  ██║███████╗███████║██║   ██║   ╚██████╔╝██║ ╚████║███████║
   ╚═╝  ╚═╝╚══════╝╚══════╝╚═╝   ╚═╝    ╚═════╝ ╚═╝  ╚═══╝╚══════╝
   ═══════════════════════════════════════════════════════════════
   تصميم احترافي لعرض الملفات - File Attachment Professional Design
   ═══════════════════════════════════════════════════════════════ */

/* ── الحاوية الرئيسية للملف المرفق ── */
.file-chip-attachment {
  flex-shrink: 0;
  animation: fileChipSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fileChipSlideIn {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── حاوية الملف الداخلية ── */
.file-chip-container {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, rgba(148, 163, 184, 0.2));
  border-radius: 14px;
  box-shadow: 
    0 1px 3px rgba(0, 0, 0, 0.08),
    0 4px 12px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  min-width: 200px;
  max-width: 320px;
}

.file-chip-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
}

.file-chip-container:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.12),
    0 8px 24px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  border-color: var(--primary, #3b82f6);
}

/* ── أيقونة الملف الملونة ── */
.file-chip-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  position: relative;
  overflow: hidden;
}

.file-chip-icon::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.25) 0%, transparent 50%);
  pointer-events: none;
}

.file-chip-icon svg {
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

/* ── محتوى الملف (الاسم والمعلومات) ── */
.file-chip-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.file-chip-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #1e293b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.file-chip-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-3, #64748b);
  font-weight: 500;
}

.file-chip-type {
  padding: 2px 6px;
  background: rgba(148, 163, 184, 0.12);
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-2, #475569);
}

.file-chip-dot {
  opacity: 0.4;
  font-size: 10px;
}

.file-chip-size {
  font-variant-numeric: tabular-nums;
}

/* ── زر الحذف ── */
.file-chip-remove {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-3, #94a3b8);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  opacity: 0.7;
}

.file-chip-remove:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  opacity: 1;
  transform: scale(1.05);
}

.file-chip-remove:active {
  transform: scale(0.95);
}

.file-chip-remove svg {
  transition: transform 0.2s ease;
}

.file-chip-remove:hover svg {
  transform: rotate(90deg);
}

/* ═══════════════════════════════════════════════════════════════
   الوضع الداكن - Dark Mode
   ═══════════════════════════════════════════════════════════════ */

.dark .file-chip-container {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(71, 85, 105, 0.4);
  box-shadow: 
    0 1px 3px rgba(0, 0, 0, 0.3),
    0 4px 12px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.dark .file-chip-container:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: var(--primary, #60a5fa);
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.4),
    0 8px 32px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.dark .file-chip-name {
  color: #f1f5f9;
}

.dark .file-chip-meta {
  color: #94a3b8;
}

.dark .file-chip-type {
  background: rgba(71, 85, 105, 0.4);
  color: #cbd5e1;
}

.dark .file-chip-remove {
  color: #64748b;
}

.dark .file-chip-remove:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

/* ═══════════════════════════════════════════════════════════════
   تأثيرات خاصة - Special Effects
   ═══════════════════════════════════════════════════════════════ */

/* تأثير الوميض عند إضافة ملف جديد */
.file-chip-attachment.adding .file-chip-container {
  animation: fileChipGlow 0.6s ease;
}

@keyframes fileChipGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
  50% { box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2); }
}

/* تأثير الاختفاء عند الحذف */
.file-chip-attachment.removing {
  animation: fileChipSlideOut 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fileChipSlideOut {
  to {
    opacity: 0;
    transform: translateX(-20px) scale(0.9);
    max-width: 0;
    margin: 0;
    padding: 0;
  }
}

/* ═══════════════════════════════════════════════════════════════
   تحسينات للشاشات الصغيرة - Mobile Responsive
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
  .file-chip-container {
    min-width: 160px;
    max-width: 260px;
    padding: 8px 12px;
    gap: 10px;
  }
  
  .file-chip-icon {
    width: 38px;
    height: 38px;
  }
  
  .file-chip-icon svg {
    width: 18px;
    height: 18px;
  }
  
  .file-chip-name {
    font-size: 12px;
  }
  
  .file-chip-meta {
    font-size: 10px;
  }
  
  .file-chip-type {
    font-size: 8px;
    padding: 1px 4px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   تنسيق معاينة الملفات العامة - File Preview Area
   ═══════════════════════════════════════════════════════════════ */

#file-preview {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  max-height: 200px;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

#file-preview:not(.hidden) {
  display: block !important;
  animation: filePreviewSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes filePreviewSlideIn {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#file-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px 4px;
  overflow-y: auto;
  max-height: 140px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
  align-content: flex-start;
  align-items: flex-start;
}

#file-chips::-webkit-scrollbar {
  width: 4px;
}

#file-chips::-webkit-scrollbar-track {
  background: transparent;
}

#file-chips::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 2px;
}

#file-chips::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.5);
}

/* تنسيق زر مسح جميع الملفات */
#clear-files {
  transition: all 0.2s ease;
  flex-shrink: 0;
  position: sticky;
  top: 0;
}

#clear-files:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  transform: rotate(15deg);
}

.dark #clear-files:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

/* تصغير حجم بطاقات الملفات في المعاينة */
.file-chip-attachment {
  flex-shrink: 0;
  animation: fileChipPopIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fileChipPopIn {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(10px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.file-chip-container {
  padding: 6px 10px;
  min-width: 140px;
  max-width: 200px;
  gap: 8px;
}

.file-chip-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

.file-chip-icon svg {
  width: 14px;
  height: 14px;
}

.file-chip-name {
  font-size: 11px;
  max-width: 100px;
}

.file-chip-meta {
  font-size: 9px;
  gap: 4px;
}

.file-chip-type {
  font-size: 7px;
  padding: 1px 3px;
}

.file-chip-dot {
  font-size: 8px;
}

.file-chip-remove {
  width: 24px;
  height: 24px;
}

.file-chip-remove svg {
  width: 12px;
  height: 12px;
}

/* ═══════════════════════════════════════════════════════════════
   ███╗   ███╗███████╗███████╗███████╗ █████╗  ██████╗ ███████╗
   ████╗ ████║██╔════╝██╔════╝██╔════╝██╔══██╗██╔════╝ ██╔════╝
   ██╔████╔██║█████╗  ███████╗███████╗███████║██║  ███╗█████╗  
   ██║╚██╔╝██║██╔══╝  ╚════██║╚════██║██╔══██║██║   ██║██╔══╝  
   ██║ ╚═╝ ██║███████╗███████║███████║██║  ██║╚██████╔╝███████╗
   ╚═╝     ╚═╝╚══════╝╚══════╝╚══════╝╚═╝  ╚═╝ ╚═════╝ ╚══════╝
   ═══════════════════════════════════════════════════════════════
   عرض الملفات في الرسائل - Message Attachments Design
   ═══════════════════════════════════════════════════════════════ */

/* ── حاوية المرفقات الرئيسية ── */
.message-attachments {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
  animation: attachmentsFadeIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes attachmentsFadeIn {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── قسم الصور ── */
.message-attachments-images {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.message-image-wrapper {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.15),
    0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 280px;
  max-height: 200px;
}

.message-image-wrapper:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.2),
    0 2px 6px rgba(0, 0, 0, 0.1);
}

.message-attachment-image {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 280px;
  max-height: 200px;
  object-fit: cover;
  border-radius: 16px;
}

.message-image-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 14px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.message-image-wrapper:hover .message-image-overlay {
  opacity: 1;
}

.message-image-name {
  font-size: 11px;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.message-image-size {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.8);
  font-variant-numeric: tabular-nums;
}

/* ── قسم الملفات ── */
.message-attachments-files {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.message-file-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 14px;
  box-shadow: 
    0 1px 3px rgba(0, 0, 0, 0.05),
    0 2px 8px rgba(0, 0, 0, 0.03),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 180px;
  max-width: 320px;
  animation: fileCardSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fileCardSlideIn {
  0% {
    opacity: 0;
    transform: scale(0.95) translateY(5px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.message-file-card:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.1),
    0 8px 24px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  border-color: var(--primary, #3b82f6);
}

.message-file-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  position: relative;
  overflow: hidden;
}

.message-file-icon::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
  pointer-events: none;
}

.message-file-icon svg {
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}

.message-file-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.message-file-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #1e293b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.message-file-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-3, #64748b);
  font-weight: 500;
}

.message-file-type {
  padding: 2px 6px;
  background: rgba(148, 163, 184, 0.12);
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-2, #475569);
}

.message-file-dot {
  opacity: 0.4;
  font-size: 10px;
}

.message-file-size {
  font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════════════════════════
   الوضع الداكن للرسائل - Dark Mode for Messages
   ═══════════════════════════════════════════════════════════════ */

.dark .message-file-card {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(71, 85, 105, 0.35);
  box-shadow: 
    0 1px 3px rgba(0, 0, 0, 0.25),
    0 2px 8px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.dark .message-file-card:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: var(--primary, #60a5fa);
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.35),
    0 8px 32px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.dark .message-file-name {
  color: #f1f5f9;
}

.dark .message-file-meta {
  color: #94a3b8;
}

.dark .message-file-type {
  background: rgba(71, 85, 105, 0.35);
  color: #cbd5e1;
}

.dark .message-image-wrapper {
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.3),
    0 1px 3px rgba(0, 0, 0, 0.2);
}

.dark .message-image-wrapper:hover {
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.4),
    0 2px 6px rgba(0, 0, 0, 0.25);
}

/* ═══════════════════════════════════════════════════════════════
   تحسينات للشاشات الصغيرة - Mobile Responsive
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
  .message-attachments {
    gap: 10px;
  }
  
  .message-image-wrapper {
    max-width: 100%;
    width: 100%;
  }
  
  .message-attachment-image {
    max-width: 100%;
    width: 100%;
    max-height: 180px;
  }
  
  .message-file-card {
    min-width: 100%;
    max-width: 100%;
    padding: 10px 14px;
  }
  
  .message-file-icon {
    width: 38px;
    height: 38px;
  }
  
  .message-file-icon svg {
    width: 18px;
    height: 18px;
  }
  
  .message-file-name {
    font-size: 12px;
  }
  
  .message-file-meta {
    font-size: 10px;
  }
  
  .message-file-type {
    font-size: 8px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   ██████╗ ██╗██╗     ███████╗███████╗     ██████╗ ███╗   ██╗██╗   ██╗
   ██╔══██╗██║██║     ██╔════╝██╔════╝    ██╔═══██╗████╗  ██║╚██╗ ██╔╝
   ██████╔╝██║██║     █████╗  ███████╗    ██║   ██║██╔██╗ ██║ ╚████╔╝ 
   ██╔══██╗██║██║     ██╔══╝  ╚════██║    ██║   ██║██║╚██╗██║  ╚██╔╝  
   ██████╔╝██║███████╗███████╗███████║    ╚██████╔╝██║ ╚████║   ██║   
   ╚═════╝ ╚═╝╚══════╝╚══════╝╚══════╝     ╚═════╝ ╚═╝  ╚═══╝   ╚═╝   
   ═══════════════════════════════════════════════════════════════════
   عرض الملف كمحتوى رئيسي (بدون نص) - File as Main Content
   ═══════════════════════════════════════════════════════════════════ */

/* ── حاوية الملف الرئيسي ── */
.message-file-content-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 32px;
  background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(248,250,252,0.9) 100%);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 20px;
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.06),
    0 1px 3px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  animation: fileContentMainFadeIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-width: 200px;
  max-width: 100%;
}

@keyframes fileContentMainFadeIn {
  0% {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ── الأيقونة الكبيرة ── */
.message-file-big-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.15),
    0 2px 8px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  position: relative;
  overflow: hidden;
  animation: fileBigIconPulse 2s ease-in-out infinite;
}

@keyframes fileBigIconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.message-file-big-icon::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.25) 0%, transparent 50%);
  pointer-events: none;
}

.message-file-big-icon svg {
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* ── اسم الملف الكبير ── */
.message-file-big-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text, #1e293b);
  text-align: center;
  max-width: 280px;
  word-break: break-word;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

/* ── معلومات الملف الكبيرة ── */
.message-file-big-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-3, #64748b);
  font-weight: 500;
}

.message-file-big-type {
  padding: 3px 8px;
  background: rgba(148, 163, 184, 0.12);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-2, #475569);
}

.message-file-big-dot {
  opacity: 0.4;
  font-size: 12px;
}

.message-file-big-size {
  font-variant-numeric: tabular-nums;
}

/* ── تنسيق خاص للرسائل التي تحتوي على ملفات فقط ── */
.files-only-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.files-only-content .message-attachments {
  margin-bottom: 0;
  width: 100%;
  display: flex;
  align-items: center;
}

.files-only-content .message-file-content-main {
  margin: 0 auto;
}

/* ═══════════════════════════════════════════════════════════════
   الوضع الداكن - Dark Mode
   ═══════════════════════════════════════════════════════════════ */

.dark .message-file-content-main {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.9) 100%);
  border-color: rgba(71, 85, 105, 0.35);
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.3),
    0 1px 3px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.dark .message-file-big-name {
  color: #f1f5f9;
}

.dark .message-file-big-meta {
  color: #94a3b8;
}

.dark .message-file-big-type {
  background: rgba(71, 85, 105, 0.4);
  color: #cbd5e1;
}

/* ═══════════════════════════════════════════════════════════════
   تحسينات للشاشات الصغيرة - Mobile Responsive
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
  .message-file-content-main {
    padding: 20px 24px;
    min-width: 160px;
  }
  
  .message-file-big-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
  }
  
  .message-file-big-icon svg {
    width: 26px;
    height: 26px;
  }
  
  .message-file-big-name {
    font-size: 13px;
    max-width: 220px;
  }
  
  .message-file-big-meta {
    font-size: 11px;
  }
  
  .message-file-big-type {
    font-size: 9px;
  }
}
