/* =====================================================
   WANDERLUST - COMPONENT STYLES
   Buttons, Forms, Cards, Modals, Toast, Loading, Selects
   ===================================================== */

/* ==================== BUTTONS ==================== */
.btn-primary {
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
  color: white;
  padding: 12px 24px;
  border-radius: var(--border-radius-md);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 12px rgba(8, 72, 135, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(8, 72, 135, 0.4);
}

.btn-lg {
  padding: 16px 32px;
  font-size: 16px;
}

.btn-success {
  background: linear-gradient(135deg, var(--success-500) 0%, var(--success-600) 100%);
  color: white;
  padding: 12px 24px;
  border-radius: var(--border-radius-md);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.btn-purple {
  background: linear-gradient(135deg, var(--purple-500) 0%, var(--purple-600) 100%);
  color: white;
  padding: 12px 24px;
  border-radius: var(--border-radius-md);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning-500) 0%, var(--warning-600) 100%);
  color: white;
  padding: 12px 24px;
  border-radius: var(--border-radius-md);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.btn-info {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: white;
  padding: 12px 24px;
  border-radius: var(--border-radius-md);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.btn-white {
  background: white;
  color: var(--slate-700);
  padding: 12px 24px;
  border-radius: var(--border-radius-md);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-md);
}

.btn-white:hover {
  background: var(--slate-50);
}

.btn-white.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-white-outline {
  background: transparent;
  color: white;
  padding: 10px 20px;
  border-radius: var(--border-radius-md);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 2px solid rgba(255,255,255,0.5);
  transition: all var(--transition-fast);
}

.btn-white-outline:hover {
  background: rgba(255,255,255,0.1);
  border-color: white;
}

.btn-outline {
  background: transparent;
  color: var(--slate-600);
  padding: 10px 20px;
  border-radius: var(--border-radius-md);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 2px solid var(--slate-200);
  transition: all var(--transition-fast);
}

.btn-outline:hover {
  border-color: var(--slate-300);
  background: var(--slate-50);
}

.btn-danger-outline {
  background: transparent;
  color: var(--danger-500);
  padding: 10px 20px;
  border-radius: var(--border-radius-md);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 2px solid var(--danger-200);
  transition: all var(--transition-fast);
}

.btn-danger-outline:hover {
  background: var(--danger-50);
  border-color: var(--danger-300);
}

.btn-link {
  background: none;
  color: var(--primary-600);
  font-size: 13px;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.btn-link:hover {
  color: var(--primary-700);
}

.btn-link-sm {
  background: none;
  border: none;
  color: var(--primary-500);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-fast);
}

.btn-link-sm:hover {
  background: var(--primary-50);
  color: var(--primary-600);
}

/* ==================== FORMS ==================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-700);
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-group label i {
  color: var(--slate-400);
}

.form-select,
.form-input {
  padding: 12px 16px;
  border: 2px solid var(--slate-200);
  border-radius: var(--border-radius-md);
  background: white;
  color: var(--slate-700);
  font-size: 14px;
  transition: all var(--transition-fast);
  outline: none;
}

.form-select:focus,
.form-input:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--primary-100);
}

.form-row {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.form-row .form-group {
  flex: 1;
  min-width: 180px;
}

/* ==================== SECTION CARDS ==================== */
.section-card {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--slate-100);
  margin-bottom: 24px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-header h2 {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-header h2 i {
  color: var(--primary-500);
}

.section-subtitle {
  font-size: 13px;
  color: var(--slate-500);
  font-weight: 400;
}

/* ==================== STATS CARDS ==================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--slate-100);
  transition: all var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.stat-primary .stat-icon {
  background: var(--primary-100);
  color: var(--primary-600);
}

.stat-success .stat-icon {
  background: var(--success-100);
  color: var(--success-600);
}

.stat-warning .stat-icon {
  background: var(--warning-100);
  color: var(--warning-600);
}

.stat-danger .stat-icon {
  background: var(--danger-100);
  color: var(--danger-600);
}

.stat-content {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-family: 'Poppins', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--slate-800);
  line-height: 1;
}

.stat-label {
  font-size: 13px;
  color: var(--slate-500);
  margin-top: 4px;
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  width: 100%;
  grid-column: 1 / -1;
}

.plans-grid:has(.empty-state),
.holidays-content:has(.empty-state),
.events-grid-layout:has(.empty-state),
.weather-layout:has(.empty-state),
.lw-grid:has(.empty-state),
.sun-times-layout:has(.empty-state) {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 300px);
}

.empty-icon {
  width: 100px;
  height: 100px;
  margin: 0 auto 24px;
  background: linear-gradient(135deg, var(--slate-100) 0%, var(--slate-200) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  color: var(--slate-400);
}

.empty-state h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--slate-800);
  margin-bottom: 12px;
}

.empty-state p {
  color: var(--slate-500);
  margin-bottom: 24px;
  font-size: 15px;
  max-width: 400px;
}

/* ==================== LOADING OVERLAY ==================== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 1;
  visibility: visible;
  transition: all var(--transition-normal);
}

.loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-content {
  text-align: center;
}

.loading-spinner {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
}

.spinner-ring {
  position: absolute;
  inset: 0;
  border: 3px solid transparent;
  border-radius: 50%;
  animation: spin 1.5s linear infinite;
}

.spinner-ring:nth-child(1) {
  border-top-color: var(--primary-500);
  animation-delay: 0s;
}

.spinner-ring:nth-child(2) {
  inset: 8px;
  border-right-color: var(--purple-500);
  animation-delay: 0.2s;
  animation-direction: reverse;
}

.spinner-ring:nth-child(3) {
  inset: 16px;
  border-bottom-color: var(--success-500);
  animation-delay: 0.4s;
}

.loading-spinner i {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 20px;
  color: white;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-content p {
  color: white;
  font-size: 14px;
  font-weight: 500;
}

/* ==================== TOAST ==================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1100;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--slate-800);
  color: white;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
  min-width: 280px;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.success {
  background: var(--success-600);
}

.toast.error {
  background: var(--danger-600);
}

.toast.info {
  background: var(--primary-600);
}

.toast i {
  font-size: 18px;
}

.toast span {
  flex: 1;
  font-size: 14px;
}

.toast-close {
  background: none;
  color: rgba(255,255,255,0.7);
  font-size: 16px;
  padding: 4px;
  transition: color var(--transition-fast);
}

.toast-close:hover {
  color: white;
}

/* ==================== MODAL ==================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 1;
  visibility: visible;
  transition: all var(--transition-normal);
}

.modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

.modal-content {
  background: white;
  border-radius: var(--border-radius-xl);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--slate-100);
  color: var(--slate-600);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  z-index: 10;
}

.modal-close:hover {
  background: var(--slate-200);
}

#modal-body {
  padding: 32px;
}

/* ==================== CUSTOM COUNTRY SELECT ==================== */
.custom-select-wrapper {
  position: relative;
  width: 100%;
}

.custom-select-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 2px solid var(--slate-200);
  border-radius: var(--border-radius-md);
  background: white;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 48px;
}

.custom-select-trigger:hover {
  border-color: var(--slate-300);
}

.custom-select-trigger.open {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--primary-100);
  border-radius: var(--border-radius-md) var(--border-radius-md) 0 0;
}

.custom-select-trigger .flag {
  font-size: 20px;
  line-height: 1;
  display: none;
  align-items: center;
}

.custom-select-trigger .flag:not(:empty) {
  display: flex;
}

.custom-select-trigger .flag img {
  width: 24px;
  height: 18px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.custom-select-trigger .selected-text {
  flex: 1;
  font-size: 14px;
  color: var(--slate-700);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-select-trigger .selected-text.placeholder {
  color: var(--slate-400);
}

.custom-select-trigger .arrow {
  color: var(--slate-400);
  font-size: 12px;
  transition: transform var(--transition-fast);
}

.custom-select-trigger.open .arrow {
  transform: rotate(180deg);
}

.custom-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid var(--primary-500);
  border-top: none;
  border-radius: 0 0 var(--border-radius-md) var(--border-radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all var(--transition-fast);
}

.custom-select-dropdown.open {
  max-height: 320px;
  opacity: 1;
  overflow: visible;
}

.custom-select-search {
  position: sticky;
  top: 0;
  padding: 12px;
  background: white;
  border-bottom: 1px solid var(--slate-100);
  z-index: 10;
}

.custom-select-search input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  border: 1px solid var(--slate-200);
  border-radius: var(--border-radius-sm);
  font-size: 14px;
  outline: none;
  transition: all var(--transition-fast);
}

.custom-select-search input:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 2px var(--primary-100);
}

.custom-select-search i {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--slate-400);
  font-size: 14px;
}

.custom-select-options {
  max-height: 250px;
  overflow-y: auto;
}

.custom-select-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.custom-select-option:hover {
  background: var(--slate-50);
}

.custom-select-option.selected {
  background: var(--primary-50);
}

.custom-select-option .flag {
  font-size: 20px;
  line-height: 1;
}

.custom-select-option .flag-img,
.custom-select-trigger .flag-img {
  width: 24px;
  height: 18px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.custom-select-option .country-name {
  flex: 1;
  font-size: 14px;
  color: var(--slate-700);
}

.custom-select-option .country-code {
  font-size: 12px;
  color: var(--slate-400);
  font-weight: 500;
}

.custom-select-option.no-results {
  justify-content: center;
  color: var(--slate-400);
  font-size: 14px;
  cursor: default;
}

.custom-select-option.no-results:hover {
  background: transparent;
}

/* Simple custom select (for city/year - no search) */
.simple-select-wrapper {
  position: relative;
  width: 100%;
}

.simple-select-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 2px solid var(--slate-200);
  border-radius: var(--border-radius-md);
  background: white;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 48px;
}

.simple-select-trigger:hover {
  border-color: var(--slate-300);
}

.simple-select-trigger.open {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--primary-100);
  border-radius: var(--border-radius-md) var(--border-radius-md) 0 0;
}

.simple-select-trigger .select-icon {
  color: var(--primary-500);
  font-size: 14px;
  width: 20px;
  text-align: center;
}

.simple-select-trigger .selected-text {
  flex: 1;
  font-size: 14px;
  color: var(--slate-700);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.simple-select-trigger .selected-text.placeholder {
  color: var(--slate-400);
}

.simple-select-trigger .arrow {
  color: var(--slate-400);
  font-size: 12px;
  transition: transform var(--transition-fast);
}

.simple-select-trigger.open .arrow {
  transform: rotate(180deg);
}

.simple-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid var(--primary-500);
  border-top: none;
  border-radius: 0 0 var(--border-radius-md) var(--border-radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.2s ease;
}

.simple-select-dropdown.open {
  max-height: 250px;
  overflow-y: auto;
  opacity: 1;
}

.simple-select-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 14px;
  color: var(--slate-700);
}

.simple-select-option:hover {
  background: var(--slate-50);
}

.simple-select-option.selected {
  background: var(--primary-50);
  color: var(--primary-700);
  font-weight: 500;
}

.simple-select-option .option-icon {
  color: var(--primary-500);
  font-size: 14px;
  width: 20px;
  text-align: center;
}

.simple-select-option.no-results {
  justify-content: center;
  color: var(--slate-400);
  cursor: default;
}

.simple-select-option.no-results:hover {
  background: transparent;
}

.simple-select-option.loading {
  justify-content: center;
  color: var(--slate-400);
  cursor: default;
}

.simple-select-trigger.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--slate-50);
}

.simple-select-trigger.disabled:hover {
  border-color: var(--slate-200);
}

/* View header form adjustments for custom select */
.view-header-form .custom-select-trigger {
  background: rgba(255,255,255,0.95);
  border-color: transparent;
}

.view-header-form .custom-select-trigger:hover {
  border-color: transparent;
}

.view-header-form .custom-select-trigger.open {
  border-color: white;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.3);
}

.view-header-form .custom-select-dropdown {
  border-color: white;
}
/****/
.demo-empty {
  text-align: center;
  margin-top: 90px;
}

.demo-empty .empty-icon {
  font-size: 70px;
  color: #cbd5e1;
  margin-bottom: 20px;
}

.demo-empty h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}

.demo-empty p {
  color: #64748b;
  font-size: 15px;
  margin-bottom: 25px;
}

.demo-empty button {
  padding: 12px 22px;
  border-radius: 14px;
  font-weight: 600;
}
