/* Modern Chest Modal - Tailwind-Inspired Design */

/* Backdrop with blur effect */
.chest-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 1;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chest-modal-backdrop.closing {
  opacity: 0;
}

/* Modern modal container - COMPACT SPLIT PANEL LAYOUT */
.chest-modal {
  position: relative;
  width: 100%;
  max-width: 65rem; /* More compact - 960px */
  max-height: min(600px, 75vh); /* Reduced height */
  background: #0f172a;
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 0.75rem; /* Slightly smaller radius */
  padding: 0;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.7);
  animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-1rem);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Modern header - COMPACT & STICKY */
.chest-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem; /* Reduced padding */
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.7));
  position: relative;
  top: 0;
  z-index: 20;
}

.chest-modal-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chest-modal h3 {
  font-size: 1.1rem; /* Smaller font */
  font-weight: 600;
  color: #f1f5f9;
  margin: 0;
  letter-spacing: -0.025em;
}

.chest-modal-title i {
  color: #fbbf24;
  font-size: 1.25rem;
}

.chest-modal-subtitle {
  color: #94a3b8;
  font-size: 0.875rem;
  margin: 0.25rem 0 0 0;
  font-style: italic;
}

/* Close button - Top right */
.btn-cancel {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  font-size: 1.125rem;
}

.btn-cancel:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  transform: rotate(90deg);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
}

/* COMPACT SPLIT PANEL LAYOUT */
.chest-modal-body {
  display: flex;
  height: calc(80vh - 50px); /* Adjusted for smaller header */
  overflow: hidden;
}

/* LEFT PANEL - Chest List & Search - COMPACT */
.chest-left-panel {
  width: 18rem; /* 288px - More compact */
  border-right: 1px solid rgba(99, 102, 241, 0.2);
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.6);
  max-height: 100%;
}

/* RIGHT PANEL - Chest Detail & Actions */
.chest-right-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  overflow-y: auto;
}

/* Search section - Left Panel - COMPACT */
.chest-modal-search-section {
  padding: 0.75rem; /* Reduced padding */
  border-bottom: 1px solid rgba(99, 102, 241, 0.15);
  flex-shrink: 0;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(100, 116, 139, 0.5);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input-wrapper:focus-within {
  background: rgba(15, 23, 42, 1);
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.search-icon {
  color: #64748b;
  font-size: 0.875rem;
  margin-right: 0.5rem;
  transition: color 0.2s;
}

.search-input-wrapper:focus-within .search-icon {
  color: #6366f1;
}

.search-input-wrapper input {
  flex: 1;
  background: transparent;
  border: none;
  color: #f1f5f9;
  font-size: 0.875rem;
  padding: 0.5rem 0;
  outline: none;
}

.search-input-wrapper input::placeholder {
  color: #64748b;
  opacity: 0.7;
}

.search-clear-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.25rem;
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}

.search-clear-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* Results container - Left Panel Scrollable - COMPACT */
.chest-modal-results {
  flex: 1;
  overflow-y: auto;
  padding: 0.25rem 0.5rem;
  max-height: 1000px;
}

/* Compact chest list item */
.chest-result-row {
  display: flex;
  align-items: center;
  gap: 0.4rem; /* Reduced gap */
  padding: 0.4rem 0.5rem; /* Reduced padding */
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(71, 85, 105, 0.4);
  border-radius: 0.4rem; /* Smaller radius */
  margin-bottom: 0.2rem; /* Reduced margin */
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.chest-result-row:hover,
.chest-result-row.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: #6366f1;
  transform: translateX(2px);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.chest-result-img {
  width: 2rem; /* 2.25rem → 2rem */
  height: 2rem;
  border-radius: 0.375rem;
  border: 1px solid rgba(251, 191, 36, 0.4);
  object-fit: contain;
  flex-shrink: 0;
  background: rgba(15, 23, 42, 0.6);
  padding: 0.125rem;
}

.chest-result-name {
  flex: 1;
  color: #f1f5f9;
  font-weight: 500;
  font-size: 0.75rem; /* 0.8125rem → 0.75rem */
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chest-result-count {
  color: #94a3b8;
  font-size: 0.6875rem; /* 0.75rem → 0.6875rem */
  white-space: nowrap;
  background: rgba(99, 102, 241, 0.1);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
}

/* RIGHT PANEL - Empty State */
.chest-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 2rem;
  text-align: center;
  color: #64748b;
}

.chest-empty-state i {
  font-size: 4rem;
  color: #6366f1;
  opacity: 0.3;
  margin-bottom: 1rem;
}

.chest-empty-state h4 {
  color: #cbd5e1;
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.chest-empty-state p {
  color: #94a3b8;
  font-size: 0.875rem;
  margin: 0;
}

/* RIGHT PANEL - Chest Detail View - COMPACT */
.chest-detail-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1rem; /* Reduced padding */
}

.chest-detail-header-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem; /* Reduced gap */
  padding: 1rem; /* Reduced padding */
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 0.5rem; /* Smaller radius */
  margin-bottom: 0.75rem; /* Reduced margin */
  position: relative;
  top: 0;
  z-index: 10;
}

.chest-detail-icon-large {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 0.75rem;
  border: 2.5px solid #fbbf24;
  object-fit: contain;
  background: rgba(15, 23, 42, 0.8);
  padding: 0.5rem;
  box-shadow: 
    0 0 30px rgba(251, 191, 36, 0.4),
    0 0 60px rgba(251, 191, 36, 0.2);
  transition: all 0.3s;
}

.chest-detail-icon-large:hover {
  transform: scale(1.05);
  box-shadow: 
    0 0 40px rgba(251, 191, 36, 0.5),
    0 0 80px rgba(251, 191, 36, 0.3);
}

.chest-detail-title-large {
  color: #fbbf24;
  font-size: 1.375rem;
  font-weight: 700;
  margin: 0;
  text-align: center;
  text-shadow: 0 2px 10px rgba(251, 191, 36, 0.3);
}

.chest-detail-subtitle {
  color: #cbd5e1;
  font-size: 0.8125rem;
  margin: 0;
  font-style: italic;
  opacity: 0.9;
}

/* Modern action buttons - Right Panel */
.chest-result-actions {
  display: none; /* Hidden in left panel, only shown in detail view */
}

/* Action buttons in detail view */
.chest-detail-actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.chest-detail-actions .chest-result-input-group {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.875rem 1rem;
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 0.75rem;
}

.chest-detail-actions label {
  color: #e2e8f0;
  font-weight: 600;
  font-size: 0.75rem;
}

.chest-detail-actions input {
  width: 3.5rem;
  padding: 0.5rem;
  background: rgba(15, 23, 42, 0.8);
  border: 2px solid rgba(99, 102, 241, 0.3);
  border-radius: 0.5rem;
  color: #f1f5f9;
  font-size: 0.875rem;
  font-weight: 700;
  text-align: center;
}

.chest-detail-actions input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.chest-detail-actions .btn-info {
  width: 2rem;
  height: 2rem;
  padding: 0;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border: 1px solid rgba(99, 102, 241, 0.5);
  border-radius: 0.375rem;
  color: #fff;
  cursor: pointer;
  font-size: 0.875rem;
}

.chest-detail-actions .btn-info:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.chest-quick-multipliers {
  display: flex;
  gap: 0.375rem;
}

.chest-quick-btn {
  padding: 0.375rem 0.625rem;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 0.375rem;
  color: #fbbf24;
  font-size: 0.6875rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.chest-quick-btn:hover {
  background: rgba(251, 191, 36, 0.2);
  border-color: #fbbf24;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
}

/* Primary action buttons */
.chest-primary-actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.chest-primary-actions .btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0.625rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.chest-result-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.chest-primary-actions .btn-success {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #fff;
  border-color: rgba(34, 197, 94, 0.6);
}

.chest-primary-actions .btn-success:hover {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
  transform: translateY(-2px);
}

.chest-primary-actions .btn-warning {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #0f172a;
  font-weight: 700;
  border-color: rgba(251, 191, 36, 0.6);
}

.chest-primary-actions .btn-warning:hover {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 6px 20px rgba(251, 191, 36, 0.4);
  transform: translateY(-2px);
}

/* Drop list table */
.chest-detail-drops {
  flex: 1;
  overflow-y: auto;
  background: rgba(30, 41, 59, 0.3);
  border: 1px solid rgba(71, 85, 105, 0.6);
  border-radius: 0.75rem;
  padding: 0;
}

.chest-detail-drops table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.chest-detail-drops th {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(71, 85, 105, 0.4));
  color: #e2e8f0;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.875rem 1rem;
  border-bottom: 2px solid rgba(99, 102, 241, 0.3);
  text-align: center; /* Ortalanmış */
}

.chest-detail-drops td {
  padding: 0.75rem 1rem;
  color: #f1f5f9;
  border-bottom: 1px solid rgba(71, 85, 105, 0.3);
  font-size: 0.8125rem;
  text-align: center; /* Ortalanmış */
}

.chest-detail-drops tr:last-child td {
  border-bottom: none;
}

.chest-detail-drops tr:hover {
  background: rgba(99, 102, 241, 0.1);
}

/* Responsive */
@media (max-width: 1024px) {
  .chest-modal-body {
    flex-direction: column;
  }
  
  .chest-left-panel {
    width: 100%;
    max-height: 35vh; /* Reduced height */
    border-right: none;
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
  }
  
  .chest-right-panel {
    min-height: 65vh; /* Increased to compensate for smaller left panel */
  }
}

/* Empty state */
.results-placeholder {
  text-align: center;
  padding: 3rem 1rem;
  color: #64748b;
}

.results-placeholder i {
  font-size: 3rem;
  color: #6366f1;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.results-placeholder h4 {
  color: #cbd5e1;
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.results-placeholder p {
  color: #94a3b8;
  font-size: 0.875rem;
  margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .chest-modal {
    max-width: calc(100vw - 1.5rem); /* Reduced padding */
    padding: 0.75rem; /* Reduced padding */
  }
  
  .chest-result-row {
    flex-wrap: wrap;
    gap: 0.375rem; /* Reduced gap */
  }
  
  .chest-result-actions {
    width: 100%;
    flex-direction: column;
  }
  
  .chest-result-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Chest Result Modal - COMPACT MODERN DESIGN */
.chest-result-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem; /* Reduced padding */
}

.chest-result-modal {
  position: relative;
  width: 100%;
  max-width: 24rem; /* Even more compact - 384px */
  max-height: 85vh; /* Slightly reduced height */
  overflow-y: auto;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 0.75rem; /* Smaller radius */
  padding: 1rem; /* Reduced padding */
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(99, 102, 241, 0.1);
  animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modern result header - COMPACT & STICKY */
.chest-result-header {
  text-align: center;
  margin-bottom: 0.75rem; /* Further reduced margin */
  padding: 0.5rem 0 0.5rem 0; /* Further reduced padding */
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-radius: 0.25rem 0.25rem 0 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); /* Subtle shadow for depth */
}

/* Close button - top right */
#chestResultModalClose {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 0.5rem;
  color: #ef4444;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
}

#chestResultModalClose:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  transform: rotate(90deg);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
}

/* Back button - top left */
.chest-back-btn {
  position: absolute;
  top: -0.5rem;
  left: -0.5rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 0.5rem;
  color: #818cf8;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  z-index: 10;
}

.chest-back-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: #6366f1;
  color: #a5b4fc;
  transform: translateX(-2px);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.chest-result-title-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem; /* Further reduced gap */
  margin-bottom: 0.375rem; /* Further reduced margin */
  padding: 0 1.5rem; /* Further reduced padding */
}

.chest-result-chest-img {
  width: 3.5rem; /* Reduced size */
  height: 3.5rem; /* Reduced size */
  border-radius: 0.75rem; /* Smaller radius */
  border: 2px solid #fbbf24; /* Slightly thinner border */
  box-shadow: 
    0 0 25px rgba(251, 191, 36, 0.4), /* Reduced shadow */
    0 0 50px rgba(251, 191, 36, 0.2), /* Reduced shadow */
    inset 0 2px 8px rgba(251, 191, 36, 0.1);
  object-fit: contain;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.8));
  padding: 0.4rem; /* Reduced padding */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chest-result-chest-img:hover {
  transform: scale(1.05);
  box-shadow: 
    0 0 45px rgba(251, 191, 36, 0.6),
    0 0 90px rgba(251, 191, 36, 0.4);
}

.chest-result-title {
  color: #fbbf24;
  font-size: 1.25rem; /* Smaller font */
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.025em;
  text-shadow: 0 2px 8px rgba(251, 191, 36, 0.3); /* Slightly reduced shadow */
}

.chest-result-subtitle {
  color: #cbd5e1;
  font-size: 0.8125rem;
  margin: 0.375rem 0 0 0;
  font-style: italic;
  opacity: 0.9;
}

/* Modern chest detail header */
.chest-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(71, 85, 105, 0.6);
  border-radius: 0.75rem;
  margin-bottom: 1rem;
}

.chest-detail-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chest-detail-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.5rem;
  border: 2px solid #fbbf24;
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
  object-fit: contain;
  flex-shrink: 0;
}

.chest-detail-title-wrap h3 {
  color: #fbbf24;
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
  letter-spacing: -0.025em;
}

.chest-detail-title-wrap p {
  color: #94a3b8;
  font-size: 0.875rem;
  margin: 0;
}

/* Modern back button */
.chest-detail-back-btn,
.btn-outline-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(71, 85, 105, 0.4);
  border: 1px solid rgba(71, 85, 105, 0.6);
  border-radius: 0.5rem;
  color: #cbd5e1;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  white-space: nowrap;
}

.chest-detail-back-btn:hover,
.btn-outline-secondary:hover {
  background: rgba(71, 85, 105, 0.6);
  border-color: #6366f1;
  color: #f1f5f9;
  transform: none;
}

/* Modern table */
.chest-detail-table-wrap {
  margin-bottom: 1.5rem;
  overflow-x: auto;
  border-radius: 0.75rem;
  border: 1px solid rgba(71, 85, 105, 0.6);
}

.chest-detail-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: rgba(30, 41, 59, 0.4);
}

.chest-detail-table th {
  background: rgba(71, 85, 105, 0.4);
  color: #cbd5e1;
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(71, 85, 105, 0.6);
  text-align: left;
}

.chest-detail-table td {
  padding: 0.875rem 1rem;
  color: #f1f5f9;
  border-bottom: 1px solid rgba(71, 85, 105, 0.3);
  font-size: 0.875rem;
}

.chest-detail-table tr:last-child td {
  border-bottom: none;
}

.chest-detail-table tr:hover {
  background: rgba(99, 102, 241, 0.05);
}

.chest-detail-icon-img,
.chest-result-icon-img {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.375rem;
  border: 1px solid rgba(71, 85, 105, 0.6);
  object-fit: contain;
  vertical-align: middle;
}

/* Modern result displays */
.chest-detail-amount,
.chest-result-amount {
  color: #f1f5f9;
  font-weight: 600;
  font-size: 0.9375rem;
}

.chest-detail-yang,
.chest-result-yang {
  color: #fbbf24;
  font-weight: 600;
}

.chest-detail-chance,
.chest-result-chance {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 0.375rem;
  color: #fbbf24;
  font-weight: 600;
  font-size: 0.875rem;
}

.chest-result-won {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 0.375rem;
  color: #22c55e;
  font-weight: 600;
  font-size: 0.875rem;
}

/* Modern table in result modal - COMPACT */
.chest-result-table-wrap {
  margin-bottom: 1rem; /* Reduced margin */
  overflow-x: auto;
  border-radius: 0.5rem; /* Smaller radius */
  border: 1px solid rgba(71, 85, 105, 0.6);
}

.chest-result-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: rgba(30, 41, 59, 0.5);
}

.chest-result-table th {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(71, 85, 105, 0.4));
  color: #e2e8f0;
  font-weight: 700;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.625rem 0.75rem;
  border-bottom: 2px solid rgba(99, 102, 241, 0.3);
  text-align: left;
}

.chest-result-table td {
  padding: 0.625rem 0.75rem;
  color: #f1f5f9;
  border-bottom: 1px solid rgba(71, 85, 105, 0.3);
  font-size: 0.75rem;
}

.chest-result-table tr:last-child td {
  border-bottom: none;
}

.chest-result-table tr:hover {
  background: rgba(99, 102, 241, 0.1);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Result icons - smaller */
.chest-result-icon-img {
  width: 2rem;
  height: 2rem;
  border-radius: 0.375rem;
  border: 1px solid rgba(71, 85, 105, 0.6);
  object-fit: contain;
  vertical-align: middle;
}

/* Modern result displays */
.chest-result-amount {
  color: #f1f5f9;
  font-weight: 600;
  font-size: 0.9375rem;
}

.chest-result-yang {
  color: #fbbf24;
  font-weight: 600;
}

.chest-result-chance {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 0.375rem;
  color: #fbbf24;
  font-weight: 600;
  font-size: 0.875rem;
}

.chest-result-won {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 0.375rem;
  color: #22c55e;
  font-weight: 600;
  font-size: 0.875rem;
}

/* Compact input group with quick multipliers */
.chest-result-input-group {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.875rem 1rem;
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 0.75rem;
  margin-bottom: 1rem;
}

.chest-result-input-group label {
  color: #e2e8f0;
  font-weight: 600;
  font-size: 0.75rem;
  white-space: nowrap;
}

.chest-result-input-group input {
  width: 4rem; /* Wider default width */
  padding: 0.5rem;
  background: rgba(15, 23, 42, 0.8);
  border: 2px solid rgba(99, 102, 241, 0.3);
  border-radius: 0.5rem;
  color: #f1f5f9;
  font-size: 0.875rem;
  font-weight: 700;
  text-align: center;
  transition: all 0.3s ease; /* Smooth transition */
}

.chest-result-input-group input:focus {
  width: 6rem; /* Expand when focused */
  background: rgba(15, 23, 42, 1);
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  outline: none;
}

.chest-result-input-group input:focus {
  outline: none;
  border-color: #6366f1;
  background: rgba(15, 23, 42, 1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Update button - icon only */
.chest-result-input-group .btn-info {
  width: 2rem;
  height: 2rem;
  padding: 0;
  min-width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border: 1px solid rgba(99, 102, 241, 0.5);
  border-radius: 0.375rem;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.875rem;
}

.chest-result-input-group .btn-info:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
  transform: scale(1.05);
}

/* Quick multiplier buttons */
.chest-quick-multipliers {
  display: flex;
  gap: 0.375rem;
  align-items: center;
}

.chest-quick-btn {
  padding: 0.375rem 0.625rem;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 0.375rem;
  color: #fbbf24;
  font-size: 0.6875rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.chest-quick-btn:hover {
  background: rgba(251, 191, 36, 0.2);
  border-color: #fbbf24;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
  transform: translateY(-1px);
}

/* Compact action buttons - ICON ONLY */
.chest-result-actions {
  display: flex;
  gap: 0.625rem;
  justify-content: center;
  align-items: center;
}

/* Icon-only buttons for retry and download */
.chest-result-actions .btn-warning,
.chest-result-actions .btn-success {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  min-width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  font-size: 1rem;
}

.chest-result-actions .btn-warning i,
.chest-result-actions .btn-success i {
  margin: 0 !important;
}

.chest-result-actions .btn-warning {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #0f172a;
  font-weight: 700;
  border-color: rgba(251, 191, 36, 0.6);
  box-shadow: 
    0 4px 15px rgba(251, 191, 36, 0.3),
    0 2px 8px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.chest-result-actions .btn-warning:hover {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 
    0 6px 20px rgba(251, 191, 36, 0.4),
    0 2px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  border-color: #fbbf24;
}

.chest-result-actions .btn-success {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #fff;
  border-color: rgba(34, 197, 94, 0.6);
  box-shadow: 
    0 4px 15px rgba(34, 197, 94, 0.3),
    0 2px 8px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.chest-result-actions .btn-success:hover {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  box-shadow: 
    0 6px 20px rgba(34, 197, 94, 0.4),
    0 2px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
  border-color: #22c55e;
}

.chest-result-actions .btn-info {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #fff;
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 
    0 4px 15px rgba(99, 102, 241, 0.3),
    0 2px 8px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.chest-result-actions .btn-info:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  box-shadow: 
    0 6px 20px rgba(99, 102, 241, 0.4),
    0 2px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
  border-color: #6366f1;
}

.chest-result-actions .btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Update button in input group */
.chest-result-input-group .btn {
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  min-width: 8rem;
}

/* Responsive for result modal - COMPACT */
@media (max-width: 768px) {
  .chest-result-modal {
    max-width: calc(100vw - 1.5rem); /* Reduced padding */
    padding: 1rem; /* Reduced padding */
  }
  
  .chest-result-title-section {
    padding: 0 1.5rem; /* Reduced padding */
  }
  
  .chest-result-actions {
    flex-direction: column;
    gap: 0.5rem; /* Reduced gap */
  }
  
  .chest-result-actions .btn {
    width: 100%;
    padding: 0.5rem 1rem; /* Reduced padding */
  }
  
  .chest-result-input-group {
    gap: 0.25rem; /* Reduced gap */
    padding: 0.5rem; /* Reduced padding */
  }
  
  .chest-result-input-group input {
    width: 2.5rem; /* Smaller width */
    padding: 0.25rem; /* Reduced padding */
    font-size: 0.75rem; /* Smaller font */
  }
  
  .chest-result-input-group input:focus {
    width: 3.5rem; /* Smaller expanded width */
  }
  
  .chest-quick-btn {
    font-size: 0.5625rem; /* Smaller font */
    padding: 0.2rem 0.4rem; /* Reduced padding */
  }
}

@media (max-width: 480px) {
  .chest-result-modal {
    padding: 0.75rem; /* Reduced padding */
  }
  
  .chest-result-chest-img {
    width: 3rem; /* Smaller size */
    height: 3rem; /* Smaller size */
  }
  
  .chest-result-title {
    font-size: 1rem; /* Smaller font */
  }
  
  .chest-result-subtitle {
    font-size: 0.6875rem; /* Smaller font */
  }
  
  .chest-result-input-group input {
    width: 2rem; /* Smaller width */
    font-size: 0.6875rem; /* Smaller font */
  }
  
  .chest-result-input-group input:focus {
    width: 3rem; /* Smaller expanded width */
  }
}
