/* עיצוב מערכת הוספת קבצים מרכזית */
/* File Upload System - Central Styles */

/* אזור העלאה ראשי */
.file-upload-container {
  width: calc(100% - 30px);
  max-width: 400px;
  border: 2px solid #BA8663;
  border-radius: 12px;
  padding: 6px 12px;
  text-align: center;
  background: #f9f1dc;
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 0 0 10px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 65px;
}

.file-upload-container:hover {
  border-color: #7bb39b;
}

.file-upload-container.dragover {
  border-color: #7bb39b;
  background: #f0f8f0;
}

.file-upload-container.error {
  border-color: #ff4444 !important;
  background: #f9f1dc !important;
}

/* טקסט אזור ההעלאה */
.file-upload-text {
  font-family: 'Amatica SC', cursive;
  font-size: 22px;
  color: #999;
  margin: 0;
  font-weight: 700;
  line-height: 1;
}

.file-upload-subtext {
  font-family: 'Amatica SC', cursive;
  font-size: 16px;
  color: #999;
  font-weight: 700;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  justify-content: center;
  align-items: center;
  margin-top: 2px;
  line-height: 1;
}

/* אייקונים לסוגי קבצים */
.file-type-icon {
  display: inline-block;
  padding: 2px 6px;
  margin: 0 2px;
  background: rgba(153, 153, 153, 0.1);
  border-radius: 3px;
  color: #999;
  font-size: 14px;
  font-family: 'Amatica SC', cursive;
  font-weight: 700;
}

/* תצוגת כמות קבצים */
.file-count-display {
  font-size: 14px;
  color: #5EA189;
  margin-top: 5px;
  font-family: 'Amatica SC', cursive;
  display: none;
}

/* אזור תצוגה מקדימה */
.file-preview-container {
  display: grid;
  grid-template-columns: repeat(4, 85px);
  gap: 8px;
  margin: 8px 0 0 25px;
  padding: 0;
  width: calc(100% - 25px);
  max-width: 400px;
}

/* פריט תצוגה מקדימה */
.file-preview-item {
  position: relative;
  width: 85px;
  height: 85px;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
}

.file-preview-item:hover {
  box-shadow: 0 3px 8px rgba(0,0,0,0.15);
  transform: scale(1.05);
}

.file-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* תצוגה מקדימה ל-PDF */
.file-preview-item .pdf-preview {
  width: 100%;
  height: 100%;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 15px;
}

.file-preview-item .pdf-icon {
  width: 35px;
  height: 35px;
  margin-bottom: 8px;
}

/* שם הקובץ */
.file-preview-item .file-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.6);
  color: white;
  padding: 4px 6px;
  font-size: 11px;
  text-align: center;
  direction: ltr;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* כפתור מחיקה */
.file-preview-item .remove-file {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #666;
  font-size: 16px;
  line-height: 1;
  z-index: 2;
  transition: all 0.2s ease;
}

.file-preview-item .remove-file:hover {
  background: #ff4444;
  color: white;
  transform: scale(1.1);
}

/* הודעות שגיאה */
.file-error-message {
  color: #ff4444;
  font-family: 'Amatica SC', cursive;
  font-size: 18px;
  font-weight: 700;
  margin: 5px 0 0 30px;
  display: none;
  background: rgba(255, 68, 68, 0.1);
  padding: 4px 12px;
  border-radius: 6px;
  width: fit-content;
}

/* אנימציות */
@keyframes fileUploadPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.file-upload-container.dragover {
  animation: fileUploadPulse 0.3s ease-in-out;
}

/* רספונסיביות */
@media (max-width: 768px) {
  .file-preview-container {
    grid-template-columns: repeat(3, 85px);
    justify-content: center;
  }
  
  .file-upload-container {
    margin: 0 0 10px 15px;
    width: calc(100% - 15px);
  }
  
  .file-preview-container {
    margin: 8px 0 0 15px;
    width: calc(100% - 15px);
  }
}

@media (max-width: 480px) {
  .file-preview-container {
    grid-template-columns: repeat(2, 85px);
    justify-content: center;
  }
  
  .file-upload-text {
    font-size: 20px;
  }
  
  .file-upload-subtext {
    font-size: 14px;
  }
}

/* מצבי טעינה */
.file-upload-container.loading {
  pointer-events: none;
  opacity: 0.7;
}

.file-upload-container.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #BA8663;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* מצבי הצלחה */
.file-upload-container.success {
  border-color: #5EA189;
  background: #f0f8f0;
}

/* מצבי שגיאה */
.file-upload-container.error {
  border-color: #ff4444;
  background: #fff5f5;
}

/* הודעות מערכת */
.file-system-message {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #5EA189;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-family: 'Amatica SC', cursive;
  font-size: 18px;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.file-system-message.show {
  transform: translateX(0);
}

.file-system-message.error {
  background: #ff4444;
}

.file-system-message.warning {
  background: #ff8800;
}

/* התאמות למובייל */
@media (max-width: 600px) {
  .file-system-message {
    top: 10px;
    right: 10px;
    left: 10px;
    font-size: 16px;
    text-align: center;
  }
} 