/* Harga Emas Indonesia - Frontend Styles */

/* Container Styles */
.hei-price-container {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border: 2px solid #ffd700;
  border-radius: 15px;
  padding: 25px;
  margin: 25px 0;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  position: relative;
  overflow: hidden;
}

.hei-price-container::before {
  content: "🏆";
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  opacity: 0.7;
}

.hei-table-container {
  background: #ffffff;
  border: 2px solid #ffd700;
  border-radius: 15px;
  padding: 25px;
  margin: 25px 0;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  overflow-x: auto;
  position: relative;
}

.hei-table-container::before {
  content: "📊";
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  opacity: 0.7;
}

/* Header Section */
.hei-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid #ffd700;
}

.hei-gold-type {
  display: flex;
  align-items: center;
}

.hei-type-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  background: linear-gradient(135deg, #ffd700 0%, #ffb347 100%);
  color: #333;
  font-weight: bold;
  font-size: 12px;
  margin-right: 15px;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.hei-type-name {
  font-size: 18px;
  font-weight: 700;
  color: #2c3e50;
  margin: 0;
}

/* Price Display */
.hei-prices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
  margin-bottom: 20px;
}

.hei-price-item {
  display: flex;
  align-items: center;
  padding: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 15px;
  border: 2px solid #e9ecef;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.hei-price-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  border-color: #ffd700;
}

.hei-price-icon {
  font-size: 24px;
  margin-right: 15px;
  flex-shrink: 0;
}

.hei-price-content {
  flex: 1;
}

.hei-price-label {
  display: block;
  font-size: 12px;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  font-weight: 600;
}

.hei-price-value {
  display: block;
  font-size: 24px;
  font-weight: 800;
  color: #2c3e50;
  line-height: 1.2;
}

.hei-buy-price .hei-price-value {
  color: #e74c3c;
}

.hei-sell-price .hei-price-value {
  color: #27ae60;
}

.hei-buy-price .hei-price-icon {
  color: #e74c3c;
}

.hei-sell-price .hei-price-icon {
  color: #27ae60;
}

/* Source and Timestamp */
.hei-source,
.hei-timestamp {
  font-size: 11px;
  color: #6c757d;
  text-align: right;
}

.hei-source {
  margin-bottom: 5px;
}

/* Table Styles */
.hei-gold-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.hei-gold-table th,
.hei-gold-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
}

.hei-gold-table th {
  background: #f8f9fa;
  font-weight: 600;
  color: #495057;
  font-size: 14px;
}

.hei-gold-table td {
  font-size: 14px;
}

.hei-gold-table tr:hover {
  background: #f8f9fa;
}

.hei-price-buy {
  color: #e74c3c;
  font-weight: 600;
}

.hei-price-sell {
  color: #27ae60;
  font-weight: 600;
}

/* Template Variations */
.template-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
}

.template-card .hei-type-name {
  color: white;
}

.template-card .hei-price-item {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.template-card .hei-price-label {
  color: rgba(255, 255, 255, 0.8);
}

.template-card .hei-price-value {
  color: white;
}

.template-minimal {
  background: none;
  border: none;
  box-shadow: none;
  padding: 10px 0;
}

.template-minimal .hei-prices {
  grid-template-columns: 1fr;
  gap: 10px;
}

.template-minimal .hei-price-item {
  background: none;
  border: none;
  padding: 5px 0;
  text-align: left;
  display: flex;
  justify-content: space-between;
}

.template-minimal .hei-price-label {
  margin-bottom: 0;
  margin-right: 10px;
}

/* Loading State */
.hei-loading {
  position: relative;
  opacity: 0.7;
}

.hei-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #3498db;
  border-radius: 50%;
  animation: hei-spin 1s linear infinite;
}

@keyframes hei-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Error State */
.hei-error {
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  color: #721c24;
  border: 2px solid #dc3545;
  border-radius: 10px;
  padding: 15px;
  margin: 15px 0;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(220, 53, 69, 0.2);
  position: relative;
}

.hei-error::before {
  content: "⚠️";
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 18px;
}

/* Status Messages */
.hei-status-message {
  padding: 10px 15px;
  border-radius: 8px;
  margin: 10px 0;
  font-weight: 600;
  text-align: center;
  transition: all 0.3s ease;
}

.hei-status-message.success {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  color: #155724;
  border: 1px solid #c3e6cb;
}

.hei-status-message.error {
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Update Button */
.hei-update-button {
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.hei-update-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
  background: linear-gradient(135deg, #2980b9 0%, #1f4e79 100%);
}

.hei-update-button:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.hei-button-icon {
  margin-right: 8px;
  font-size: 16px;
}

.hei-button-text {
  font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
  .hei-price-container,
  .hei-table-container {
    padding: 15px;
    margin: 15px 0;
  }

  .hei-prices {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .hei-price-value {
    font-size: 18px;
  }

  .hei-gold-table {
    font-size: 12px;
  }

  .hei-gold-table th,
  .hei-gold-table td {
    padding: 8px;
  }

  .hei-type-name {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .hei-price-container,
  .hei-table-container {
    padding: 10px;
    margin: 10px 0;
  }

  .hei-price-item {
    padding: 10px;
  }

  .hei-price-value {
    font-size: 16px;
  }

  .template-minimal .hei-price-item {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .hei-price-container,
  .hei-table-container {
    background: #2c3e50;
    border-color: #34495e;
    color: #ecf0f1;
  }

  .hei-price-item {
    background: #34495e;
    border-color: #2c3e50;
  }

  .hei-price-label {
    color: #bdc3c7;
  }

  .hei-price-value {
    color: #ecf0f1;
  }

  .hei-gold-table th {
    background: #34495e;
    color: #ecf0f1;
  }

  .hei-gold-table td {
    border-color: #34495e;
  }

  .hei-gold-table tr:hover {
    background: #34495e;
  }

  .hei-source,
  .hei-timestamp {
    color: #bdc3c7;
  }
}

/* Animation for Price Changes */
.hei-price-up {
  animation: hei-price-up 0.5s ease-in-out;
}

.hei-price-down {
  animation: hei-price-down 0.5s ease-in-out;
}

@keyframes hei-price-up {
  0% {
    background: transparent;
  }
  50% {
    background: rgba(39, 174, 96, 0.2);
  }
  100% {
    background: transparent;
  }
}

@keyframes hei-price-down {
  0% {
    background: transparent;
  }
  50% {
    background: rgba(231, 76, 60, 0.2);
  }
  100% {
    background: transparent;
  }
}

/* Source Badge */
.hei-source-badge {
  display: inline-block;
  background: #3498db;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 500;
  margin-left: 5px;
}

/* Comparison Table */
.hei-comparison-table {
  margin-top: 20px;
}

.hei-comparison-table .hei-source-header {
  background: #3498db;
  color: white;
  font-weight: 600;
}

.hei-comparison-table td.hei-price-cell {
  text-align: center;
  font-weight: 600;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .hei-price-container,
  .hei-table-container,
  .hei-price-item {
    animation: none;
    transition: none;
  }

  .hei-loading::after {
    animation: none;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .hei-price-container,
  .hei-table-container {
    border-width: 2px;
  }

  .hei-type-badge {
    border: 2px solid currentColor;
  }
}

/* Print Styles */
@media print {
  .hei-update-button {
    display: none;
  }

  .hei-price-container,
  .hei-table-container {
    box-shadow: none;
    border: 1px solid #000;
  }
}

/* Antam Table Specific Styles */
.antam-table.hei-table-container {
  border: 1px solid #dcdcdc;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  padding: 15px;
}

.antam-table .hei-gold-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0;
}

.antam-table .hei-gold-table th,
.antam-table .hei-gold-table td {
  padding: 10px 12px;
  text-align: center; /* Center align text for all cells */
  border: 1px solid #e9e9e9; /* Add borders to all cells */
}

.antam-table .hei-gold-table th {
  background-color: #f5f5f5;
  font-weight: 700;
  color: #333;
  font-size: 13px;
  text-transform: uppercase;
}

.antam-table .hei-gold-table td {
  font-size: 14px;
  color: #555;
}

.antam-table .hei-gold-table tr:nth-child(even) {
  background-color: #f9f9f9; /* Zebra striping for rows */
}

.antam-table .hei-gold-table tr:hover {
  background-color: #f0f0f0;
}

.antam-table .hei-price-buy,
.antam-table .hei-price-sell {
  font-weight: 600;
}

/* Ensure price colors are consistent */
.antam-table .hei-price-buy {
  color: #e74c3c; /* Red for buy price */
}

.antam-table .hei-price-sell {
  color: #27ae60; /* Green for sell price */
}
