/* =====================================================
   EVENT DIALOG - COMPACT DESIGN
   Miniature version that fits on screen without scrolling
   ===================================================== */

/* SweetAlert Title - Compact */
.swal2-title {
  font-size: 14px !important;
  font-weight: var(--font-bold) !important;
  color: var(--text-tertiary) !important;
  margin: 0 !important;
  padding: var(--space-1) !important;
  line-height: 1.2 !important;
}

/* Colorful icons */
.swal2-title .fa-calendar-plus {
  color: #4f46e5 !important;
  font-size: 14px !important;
  animation: none !important;
}

.swal2-title .fa-clock {
  color: #059669 !important;
  font-size: 14px !important;
}

/* Dialog Title - Compact */
.dialog-title {
  font-size: 0.9rem;
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin: 0 0 var(--space-2) 0;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid #333333;
  position: relative;
}

.dialog-title::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #666666, transparent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.dialog-title::before {
  content: "📅";
  font-size: 14px;
}

/* =====================================================
   CARD SYSTEM - COMPACT
   ===================================================== */

.event-card {
  margin-bottom: var(--space-2);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.card-header {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-bottom: var(--space-2);
}

.card-icon {
  font-size: 14px;
  line-height: 1;
}

.card-title {
  font-size: 0.8rem;
  font-weight: var(--font-semibold);
  margin: 0;
  line-height: 1;
}

/* Type Card */
.type-card {
  background: transparent;
  border: none;
  padding: 0;
  margin-bottom: var(--space-3);
}

.type-card .card-header {
  display: none;
}

.type-buttons {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
  justify-content: center;
}

.type-btn {
  padding: var(--space-2) var(--space-4);
  border: 2px solid #cccccc;
  border-radius: var(--radius-md);
  background: #f8f9fa;
  color: #6c757d;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.8rem;
  font-weight: var(--font-semibold);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  min-width: 100px;
  position: relative;
}

.type-btn:hover {
  border-color: #007bff;
  background: #e3f2fd;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.event-btn.active {
  background: #007bff !important;
  color: white !important;
  border-color: #007bff !important;
  box-shadow: 0 2px 6px rgba(0, 123, 255, 0.3) !important;
}

.event-btn.active::after {
  content: "✓";
  position: absolute;
  top: -6px;
  right: -6px;
  background: #28a745;
  color: white;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
}

.timeoff-btn.active {
  background: #ffc107 !important;
  color: #000 !important;
  border-color: #ffc107 !important;
  box-shadow: 0 2px 6px rgba(255, 193, 7, 0.3) !important;
}

.timeoff-btn.active::after {
  content: "✓";
  position: absolute;
  top: -6px;
  right: -6px;
  background: #28a745;
  color: white;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
}

/* Contact Card */
.contact-card {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
}

.contact-card:hover {
  border-color: #007bff;
  background: #e3f2fd;
}

.contact-type-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  justify-content: space-between;
}

.contact-type-row label {
  margin: 0;
  font-weight: var(--font-semibold);
  color: #495057;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.contact-type-row .field-input {
  width: 140px;
  padding: var(--space-1) var(--space-2);
  border: 1px solid #ced4da;
  border-radius: var(--radius-sm);
  background: white;
  font-size: 0.8rem;
  font-weight: var(--font-medium);
}

.contact-type-row .field-input:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

/* Company Card */
.company-card {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
}

.company-card:hover {
  border-color: #fd7e14;
  background: #fff8e1;
}

.company-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  justify-content: space-between;
}

.company-row label {
  margin: 0;
  font-weight: var(--font-semibold);
  color: #856404;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.company-row .field-input {
  flex: 1;
  padding: var(--space-1) var(--space-2);
  border: 1px solid #ffeaa7;
  border-radius: var(--radius-sm);
  background: white;
  font-size: 0.8rem;
  font-weight: var(--font-medium);
}

.company-row .field-input:focus {
  border-color: #fd7e14;
  box-shadow: 0 0 0 2px rgba(253, 126, 20, 0.1);
}

/* Time Card - Compact grid */
.time-card {
  background: transparent;
  border: none;
  padding: 0;
}

.time-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.time-field {
  background: #e8f5e8;
  border: 1px solid #c3e6c3;
  border-radius: var(--radius-md);
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.time-field:hover {
  border-color: #28a745;
  background: #d4edda;
}

.to-field {
  background: #ffe8e8;
  border-color: #ffcccb;
}

.to-field:hover {
  border-color: #dc3545;
  background: #f8d7da;
}

.time-card-label {
  font-weight: var(--font-semibold);
  color: #155724;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin: 0;
}

.to-field .time-card-label {
  color: #721c24;
}

.time-field .field-input {
  width: 100%;
  padding: var(--space-1) var(--space-2);
  border: 1px solid #c3e6c3;
  border-radius: var(--radius-sm);
  background: white;
  font-size: 0.75rem;
  font-weight: var(--font-medium);
  text-align: center;
}

.to-field .field-input {
  border-color: #ffcccb;
}

.time-field .field-input:focus {
  border-color: #28a745;
  box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.1);
}

.to-field .field-input:focus {
  border-color: #dc3545;
  box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.1);
}

/* Details Card */
.details-card {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
}

.details-card:hover {
  border-color: #007bff;
  background: #e3f2fd;
}

.details-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* Field Groups - Compact */
.field-group {
  margin-bottom: 0;
}

.field-group label {
  display: block;
  font-weight: var(--font-medium);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
  font-size: 0.75rem;
}

.field-input {
  width: 100%;
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--text-primary);
  font-size: 0.8rem;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.field-input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 2px var(--primary-100);
}

/* Users Select - Compact */
.users-select {
  min-height: 50px;
  max-height: 80px;
  padding: var(--space-1) var(--space-2);
  border: 1px solid #ced4da;
  border-radius: var(--radius-sm);
  background: white;
  font-size: 0.75rem;
  font-weight: var(--font-medium);
}

.users-select:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

/* Notes Textarea - Compact */
.notes-textarea {
  min-height: 40px;
  resize: vertical;
  font-family: inherit;
  border: 1px solid var(--border-primary);
  background: white;
  font-size: 0.75rem;
}

.notes-textarea:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 2px var(--primary-100);
}

/* Important Checkbox - Compact but visible */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  margin: 0;
  font-weight: var(--font-semibold);
  color: #dc3545;
  font-size: 0.8rem;
  background: #fff5f5;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-2);
  transition: all 0.2s ease;
}

.checkbox-label:hover {
  background: #fef2f2;
  border-color: #f87171;
  transform: translateY(-1px);
}

.checkbox-label::before {
  content: "⚠️";
  font-size: 14px;
}

.field-checkbox {
  width: 16px;
  height: 16px;
  accent-color: #dc3545;
  cursor: pointer;
  border: 1px solid #dc3545;
  border-radius: 3px;
}

.checkbox-label:has(.field-checkbox:checked) {
  background: #fee2e2;
  border-color: #dc3545;
  color: #991b1b;
}

.checkbox-label:has(.field-checkbox:checked)::before {
  content: "❗";
}

/* Time Off Card */
.timeoff-card {
  background: #e8f5e8;
  border: 1px solid #c3e6c3;
  padding: var(--space-2);
}

.reminder-options {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.reminder-label {
  background: transparent;
  border: none;
  padding: 0;
  color: #155724;
  font-size: 0.8rem;
}

.reminder-label::before {
  content: "🔔";
  font-size: 14px;
}

.interval-group {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

#intervalLabel {
  font-size: 0.75rem;
  margin: 0;
  color: #155724;
}

.small-input {
  width: 50px;
  padding: var(--space-1);
  font-size: 0.75rem;
}

/* Location Card */
.location-card {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  padding: var(--space-2);
}

.location-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.address-row {
  display: flex;
  gap: var(--space-1);
}

.address-row .field-input {
  flex: 1;
  font-size: 0.75rem;
}

.address-row .field-input:first-child {
  flex: 2;
}

/* Dialog Footer - Compact */
.dialog-footer {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-primary);
  margin-top: var(--space-2);
}

/* Action Buttons - Compact */
.action-btn {
  padding: var(--space-1) var(--space-3);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: var(--font-medium);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.next-btn {
  background: var(--primary-500);
  color: white;
  border-color: var(--primary-500);
}

.next-btn:hover {
  background: var(--primary-600);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.schedule-btn {
  background: var(--success-500);
  color: white;
  border-color: var(--success-500);
}

.schedule-btn:hover {
  background: var(--success-600);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Hidden utility */
.hidden {
  display: none !important;
}

.fade-in {
  animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-2px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =====================================================
   RESPONSIVE DESIGN
   ===================================================== */

@media (max-width: 640px) {
  .type-buttons {
    gap: var(--space-2);
  }

  .type-btn {
    min-width: 80px;
    padding: var(--space-1) var(--space-3);
  }

  .contact-type-row,
  .company-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
  }

  .contact-type-row .field-input,
  .company-row .field-input {
    width: 100%;
  }

  .address-row {
    flex-direction: column;
  }

  .time-row {
    grid-template-columns: 1fr;
  }
}

/* Dark theme support */
[data-theme="dark"] .type-btn {
  background: var(--surface-secondary);
  border-color: var(--border-primary);
}

[data-theme="dark"] .field-input,
[data-theme="dark"] .notes-textarea {
  background: var(--surface-primary);
  border-color: var(--border-primary);
}

[data-theme="dark"] .contact-card,
[data-theme="dark"] .details-card {
  background: var(--surface-secondary);
  border-color: var(--border-primary);
}

/* =====================================================
   SWEETALERT CUSTOM CLASSES FOR UPDATE EVENT
   ===================================================== */

.event-dialog-popup {
  border-radius: 5px !important;
  padding: 0 !important;
}

.event-dialog-title {
  background: linear-gradient(135deg, var(--primary-600) 0%, #764ba2 100%);
  color: white !important;
  padding: var(--space-3) var(--space-4) !important;
  margin: 0 !important;
  border-radius: 5px 5px 0 0 !important;
  font-weight: 600 !important;
  font-size: 1rem !important;
  text-align: center !important;
}

.event-dialog-content {
  padding: var(--space-3) !important;
  max-height: 70vh !important;
  overflow-y: auto !important;
}

.event-dialog-content::-webkit-scrollbar {
  width: 6px;
}

.event-dialog-content::-webkit-scrollbar-track {
  background: var(--surface-secondary);
  border-radius: 3px;
}

.event-dialog-content::-webkit-scrollbar-thumb {
  background: var(--border-primary);
  border-radius: 3px;
}

.event-dialog-content::-webkit-scrollbar-thumb:hover {
  background: var(--primary-600);
}

/* Cancel button styling */
.action-btn.cancel-btn {
  background: var(--surface-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
}

.action-btn.cancel-btn:hover {
  background: var(--surface-tertiary);
  border-color: var(--text-secondary);
}
