/* ============================================================
   Modern Minimalist User Dashboard - Mobile First
   ============================================================ */

:root {
  /* Use colors from main site */
  --primary: #ff6b35;
  --primary-dark: #e55a2b;
  --primary-light: #ff8558;
  --secondary: #ffa500;
  --tan-gold: #d4af37;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --dark-bg: #1a1a1a;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  
  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
  background: #f5f5f5;
  color: #ffb300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-top: 0px;

}

/* ============================================================
   Header Overrides (using main site header)
   ============================================================ */

/* Hide old dashboard header styles, use main site header from styles.css */
.dashboard-header {
  display: none;
}

.credits-badge-old {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--shadow-md);
}

.credits-badge svg {
  width: 16px;
  height: 16px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  cursor: pointer;
  padding: var(--spacing-sm);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.user-profile:hover {
  background: var(--gray-100);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.user-info {
  display: none;
}

.user-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--gray-900);
}

.user-email {
  font-size: 12px;
  color: var(--gray-500);
}

/* ============================================================
   Main Content
   ============================================================ */

.dashboard-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--spacing-md);
}

/* Welcome Section */
.welcome-section {
  margin-bottom: var(--spacing-lg);
}

.welcome-section h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: var(--spacing-xs);
}

.welcome-section p {
  font-size: 14px;
  color: var(--gray-500);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.stat-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  transition: all 0.2s ease;
}

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

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-md);
}

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

.stat-icon svg {
  width: 20px;
  height: 20px;
}

.stat-icon.primary {
  background: rgba(255, 107, 53, 0.1);
  color: var(--primary);
}

.stat-icon.success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.stat-icon.warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1;
}

.stat-label {
  font-size: 14px;
  color: var(--gray-500);
  margin-top: var(--spacing-xs);
}

/* Content Card */
.content-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  margin-bottom: var(--spacing-lg);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--gray-200);
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.card-title svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

/* Tabs */
.tabs {
  display: flex;
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  padding: var(--spacing-sm) var(--spacing-md);
  border: none;
  background: transparent;
  color: var(--gray-600);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.tab-btn svg {
  width: 16px;
  height: 16px;
}

.tab-btn:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.tab-btn.active {
  background: var(--primary);
  color: white;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--spacing-xl) var(--spacing-md);
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--spacing-md);
  background: var(--gray-100);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state-icon svg {
  width: 32px;
  height: 32px;
  color: var(--gray-400);
}

.empty-state p {
  color: var(--gray-500);
  font-size: 14px;
}

.empty-state p:first-of-type {
  font-weight: 600;
  color: var(--gray-700);
  font-size: 16px;
  margin-bottom: var(--spacing-xs);
}

/* ============================================================
   Responsive - Tablet
   ============================================================ */

@media (min-width: 640px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .user-info {
    display: block;
  }
  
  .user-avatar {
    width: 40px;
    height: 40px;
  }
  
  .logo img {
    height: 40px;
  }
}

/* ============================================================
   Booking Cards
   ============================================================ */

.booking-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.booking-card {
  background: var(--gray-50);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  border: 1px solid var(--gray-200);
  transition: all 0.2s ease;
}

.booking-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.booking-header {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.booking-date {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  background: white;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--primary);
}

.booking-day {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.booking-month {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
}

.booking-details {
  flex: 1;
}

.booking-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: var(--spacing-sm);
}

.booking-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}

.booking-info-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: 13px;
  color: var(--gray-600);
}

.booking-info-item svg {
  width: 14px;
  height: 14px;
  color: var(--gray-400);
  flex-shrink: 0;
}

.booking-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-sm);
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

.status-badge.confirmed {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.status-badge.completed {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
}

.status-badge.cancelled {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

.status-badge.pending {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-error {
  background: var(--error);
  color: white;
}

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

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--gray-300);
  color: var(--gray-700);
}

.btn-outline:hover {
  background: var(--gray-100);
  border-color: var(--gray-400);
}

/* ============================================================
   Tables
   ============================================================ */

.activity-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.activity-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.activity-table thead {
  background: var(--gray-50);
  border-bottom: 2px solid var(--gray-200);
}

.activity-table th {
  padding: var(--spacing-md);
  text-align: left;
  font-weight: 600;
  color: var(--gray-700);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.activity-table td {
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-600);
}

.activity-table tbody tr {
  transition: background 0.2s ease;
}

.activity-table tbody tr:hover {
  background: var(--gray-50);
}

.activity-table tbody tr:last-child td {
  border-bottom: none;
}

/* Package Cards - Enhanced horizontal layout for desktop */
.packages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 16px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

/* Desktop: Better spacing with 3 columns */
@media (min-width: 1024px) {
  .packages-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}

/* Large desktop: Keep 3 columns with better spacing */
@media (min-width: 1440px) {
  .packages-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 28px;
  }
}

.package-card {
  background: white;
  border: 2px solid var(--gray-200);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s;
  min-height: 280px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.package-card.status-active {
  border-color: #10b981;
  background: linear-gradient(to bottom, rgba(16, 185, 129, 0.05), white);
}

.package-card.status-expiring_soon {
  border-color: #f59e0b;
  background: linear-gradient(to bottom, rgba(245, 158, 11, 0.05), white);
}

.package-card.status-expired {
  border-color: #ef4444;
  background: linear-gradient(to bottom, rgba(239, 68, 68, 0.05), white);
  opacity: 0.7;
}

.package-card.status-depleted {
  border-color: var(--gray-300);
  background: linear-gradient(to bottom, rgba(107, 114, 128, 0.05), white);
  opacity: 0.8;
}

.package-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.package-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 12px;
}

.package-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.package-type {
  font-size: 12px;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.expiration-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.expiration-badge.active {
  background: #d1fae5;
  color: #065f46;
}

.expiration-badge.expiring_soon {
  background: #fef3c7;
  color: #92400e;
}

.expiration-badge.expired {
  background: #fee2e2;
  color: #991b1b;
}

.expiration-badge.pending_activation,
.expiration-badge.badge-pending {
  background: linear-gradient(135deg, #dbeafe 0%, #f3e8ff 100%);
  color: #6366f1;
  border: 1px solid #c7d2fe;
}

.package-card.pending-activation {
  border: 2px solid #c7d2fe;
  background: linear-gradient(to bottom, #ffffff 0%, #f8faff 100%);
}

.package-card.pending-activation .expiration-date {
  background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
  color: #6366f1;
  font-weight: 600;
}

.package-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--gray-200);
}

.package-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.package-detail-label {
  color: var(--gray-600);
}

.package-detail-value {
  font-weight: 600;
}

.expiration-date {
  font-size: 13px;
  color: var(--gray-600);
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Deprecated - keeping for backwards compatibility */
.package-expiry.expired {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

/* ============================================================
   Responsive - Tablet
   ============================================================ */

@media (max-width: 768px) {
  .packages-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Responsive - Desktop
   ============================================================ */

@media (min-width: 1024px) {
  .dashboard-main {
    padding: var(--spacing-xl);
  }

  .welcome-section h1 {
    font-size: 32px;
  }

  .tabs {
    overflow-x: visible;
  }

  .booking-info {
    grid-template-columns: repeat(4, 1fr);
  }

}

/* ============================================================
   Mobile App Styles (PWA)
   ============================================================ */

@media (max-width: 639px) {
  /* Make it feel like a native app */
  body {
    overscroll-behavior-y: contain;
  }

  .dashboard-header {
    padding: var(--spacing-sm) var(--spacing-md);
  }

  .header-content {
    padding: 0;
  }

  /* Bottom safe area for iOS */
  .dashboard-main {
    padding-bottom: calc(var(--spacing-lg) + env(safe-area-inset-bottom));
  }

  /* Touch-friendly tap targets */
  .tab-btn {
    min-height: 44px;
  }

  .btn {
    min-height: 44px;
  }

  /* Optimize for mobile scrolling */
  .activity-table {
    margin: 0 calc(var(--spacing-md) * -1);
    padding: 0 var(--spacing-md);
  }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
  /* Add dark mode styles here if needed */
}


/* Check-in Styles */
.booking-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.checkin-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.5rem 1rem;
  background: #10b981;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.checkin-btn:hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.checkin-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.checkin-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
}

.checkin-badge.checked-in {
  background: #d1fae5;
  color: #065f46;
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.booking-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Extend Package Button */
.btn-extend-package {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
}

.btn-extend-package:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
}

.btn-extend-package:active {
  transform: translateY(0);
}
