/* ==========================================================================
   GIFTCODE MANAGEMENT - NROZ BETA (MATCHING 4 REFERENCE SCREENSHOTS)
   ========================================================================== */

/* Top Navigation Bar */
.gift-nav-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.gift-tab-btn {
  padding: 10px 24px;
  font-size: 14.5px;
  font-weight: 700;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.gift-tab-btn:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.gift-tab-btn.active {
  background: #3b49df;
  border-color: #3b49df;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(59, 73, 223, 0.28);
}

.gift-btn-reload {
  position: relative;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 8px;
  border: 1px solid #0284c7;
  background: #0ea5e9;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gift-btn-reload:hover {
  background: #0284c7;
}

.gift-btn-reload .dot-badge {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #facc15;
  border-radius: 50%;
  margin-left: 2px;
}

.gift-btn-create-new {
  margin-left: auto;
  padding: 10px 22px;
  font-size: 14.5px;
  font-weight: 700;
  border-radius: 8px;
  border: 1px solid #059669;
  background: #10b981;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gift-btn-create-new:hover {
  background: #059669;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

/* Giftcode Table (Image 1 & Image 2) */
.gift-table-container {
  background: #ffffff;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.gift-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.gift-table thead th {
  background: #e8ecfb;
  color: #1e3a8a;
  font-size: 14px;
  font-weight: 800;
  padding: 16px 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #bfdbfe;
}

.gift-table tbody td {
  padding: 18px 14px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

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

/* Badges */
.badge-gift-id {
  display: inline-block;
  padding: 6px 14px;
  background: #ede9fe;
  color: #6d28d9;
  font-weight: 800;
  font-size: 13.5px;
  border-radius: 6px;
  border: 1px solid #ddd6fe;
}

.badge-gift-code {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #e0e7ff;
  color: #1d4ed8;
  font-weight: 700;
  font-size: 14px;
  border-radius: 8px;
  border: 1px solid #c7d2fe;
}

.badge-gift-count {
  display: inline-block;
  padding: 5px 14px;
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 700;
  font-size: 13.5px;
  border-radius: 20px;
  border: 1px solid #bae6fd;
}

/* Type Badges */
.badge-gift-type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
}

.badge-gift-type.type-player {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.badge-gift-type.type-vip {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-gift-type.type-share {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* Item Cards Grid */
.gift-items-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 1400px) {
  .gift-items-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.gift-item-card {
  background: #ffffff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
}

.gift-item-card-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}

.gift-item-card-art {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.gift-item-card-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
}

.gift-item-card-qty {
  display: inline-block;
  padding: 1px 6px;
  background: #e0f2fe;
  color: #0284c7;
  font-size: 11.5px;
  font-weight: 800;
  border-radius: 4px;
}

.gift-item-card-divider {
  border-top: 1px dashed #cbd5e1;
  margin: 8px 0;
}

.gift-item-card-opts {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11.5px;
  line-height: 1.35;
}

.gift-opt-line {
  color: #334155;
  font-weight: 600;
}

.gift-opt-line.negative {
  color: #dc2626;
}

.gift-opt-line.positive {
  color: #2563eb;
}

/* Sub-codes container (Image 2) */
.gift-subcodes-wrap {
  margin-top: 14px;
  background: #f8faff;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  padding: 14px;
}

.gift-subcodes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #1e40af;
}

.gift-subcodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.gift-subcode-pill {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.gift-subcode-pill.active {
  background: #ffffff;
  border: 1px solid #93c5fd;
  color: #1d4ed8;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.06);
}

.gift-subcode-pill.active:hover {
  background: #eff6ff;
  border-color: #3b82f6;
  transform: translateY(-1px);
}

.gift-subcode-pill.used {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #94a3b8;
  opacity: 0.75;
}

.gift-subcode-pill.used:hover {
  background: #f1f5f9;
}

.gift-subcode-pill .btn-copy-mini {
  background: none;
  border: none;
  padding: 2px 4px;
  cursor: pointer;
  color: inherit;
  font-size: 13px;
  opacity: 0.8;
  transition: opacity 0.15s ease;
}

.gift-subcode-pill .btn-copy-mini:hover {
  opacity: 1;
}

/* Action Buttons */
.gift-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.btn-gift-act {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.btn-gift-act.edit {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #2563eb;
}

.btn-gift-act.edit:hover {
  background: #dbeafe;
}

.btn-gift-act.delete {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

.btn-gift-act.delete:hover {
  background: #fee2e2;
}

.btn-gift-act.toggle-subs {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

/* Creation Form Screen (Image 3) */
.gift-create-screen {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
}

.gift-create-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 16px;
}

.gift-create-top-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-gift-back {
  padding: 8px 18px;
  background: #334155;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-gift-back:hover {
  background: #1e293b;
}

.btn-gift-f5 {
  padding: 8px 16px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-gift-f5:hover {
  background: #1d4ed8;
}

.gift-create-title {
  font-size: 22px;
  font-weight: 800;
  color: #1e3a8a;
  text-align: center;
  letter-spacing: 0.5px;
  margin: 0;
}

/* Builder Rows */
.gift-builder-rows {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.gift-builder-row {
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 16px;
  background: #f8fafc;
  display: grid;
  grid-template-columns: 280px 1fr 60px;
  gap: 16px;
  align-items: start;
}

@media (max-width: 900px) {
  .gift-builder-row {
    grid-template-columns: 1fr;
  }
}

.gift-builder-col label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.gift-item-picker-btn {
  width: 100%;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid #94a3b8;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
}

.gift-item-picker-btn:hover {
  border-color: #2563eb;
  background: #eff6ff;
}

.gift-qty-input {
  width: 100%;
  padding: 9px 12px;
  background: #ffffff;
  border: 1px solid #94a3b8;
  border-radius: 8px;
  font-size: 14px;
  color: #1e293b;
  box-sizing: border-box;
}

/* Option builder */
.gift-opts-builder-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.gift-opt-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12.5px;
}

.gift-opt-tag input {
  width: 65px;
  padding: 3px 6px;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  font-size: 12px;
  text-align: center;
}

.gift-opt-tag button {
  background: none;
  border: none;
  color: #dc2626;
  font-weight: 700;
  cursor: pointer;
}

.btn-add-opt {
  padding: 6px 14px;
  background: #3b82f6;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-add-opt:hover {
  background: #2563eb;
}

.btn-del-row {
  background: none;
  border: none;
  color: #dc2626;
  font-weight: 800;
  font-size: 13.5px;
  cursor: pointer;
  padding: 4px;
  text-align: right;
}

.btn-del-row:hover {
  text-decoration: underline;
}

/* Preview Box */
.gift-preview-container {
  border: 2px dashed #93c5fd;
  border-radius: 12px;
  padding: 16px;
  background: #f0f7ff;
  margin-bottom: 24px;
}

.gift-preview-heading {
  font-size: 13.5px;
  font-weight: 800;
  color: #1e3a8a;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.gift-preview-empty {
  font-size: 14px;
  color: #64748b;
  font-style: italic;
  padding: 10px 0;
}

/* Action Footer Buttons */
.gift-create-footer-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-create-act {
  flex: 1;
  min-width: 170px;
  padding: 13px 18px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  text-align: center;
}

.btn-create-act.add-row {
  background: #059669;
  color: #ffffff;
}

.btn-create-act.add-row:hover {
  background: #047857;
}

.btn-create-act.export-player {
  background: #2563eb;
  color: #ffffff;
}

.btn-create-act.export-player:hover {
  background: #1d4ed8;
}

.btn-create-act.export-vip {
  background: #d97706;
  color: #ffffff;
}

.btn-create-act.export-vip:hover {
  background: #b45309;
}

.btn-create-act.export-share {
  background: #7c3aed;
  color: #ffffff;
}

.btn-create-act.export-share:hover {
  background: #6d28d9;
}

/* Success Modal (Image 4) */
.gift-success-modal {
  position: relative;
  background: #eef2f6;
  border-radius: 20px;
  padding: 32px 28px 24px;
  text-align: center;
  font-family: inherit;
  color: #1e293b;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  max-width: 480px;
  width: 95%;
  margin: auto;
}

.gift-success-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ef4444;
  color: #ffffff;
  border: none;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease;
}

.gift-success-close-btn:hover {
  background: #dc2626;
  transform: scale(1.08);
}

.gift-success-badge-icon {
  width: 72px;
  height: 72px;
  background: #16a34a;
  border: 4px solid #052e16;
  border-radius: 4px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 38px;
  font-weight: 900;
}

.gift-success-title {
  font-family: Georgia, serif;
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 1px;
  margin: 0 0 8px;
}

.gift-success-subtitle {
  font-size: 16px;
  color: #334155;
  margin: 0 0 16px;
}

.gift-success-textarea {
  width: 100%;
  height: 180px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 12px;
  font-family: Consolas, monospace;
  font-size: 14px;
  line-height: 1.5;
  color: #1e293b;
  resize: none;
  box-sizing: border-box;
  margin-bottom: 12px;
}

.gift-success-info {
  font-size: 14px;
  color: #475569;
  margin-bottom: 20px;
}

.gift-success-btn-back {
  width: 100%;
  padding: 14px 20px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 15.5px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease;
  letter-spacing: 0.5px;
}

.gift-success-btn-back:hover {
  background: #1d4ed8;
}
