/* ToPeso.org - Currency Converter Styles
   Converter Widget & Related Components */

/* Converter Container */
.converter-wrapper {
  max-width: 700px;
  margin: 0 auto var(--space-2xl);
  animation: fadeInUp 0.6s ease-out 0.3s backwards;
}

.converter-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
}

.converter-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--gradient-tropical);
}

/* Converter Header */
.converter-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.converter-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.current-rate-display {
  background: var(--primary-pale);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  display: inline-block;
}

.current-rate-display #current-rate {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--primary);
}

.last-update {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-xs);
  display: block;
}

/* Currency Selector */
.currency-selector-wrapper {
  margin-bottom: var(--space-xl);
}

.selector-label {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.currency-selector {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 500;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%230066CC' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-md) center;
  padding-right: var(--space-2xl);
}

.currency-selector:hover {
  border-color: var(--primary-light);
}

.currency-selector:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-pale);
}

/* Amount Input Section */
.amount-input-wrapper {
  margin-bottom: var(--space-xl);
}

.amount-input-container {
  position: relative;
}

.amount-input {
  width: 100%;
  padding: var(--space-lg) var(--space-xl);
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 700;
  border: 3px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--background-alt);
  color: var(--text-primary);
  text-align: center;
  transition: all var(--transition-fast);
}

.amount-input:hover {
  border-color: var(--primary-light);
  background: var(--surface);
}

.amount-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--primary-pale);
}

.amount-input::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}

/* Quick Amount Buttons */
.quick-amounts {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  flex-wrap: wrap;
  justify-content: center;
}

.quick-amount-btn {
  padding: var(--space-sm) var(--space-lg);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.quick-amount-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.quick-amount-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--text-inverse);
  transform: scale(0.95);
}

/* Conversion Arrow */
.conversion-arrow {
  text-align: center;
  margin: var(--space-lg) 0;
  position: relative;
}

.conversion-arrow::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background: var(--gradient-sunset);
  border-radius: 50%;
  opacity: 0.1;
  animation: pulse 2s infinite;
}

.arrow-icon {
  font-size: var(--text-3xl);
  color: var(--accent);
  display: inline-block;
  position: relative;
  z-index: 1;
  animation: bounce 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.1;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0.2;
  }
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

/* Result Display */
.result-display {
  background: var(--gradient-primary);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.result-display::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

.result-label-container {
  margin-bottom: var(--space-sm);
}

.result-label {
  font-size: var(--text-base);
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

.result-currency {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: var(--space-xs);
  display: block;
}

.result-value {
  font-family: var(--font-display);
  font-size: var(--text-6xl);
  font-weight: 800;
  color: var(--text-inverse);
  letter-spacing: -0.02em;
  display: block;
  position: relative;
  z-index: 1;
  transition: all var(--transition-base);
}

.result-value.updated {
  animation: numberUpdate 0.4s ease-out;
}

@keyframes numberUpdate {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
    color: var(--accent-light);
  }
  100% {
    transform: scale(1);
  }
}

/* Quick Conversion Table */
.quick-conversion-section {
  margin-top: var(--space-2xl);
}

.quick-conversion-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.quick-conversion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
}

.conversion-item {
  background: var(--surface);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  text-align: center;
  transition: all var(--transition-fast);
}

.conversion-item:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.conversion-from {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.conversion-equals {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin: var(--space-xs) 0;
}

.conversion-to {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--primary);
}

/* Swap Button */
.swap-currency-btn {
  background: var(--surface);
  border: 2px solid var(--border);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: var(--space-md) auto;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: var(--text-xl);
  color: var(--primary);
}

.swap-currency-btn:hover {
  background: var(--primary);
  color: var(--text-inverse);
  transform: rotate(180deg);
  border-color: var(--primary);
}

/* Currency Pair Page - Fixed Converter */
.fixed-converter .currency-selector {
  pointer-events: none;
  opacity: 0.7;
  background: var(--background-alt);
}

/* Conversion History Table (for currency pair pages) */
.conversion-history {
  margin-top: var(--space-2xl);
}

.history-table {
  width: 100%;
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.history-table thead {
  background: var(--primary);
  color: var(--text-inverse);
}

.history-table th {
  padding: var(--space-md) var(--space-lg);
  text-align: left;
  font-weight: 600;
  text-transform: uppercase;
  font-size: var(--text-sm);
  letter-spacing: 0.05em;
}

.history-table td {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-light);
}

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

.history-table tbody tr:hover {
  background: var(--primary-pale);
}

.amount-col {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-lg);
}

.peso-col {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xl);
  color: var(--primary);
}

/* Exchange Rate Chart Placeholder */
.rate-chart-container {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin: var(--space-2xl) 0;
  border: 1px solid var(--border-light);
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-placeholder {
  text-align: center;
  color: var(--text-muted);
}

.chart-placeholder-icon {
  font-size: var(--text-6xl);
  margin-bottom: var(--space-md);
  opacity: 0.3;
}

/* Related Currencies */
.related-currencies {
  margin-top: var(--space-3xl);
}

.related-currencies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-lg);
}

.related-currency-link {
  display: block;
  background: var(--surface);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.related-currency-link:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.related-currency-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.related-currency-flag {
  font-size: var(--text-3xl);
}

.related-currency-name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text-primary);
}

.related-currency-rate {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.related-currency-cta {
  margin-top: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--primary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

/* Loading State for Converter */
.converter-loading {
  text-align: center;
  padding: var(--space-xl);
  color: var(--text-muted);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto var(--space-md);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
