/**
 * Trip Manager UI Styles
 */

/* ============================================
   Trip Manager Toggle Button
   ============================================ */
.trip-manager-toggle {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 99;
  padding: 12px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
}

.trip-manager-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

/* ============================================
   Trip Manager Panel
   ============================================ */
.trip-manager-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100%;
  background: white;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  z-index: 999;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}

.trip-manager-panel.active {
  right: 0;
}

.trip-manager-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 2px solid var(--border-color);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.trip-manager-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.trip-manager-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  font-size: 28px;
  color: white;
  cursor: pointer;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.trip-manager-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.trip-manager-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* ============================================
   Trip Actions
   ============================================ */
.trip-actions {
  margin-bottom: 20px;
}

.trip-actions .btn-primary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.trip-actions .btn-primary span {
  font-size: 20px;
  font-weight: bold;
}

/* ============================================
   Trip List
   ============================================ */
.trip-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.trip-list-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.trip-list-empty p {
  margin: 8px 0;
}

.empty-hint {
  font-size: 14px;
  color: var(--text-tertiary);
}

/* ============================================
   Trip Card
   ============================================ */
.trip-card {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: white;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.trip-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
  transform: translateY(-2px);
}

.trip-card.active {
  border-color: var(--primary-color);
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

.trip-card-content {
  flex: 1;
  min-width: 0; /* Allow text truncation */
}

.trip-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.trip-card-header h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trip-badge {
  padding: 2px 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.trip-badge.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.trip-destination,
.trip-dates,
.trip-meta {
  margin: 4px 0;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trip-meta {
  font-size: 12px;
  color: var(--text-tertiary);
}

.trip-card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.trip-action-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  background: var(--bg-secondary);
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.trip-action-btn:hover {
  background: var(--primary-color);
  transform: scale(1.1);
}

.trip-action-btn.danger:hover {
  background: #ef4444;
}

/* ============================================
   Trip Form
   ============================================ */
.trip-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* ============================================
   Message Styles
   ============================================ */
.success-message,
.error-message,
.warning-message {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000; /* Above trip manager panel (999) */
  animation: slideInRight 0.3s ease;
}

.success-message.fade-out,
.error-message.fade-out,
.warning-message.fade-out {
  animation: fadeOut 0.3s ease;
}

.success-message .message-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: white;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  border-left: 4px solid #22c55e;
  min-width: 200px;
}

.error-message .message-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: white;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  border-left: 4px solid #ef4444;
}

.warning-message .message-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: white;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  border-left: 4px solid #f59e0b;
}

.message-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
  flex-shrink: 0;
}

.success-message .message-icon {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
  animation: scaleIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.error-message .message-icon {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.warning-message .message-icon {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

.message-text {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.4;
}

/* ============================================
   Animations
   ============================================ */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes scaleIn {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  60% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
  .trip-manager-toggle {
    top: auto;
    bottom: 20px;
    right: 20px;
  }

  .trip-manager-panel {
    width: 100%;
    right: -100%;
  }

  .trip-manager-panel.active {
    right: 0;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
  
  .success-message,
  .error-message,
  .warning-message {
    top: 10px;
    right: 10px;
    left: 10px;
  }
  
  .success-message .message-content,
  .error-message .message-content,
  .warning-message .message-content {
    padding: 14px 18px;
  }
}

@media (max-width: 480px) {
  .trip-card {
    flex-direction: column;
  }

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

/* ============================================
   Delete Confirmation Modal
   ============================================ */
.delete-modal .modal-content {
  max-width: 480px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.delete-modal .modal-body {
  padding: 48px 40px;
  text-align: center;
}

.centered-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.warning-icon {
  font-size: 64px;
  margin-bottom: 8px;
  animation: bounceIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), pulse 2s ease-in-out infinite;
  filter: drop-shadow(0 4px 12px rgba(255, 193, 7, 0.3));
}

.delete-modal h2 {
  font-size: 26px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
  letter-spacing: -0.5px;
}

.delete-modal p {
  font-size: 16px;
  color: #666666;
  line-height: 1.7;
  margin: 0 0 32px 0;
  max-width: 360px;
}

.delete-modal .form-actions {
  display: flex;
  gap: 16px;
  width: 100%;
  justify-content: center;
}

.delete-modal button {
  flex: 1;
  padding: 16px 24px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.delete-modal .btn-secondary {
  background: white;
  color: #666666;
  border: 2px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.delete-modal .btn-secondary:hover {
  background: #f5f5f5;
  border-color: #d0d0d0;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  color: #333333;
}

.delete-modal .btn-secondary:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.btn-danger {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5253 100%);
  color: white;
  border: none;
  box-shadow: 0 6px 20px rgba(238, 82, 83, 0.4);
  position: relative;
  overflow: hidden;
}

.btn-danger::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn-danger:hover::before {
  left: 100%;
}

.btn-danger:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(238, 82, 83, 0.5);
}

.btn-danger:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(238, 82, 83, 0.4);
}

/* Add icon to danger button */
.btn-danger::after {
  content: '🗑️';
  margin-left: 8px;
  font-size: 16px;
  display: inline-block;
  transition: transform 0.3s ease;
}

.btn-danger:hover::after {
  transform: scale(1.2) rotate(10deg);
}

@keyframes bounceIn {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  60% {
    transform: scale(1.1);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

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

/* Responsive adjustments for delete modal */
@media (max-width: 480px) {
  .delete-modal .modal-content {
    max-width: 90%;
    margin: 20px;
  }
  
  .delete-modal .modal-body {
    padding: 36px 24px;
  }
  
  .delete-modal .form-actions {
    flex-direction: column-reverse;
  }
  
  .delete-modal button {
    width: 100%;
  }
}
