/**
 * Contacts Page Styles
 * RTL-compatible styles for contacts management
 */

/* Groups List */
.group-item {
  padding: 10px;
  margin-bottom: 5px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.group-item:hover {
  background: #f5f5f5;
}

.group-item.active {
  background: #00a149;
  color: white;
}

.group-item .group-name {
  font-weight: 500;
  flex: 1;
}

.group-item .group-count {
  font-size: 12px;
  opacity: 0.8;
  margin-left: 8px;
}

[dir="rtl"] .group-item .group-count {
  margin-left: 0;
  margin-right: 8px;
}

.group-item .group-actions {
  display: none;
  gap: 5px;
}

.group-item:hover .group-actions {
  display: flex;
}

.group-item .group-actions button {
  padding: 2px 6px;
  font-size: 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.2s;
}

.group-item .group-actions button:hover {
  background: rgba(0, 0, 0, 0.1);
}

.group-item.active .group-actions button:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Contact Table */
.contact-row {
  cursor: pointer;
  transition: background 0.2s;
}

.contact-row:hover {
  background: #f9f9f9;
}

.contact-actions {
  display: flex;
  gap: 8px;
}

[dir="rtl"] .contact-actions {
  flex-direction: row-reverse;
}

.contact-actions button {
  padding: 5px 10px;
  font-size: 13px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.contact-actions .btn-edit {
  background: #00a149;
  color: white;
}

.contact-actions .btn-edit:hover {
  background: #004724;
}

.contact-actions .btn-delete {
  background: #ef4444;
  color: white;
}

.contact-actions .btn-delete:hover {
  background: #dc2626;
}

/* Import Modal */
.import-instructions {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 15px;
}

[dir="rtl"] .import-instructions {
  text-align: right;
}

.import-instructions h4 {
  margin: 0 0 10px 0;
  color: #0369a1;
}

.import-instructions ul {
  margin: 0;
  padding-left: 20px;
  color: #075985;
}

[dir="rtl"] .import-instructions ul {
  padding-left: 0;
  padding-right: 20px;
}

.import-format-example {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 10px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  margin-top: 10px;
}

.import-textarea {
  width: 100%;
  min-height: 200px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  resize: vertical;
}

.import-textarea:focus {
  outline: none;
  border-color: #00a149;
  box-shadow: 0 0 0 3px rgba(0, 161, 73, 0.1);
}

/* Empty State */
.contacts-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #9ca3af;
}

.contacts-empty-state i {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.5;
}

.contacts-empty-state h3 {
  margin: 0 0 10px 0;
  color: #6b7280;
}

.contacts-empty-state p {
  margin: 0;
  font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
  #contacts-page > div:first-child {
    grid-template-columns: 1fr !important;
  }

  .contact-actions {
    flex-direction: column;
    gap: 5px;
  }

  .contact-actions button {
    width: 100%;
  }
}


/* Custom Modal Styles */
.custom-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.custom-modal.show {
  opacity: 1;
}

.custom-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
}

.custom-modal-content {
  position: relative;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  max-height: 90vh;
  overflow-y: auto;
  z-index: 1;
  transform: scale(0.9);
  transition: transform 0.3s;
}

.custom-modal.show .custom-modal-content {
  transform: scale(1);
}

.custom-modal-small {
  width: 90%;
  max-width: 400px;
}

.custom-modal-medium {
  width: 90%;
  max-width: 600px;
}

.custom-modal-large {
  width: 90%;
  max-width: 800px;
}

.custom-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #e0e0e0;
}

.custom-modal-header h3 {
  margin: 0;
  font-size: 20px;
  color: #333;
}

.custom-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.custom-modal-close:hover {
  background: #f5f5f5;
  color: #333;
}

.custom-modal-body {
  padding: 20px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
}

[dir="rtl"] .modal-actions {
  flex-direction: row-reverse;
}

/* Form Styles */
.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #333;
}

.form-control {
  width: 100%;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: #00a149;
  box-shadow: 0 0 0 3px rgba(0, 161, 73, 0.1);
}

.form-group small {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: #6b7280;
}

/* Button Styles */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: #00a149;
  color: white;
}

.btn-primary:hover {
  background: #004724;
}

.btn-secondary {
  background: #6b7280;
  color: white;
}

.btn-secondary:hover {
  background: #4b5563;
}

.btn-danger {
  background: #ef4444;
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}
