/**
 * Flag Badge and Modal Styles
 * Shared styles for booking flag components
 */

/* Flag Badge Base */
.flag-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  user-select: none;
  transition: all 0.15s ease;
}

.flag-badge-compact {
  padding: 2px 6px;
  font-size: 11px;
}

.flag-badge .material-icons {
  font-size: 14px;
}

.flag-badge-compact .material-icons {
  font-size: 12px;
}

/* Category-specific colors */
.flag-badge-guest {
  background: #ecfeff;
  color: #0891b2;
  border: 1px solid rgba(8, 145, 178, 0.2);
}

.flag-badge-task {
  background: #fff7ed;
  color: #ea580c;
  border: 1px solid rgba(234, 88, 12, 0.2);
}

.flag-badge-amenity {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.flag-badge-event {
  background: #fdf2f8;
  color: #db2777;
  border: 1px solid rgba(219, 39, 119, 0.2);
}

/* Flag Badge Group */
.flag-badge-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  min-height: 24px;
}

.flag-badge-more {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 500;
  background: #f1f5f9;
  color: #475569;
  cursor: pointer;
}

.flag-badge-more:hover {
  background: #e2e8f0;
}

/* Flag Modal */
.flag-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.flag-modal {
  background: white;
  border-radius: 12px;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: slideUp 0.2s ease;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

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

.flag-modal-header h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 600;
  color: #111827;
}

.flag-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 12px;
  color: #6b7280;
  font-size: 14px;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.flag-modal-close:hover {
  background: #f3f4f6;
  color: #374151;
}

.flag-modal-add {
  padding: 16px 20px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

.flag-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* Flag Card */
.flag-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 8px;
  transition: box-shadow 0.15s ease;
}

.flag-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.flag-card-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.flag-card-icon .material-icons {
  font-size: 20px;
}

.flag-card-icon-label {
  font-size: 9px;
  font-weight: 600;
  text-align: center;
  line-height: 1.1;
  margin-top: 2px;
}

.flag-card-content {
  flex: 1;
  min-width: 0;
}

.flag-card textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 13px;
  resize: none;
  min-height: 40px;
  background: white;
  transition: border-color 0.15s ease;
}

.flag-card textarea:focus {
  outline: none;
  border-color: #0891b2;
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

.flag-card-meta {
  font-size: 11px;
  color: #6b7280;
  margin-top: 4px;
}

.flag-card-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.flag-delete-btn {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.flag-delete-btn:hover {
  color: #dc2626;
  background: #fee2e2;
}

.flag-confirm-delete {
  background: none;
  border: none;
  color: #dc2626;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  text-align: right;
  line-height: 1.3;
}

.flag-confirm-delete:hover {
  text-decoration: underline;
}

/* Form elements in modal */
.flag-modal select,
.flag-modal input[type="date"] {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  background: white;
  transition: border-color 0.15s ease;
}

.flag-modal select:focus,
.flag-modal input[type="date"]:focus {
  outline: none;
  border-color: #0891b2;
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

.flag-modal select:disabled {
  background: #f3f4f6;
  color: #9ca3af;
}

.flag-add-btn {
  padding: 8px 16px;
  background: #0891b2;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.flag-add-btn:hover:not(:disabled) {
  background: #0e7490;
}

.flag-add-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Flag group section headers */
.flag-group-header {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  text-align: right;
}

/* Empty state */
.flag-empty-state {
  text-align: center;
  color: #6b7280;
  padding: 40px;
}

/* Responsive */
@media (max-width: 640px) {
  .flag-modal {
    max-height: 90vh;
    border-radius: 12px 12px 0 0;
    margin-top: auto;
  }

  .flag-modal-add {
    flex-wrap: wrap;
  }

  .flag-modal-add select,
  .flag-modal-add button {
    flex: 1;
    min-width: calc(50% - 4px);
  }

  .flag-card {
    flex-direction: column;
    align-items: stretch;
  }

  .flag-card-icon {
    width: 100%;
    height: auto;
    flex-direction: row;
    border-radius: 8px;
    padding: 8px 12px;
    gap: 8px;
  }

  .flag-card-actions {
    flex-direction: row;
    justify-content: flex-end;
  }
}
