@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --font-primary: 'Plus Jakarta Sans', sans-serif;
  
  /* Color Palette - Premium Dark/Glass Theme */
  --bg-app: #080b11;
  --bg-card: rgba(17, 25, 40, 0.65);
  --border-card: rgba(255, 255, 255, 0.08);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  
  --primary: #6366f1; /* Indigo */
  --primary-glow: rgba(99, 102, 241, 0.15);
  --success: #10b981; /* Emerald */
  --success-glow: rgba(16, 185, 129, 0.15);
  --danger: #ef4444; /* Rose */
  --danger-glow: rgba(239, 68, 68, 0.15);
  --warning: #f59e0b; /* Amber */
  --warning-glow: rgba(245, 158, 11, 0.15);
  
  --gradient-title: linear-gradient(135deg, #a5b4fc 0%, #6366f1 50%, #4f46e5 100%);
  --gradient-glow: radial-gradient(circle at 50% -20%, rgba(99, 102, 241, 0.18) 0%, rgba(8, 11, 17, 0) 60%);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-primary);
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-app);
  background-image: var(--gradient-glow);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  padding-bottom: 3rem;
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
}

header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--gradient-title);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.025em;
  margin-bottom: 0.5rem;
}

header p {
  color: var(--text-muted);
  font-size: 1.05rem;
  font-weight: 400;
}

/* API URL Input Section (Initial config if not hardcoded) */
.config-panel {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.config-panel.collapsed {
  display: none;
}

.config-title {
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
}

.config-input-group {
  display: flex;
  gap: 0.75rem;
}

.config-input-group input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s;
}

.config-input-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.btn-primary {
  background: var(--primary);
  border: none;
  border-radius: 10px;
  padding: 0.75rem 1.5rem;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: #4f46e5;
  transform: translateY(-1px);
}

/* Stats Section */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.15);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s;
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-4px);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.stat-card.total::before { background: var(--primary); }
.stat-card.present::before { background: var(--success); }
.stat-card.absent::before { background: var(--danger); }
.stat-card.pax::before { background: var(--warning); }

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.stat-card.total .stat-icon { background: var(--primary-glow); color: var(--primary); }
.stat-card.present .stat-icon { background: var(--success-glow); color: var(--success); }
.stat-card.absent .stat-icon { background: var(--danger-glow); color: var(--danger); }
.stat-card.pax .stat-icon { background: var(--warning-glow); color: var(--warning); }

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

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
  margin-top: 0.15rem;
}

/* Controls (Search & Filter) */
.controls-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  padding: 1.25rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.15);
}

.search-wrapper {
  flex: 1;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s;
}

.search-input:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.filter-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  border-radius: 12px;
  padding: 0.75rem 1.5rem 0.75rem 1rem;
  font-size: 0.95rem;
  outline: none;
  cursor: pointer;
  min-width: 160px;
  transition: all 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
}

.filter-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.btn-refresh {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-main);
  transition: all 0.2s;
}

.btn-refresh:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--primary);
}

.btn-refresh:active {
  transform: scale(0.95);
}

.btn-refresh.spinning i {
  animation: spin 1s linear infinite;
}

/* Data List Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
  min-height: 200px;
}

.data-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  animation: cardFadeIn 0.4s ease forwards;
}

.data-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.25);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0; /* allows text-overflow */
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-glow);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.user-details {
  min-width: 0;
}

.user-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.1rem;
}

/* Badges */
.badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.badge-present {
  background: var(--success-glow);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-absent {
  background: var(--danger-glow);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-maybe {
  background: var(--warning-glow);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-default {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border-card);
}

/* Card Body Message / Wishes */
.card-message {
  font-style: italic;
  font-weight: 400;
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.02);
  border-left: 2px solid var(--primary);
  padding: 0.5rem 0.75rem;
  border-radius: 0 8px 8px 0;
  word-break: break-word;
}

/* Card Extra Info List */
.info-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
  border-top: 1px solid var(--border-card);
  padding-top: 0.75rem;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
}

.info-item i {
  width: 16px;
  color: var(--primary);
  font-size: 0.85rem;
}

.info-value {
  color: var(--text-main);
  font-weight: 500;
}

/* Skeleton Loading State */
.skeleton-card {
  height: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  overflow: hidden;
}

.skeleton-shimmer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.03) 50%, rgba(255,255,255,0) 100%);
  animation: shimmer 1.5s infinite;
}

.skeleton-header {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
}

.skeleton-title {
  height: 16px;
  width: 120px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
}

.skeleton-badge {
  height: 20px;
  width: 60px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  margin-left: auto;
}

.skeleton-body {
  height: 40px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.skeleton-footer {
  height: 30px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
}

/* Empty State */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-card);
  border: 1px dashed var(--border-card);
  border-radius: 20px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.empty-state i {
  font-size: 3rem;
  color: var(--text-muted);
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Footer info */
.last-updated {
  text-align: center;
  margin-top: 2rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Animations */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

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

/* Pagination Styling */
.pagination-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 3rem;
  margin-bottom: 1.5rem;
}

.pagination-info {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

.pagination-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.page-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  user-select: none;
}

.page-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.page-btn:active:not(:disabled) {
  transform: translateY(0);
}

.page-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 14px var(--primary-glow);
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.01);
}

.page-dots {
  color: var(--text-muted);
  padding: 0 0.25rem;
  font-weight: 600;
  letter-spacing: 0.1em;
}

/* Page Size select inside controls */
.page-size-select {
  min-width: 140px;
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .container {
    padding: 1.5rem 1rem;
  }
  
  header h1 {
    font-size: 2rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .controls-card {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  
  .filter-select {
    width: 100%;
  }
  
  .btn-refresh {
    width: 100%;
    height: 42px;
  }
  
  .cards-grid {
    grid-template-columns: 1fr;
  }
  
  .config-input-group {
    flex-direction: column;
  }

  /* Pagination Responsive Tweak */
  .page-btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
    min-width: 36px;
    height: 36px;
    border-radius: 10px;
  }
}
