/* ========== CONTAINER WIDTH ========== */
.redeem-requests-container {
  max-width: 98%;
  padding: 0 15px;
  margin: 0 auto;
}

/* ========== HERO SECTION ========== */
.redeem-hero {
  position: relative;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  padding: 80px 20px;
  border-radius: 24px;
  margin-bottom: 40px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(240, 147, 251, 0.3);
}

.hero-gradient-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content-wrapper {
  position: relative;
  z-index: 2;
  text-align: center;
  color: white;
}

.hero-icon-container {
  margin-bottom: 30px;
}

.icon-circle {
  width: 100px;
  height: 100px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  animation: float 3s ease-in-out infinite;
}

.icon-circle i {
  font-size: 3rem;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.hero-main-title {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 15px;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);
}

.hero-description {
  font-size: 1.2rem;
  opacity: 0.95;
}

.floating-element {
  position: absolute;
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  animation: float-random 15s ease-in-out infinite;
}

.element-1 { top: 10%; left: 5%; animation-delay: 0s; }
.element-2 { top: 60%; right: 10%; animation-delay: -5s; }
.element-3 { bottom: 20%; left: 15%; animation-delay: -10s; }

@keyframes float-random {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(30px, -30px) rotate(120deg); }
  66% { transform: translate(-20px, 20px) rotate(240deg); }
}

/* ========== FILTERS & ACTIONS CARD ========== */
.filters-actions-card {
  background: white;
  border-radius: 20px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  margin-bottom: 25px;
}

.filter-item {
  display: flex;
  flex-direction: column;
}

/* ✅ สำหรับ filter-item ที่มีปุ่ม ให้ปุ่มอยู่ด้านล่างชิดกับ input อื่นๆ */
.filter-item-button {
  justify-content: flex-end;
}

.filter-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #495057;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
}

.modern-input,
.modern-select {
  padding: 12px 16px;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  background: #f8f9fa;
  width: 100%;
  box-sizing: border-box;
}

.modern-input:focus,
.modern-select:focus {
  outline: none;
  border-color: #f093fb;
  background: white;
  box-shadow: 0 0 0 4px rgba(240, 147, 251, 0.1);
}

.action-buttons-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.action-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-resend {
  background: linear-gradient(135deg, #ffc107, #ff9800);
}

.btn-resend:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-show-all {
  background: linear-gradient(135deg, #6c757d, #5a6268);
}

.btn-export {
  background: linear-gradient(135deg, #28a745, #20c997);
}

.action-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.search-btn-modern {
  padding: 12px 28px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  width: 100%;
  height: 48px;
}

.search-btn-modern:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* ========== TABLE ========== */
.table-modern-card {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  margin-bottom: 30px;
}

.table-card-header {
  background: linear-gradient(135deg, #f093fb, #f5576c);
  color: white;
  padding: 20px 30px;
  display: flex;
  align-items: center;
  font-size: 1.2rem;
  font-weight: 700;
}

.table-container-modern {
  overflow-x: auto;
  padding: 20px;
}

.redeem-table-modern {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
  font-size: 0.85rem;
}

.redeem-table-modern thead th {
  background: #f8f9fa;
  color: #495057;
  font-weight: 600;
  padding: 12px 10px;
  text-align: center;
  white-space: nowrap;
  font-size: 0.8rem;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  z-index: 10;
}

.redeem-table-modern tbody tr {
  background: #f8f9ff;
  transition: all 0.3s ease;
}

.redeem-table-modern tbody tr:hover {
  background: linear-gradient(90deg, #fff5f8, #ffe8f0);
  transform: scale(1.01);
  box-shadow: 0 4px 15px rgba(240, 147, 251, 0.15);
}

.redeem-table-modern tbody td {
  padding: 12px 10px;
  text-align: center;
  vertical-align: middle;
}

.modern-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #f093fb;
}

.date-cell {
  font-size: 0.8rem;
  white-space: nowrap;
  font-family: monospace;
}

.copyable {
  cursor: pointer;
  transition: all 0.2s ease;
}

.copyable:hover {
  color: #f093fb;
  text-decoration: underline;
}

.score-badge {
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
  color: #4338ca;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.8rem;
  display: inline-block;
}

.points-badge {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  color: #991b1b;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.8rem;
  display: inline-block;
}

.amount-display {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  padding: 5px 12px;
  border-radius: 12px;
  font-weight: 700;
  display: inline-block;
  font-size: 0.8rem;
}

.type-badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.75rem;
  display: inline-block;
}

.type-daily {
  background: linear-gradient(135deg, #ffc107, #ff9800);
  color: white;
}

.type-regular {
  background: linear-gradient(135deg, #0dcaf0, #0891b2);
  color: white;
}

.status-badge {
  padding: 5px 12px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.status-pending {
  background: linear-gradient(135deg, #ffc107, #ff9800);
  color: white;
}

.status-processing {
  background: linear-gradient(135deg, #0dcaf0, #0891b2);
  color: white;
}

.status-completed {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
}

.status-failed {
  background: linear-gradient(135deg, #dc3545, #c82333);
  color: white;
}

.code-badge {
  background: #ffc107;
  color: #000;
  padding: 4px 10px;
  border-radius: 8px;
  font-weight: 600;
  font-family: monospace;
  font-size: 0.75rem;
}

.request-id {
  font-family: monospace;
  font-weight: 600;
  color: #6c757d;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.request-id:hover {
  color: #f093fb;
  text-decoration: underline;
}

.expandable-id {
  position: relative;
  display: inline-block;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expandable-id.expanded {
  max-width: none;
  white-space: normal;
  word-break: break-all;
  background: rgba(240, 147, 251, 0.1);
  padding: 4px 8px;
  border-radius: 6px;
}

.error-cell {
  max-width: 250px;
}

.error-message {
  color: #dc3545;
  font-size: 0.75rem;
  cursor: help;
}

/* ========== PAGINATION ========== */
.pagination-modern {
  display: flex;
  justify-content: center;
  align-items: center;
  background: white;
  padding: 20px 30px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.pagination-list {
  display: flex;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}

.page-btn {
  padding: 10px 16px;
  background: white;
  border: 2px solid #e9ecef;
  color: #495057;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.page-btn:hover {
  border-color: #f093fb;
  color: #f093fb;
  transform: translateY(-2px);
}

.page-btn.active {
  background: linear-gradient(135deg, #f093fb, #f5576c);
  color: white;
  border-color: transparent;
}

/* ========== MODAL ========== */
.modern-modal .modal-content {
  border-radius: 20px;
  border: none;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modern-modal-header {
  background: linear-gradient(135deg, #f093fb, #f5576c);
  color: white;
  border-radius: 20px 20px 0 0;
  padding: 20px 30px;
  border-bottom: none;
}

.modern-progress {
  height: 25px;
  border-radius: 12px;
  background: #e9ecef;
}

.modern-progress .progress-bar {
  background: linear-gradient(135deg, #f093fb, #f5576c);
  border-radius: 12px;
  transition: width 0.3s ease;
}

.log-container {
  border: 2px solid #e9ecef;
  border-radius: 12px;
  padding: 15px;
  height: 300px;
  overflow-y: auto;
  background-color: #f8f9fa;
}

#logArea {
  line-height: 1.6;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1400px) {
  .filters-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .filter-item-button {
    grid-column: span 3;
  }
  
  .search-btn-modern {
    max-width: 300px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .hero-main-title {
    font-size: 2rem;
  }
  
  .filters-grid {
    grid-template-columns: 1fr;
  }
  
  .filter-item-button {
    grid-column: span 1;
  }
  
  .action-buttons-row {
    flex-direction: column;
  }
  
  .action-btn {
    width: 100%;
    justify-content: center;
  }
  
  .table-container-modern {
    overflow-x: auto;
  }
  
  .redeem-table-modern {
    font-size: 0.75rem;
  }
  
  .redeem-table-modern thead th,
  .redeem-table-modern tbody td {
    padding: 8px 6px;
  }
}
