/* Currency History Page Styles - Matching Existing Design */

/* 1) Main container */
.currency-history-container {
  max-width: 1230px;
  padding: 10px 0;
  margin: 0 auto;
}

@media (max-width: 767px) {
  .currency-history-container {
    padding: 10px 10px;
  }
}

/* 2) Breadcrumb wrapper - matching existing */
.currency-history-breadcrumb {
  background: #f5f5f5;
  padding: 5px 15px;
  margin-bottom: 5px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.currency-history-breadcrumb nav {
  display: flex;
  align-items: center;
  gap: 5px;
}

.currency-history-breadcrumb a {
  color: #0073aa;
  text-decoration: none;
}

.currency-history-breadcrumb a:hover {
  text-decoration: underline;
}

/* 3) Currency header section */
.currency-history-header {
  background: #fff;
  border: 1px solid #e1e1e1;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.currency-header-content {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.currency-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.currency-title h1 {
  font-size: 2.5rem;
  font-weight: 600;
  color: #333;
  margin: 0;
  line-height: 1.3;
}

.currency-title .symbol {
  color: #666;
  font-size: 1.25rem;
  margin-left: 10px;
}

/* 4) Current price section - matching price summary style */
.current-price-section {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin: 20px 0;
}

.price-info-card {
  flex: 1 1 calc(25% - 12px);
  background: #fff;
  border: 1px solid #e1e1e1;
  border-radius: 8px;
  padding: 20px 15px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.price-info-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.price-info-card h3 {
  font-size: 1.5rem;
  font-weight: 600;
  text-transform: uppercase;
  margin: 0 0 10px 0;
  letter-spacing: 0.5px;
  color: #333;
}

.price-info-card .value {
  font-size: 1.5rem;
  font-weight: bold;
  margin: 0;
  line-height: 1.2;
}

.price-info-card .value.green {
  color: #0da059;
}

.price-info-card .value.red {
  color: #ea3323;
}

/* 5) Interval selector - matching secondary menu style */
.interval-selector {
  background: #f5f5f5;
  border-top: 1px solid #e1e1e1;
  border-bottom: 1px solid #e1e1e1;
  border-radius: 4px;
  margin: 20px 0;
  padding: 10px 0;
}

.interval-buttons {
  list-style: none;
  margin: 0;
  padding: 0 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.interval-buttons li {
  margin: 0;
}

.interval-buttons a {
  display: block;
  padding: 8px 12px;
  text-decoration: none;
  color: inherit;
  border-radius: 4px;
  transition: background 0.2s, border-bottom 0.2s;
}

.interval-buttons a:hover {
  background: rgba(0,115,170,0.05);
  border-bottom: 2px solid #0073aa;
  padding-bottom: 6px;
}

.interval-buttons a.active {
  border-bottom: 2px solid #0073aa;
  font-weight: bold;
  padding-bottom: 6px;
}

/* 6) Currency converter section */
.currency-converter-section {
  background: #fff;
  border: 1px solid #e1e1e1;
  border-radius: 8px;
  padding: 15px;
  margin: 20px 0;
  text-align: center;
}

.currency-converter-section h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: #333;
}

.currency-selector {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
}

/* 7) Charts container */
.charts-container {
  margin: 20px 0;
}

.chart-wrapper {
  background: #fff;
  border: 1px solid #e1e1e1;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.chart-title {
  font-size: 1.25rem;
  font-weight: 600;
  text-align: center;
  color: #333;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #0073aa;
}

/* 8) Historical data table - matching grid-view style */
.historical-data-section {
  margin: 20px 0;
}

.historical-data-wrapper {
  padding: 15px;
  background: #fff;
  border: 1px solid #e1e1e1;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  overflow-x: auto;
}

.historical-data-wrapper h2 {
  font-size: 20px;
  font-weight: 600;
  color: #333;
  padding-top: 15px;
  margin-bottom: 15px;
}

.historical-data-wrapper table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
}

.historical-data-wrapper thead th {
  background: #0073aa;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 12px;
  border: none;
  text-align: left;
}

.historical-data-wrapper tbody tr:nth-child(odd) {
  background: #f9f9f9;
}

.historical-data-wrapper tbody tr:nth-child(even) {
  background: #fff;
}

.historical-data-wrapper tbody td {
  padding: 12px 10px;
  border-bottom: 1px solid #e1e1e1;
  font-size: 14px;
  white-space: nowrap;
}

.historical-data-wrapper tbody tr:hover {
  background: rgba(0,115,170,0.1);
}

/* 9) Navigation links section */
.navigation-section {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin: 20px 0;
  justify-content: center;
}

.nav-card {
  background: #fff;
  border: 1px solid #e1e1e1;
  border-radius: 8px;
  padding: 15px 20px;
  text-align: center;
  transition: all 0.2s ease;
  text-decoration: none;
  color: #333;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.nav-card:hover {
  background: #f5f5f5;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  text-decoration: none;
  color: #0073aa;
}

.nav-card i {
  font-size: 1.5rem;
  margin-bottom: 8px;
  display: block;
  color: #0073aa;
}

/* 10) Loading states */
.loading-message {
  text-align: center;
  padding: 40px;
  color: #666;
  font-size: 1.125rem;
}

.error-message {
  background: #fee;
  border: 1px solid #fcc;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  color: #c00;
  text-align: center;
}

/* 11) Responsive adjustments */
@media (max-width: 991px) {
  .price-info-card {
    flex: 1 1 calc(50% - 8px);
  }
}

@media (max-width: 767px) {
  .current-price-section {
    gap: 10px;
    padding: 0 10px;
  }
  
  .price-info-card {
    flex: 1 1 calc(50% - 5px);
    padding: 15px 10px;
  }
  
  .price-info-card h3 {
    font-size: 1.2rem;
  }
  
  .price-info-card .value {
    font-size: 1.2rem;
  }
  
  .currency-header-content {
    flex-direction: column;
    text-align: center;
  }
  
  .currency-title h1 {
    font-size: 1.5rem;
  }
  
  .interval-buttons {
    justify-content: center;
  }
  
  .historical-data-wrapper {
    padding: 10px;
  }
  
  .navigation-section {
    padding: 0 10px;
  }
}

/* 12) Additional utility classes */
.text-center {
  text-align: center;
}

.mt-20 {
  margin-top: 20px;
}

.mb-20 {
  margin-bottom: 20px;
}

/* 13) Price formatting with subscript */
.price-info-card .value sub {
  font-size: 0.7em;
  vertical-align: baseline;
  position: relative;
  top: 0.3em;
}

/* 14) Chart responsiveness */
#candlestickChart,
#volumeChart {
  width: 100%;
  height: 400px;
}

@media (max-width: 767px) {
  #candlestickChart,
  #volumeChart {
    height: 300px;
  }
  
  /* Make h1 bigger on mobile - consistent with converter */
  .currency-title h1 {
    font-size: 2rem !important;
    line-height: 1.4 !important;
  }
  
  /* Adjust symbol size accordingly */
  .currency-title .symbol {
    font-size: 1.125rem;
  }
}

/* 15) Footer disclaimer */
.currency-disclaimer {
  margin: 40px 0 20px;
}

.currency-disclaimer-box {
  position: relative;
  background: #fff;
  border: 1px solid #e1e1e1;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  line-height: 1.6;
  color: #333;
  text-align: center;
}

.currency-disclaimer-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #0073aa, #00aaff);
  border-radius: 8px 8px 0 0;
}

/* 16) Price Summary Section - matching single-template.css */
.price-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin: 20px 0;
}

.price-summary-item {
  flex: 1 1 calc(20% - 12px);
  background: #fff;
  border: 1px solid #e1e1e1;
  border-radius: 8px;
  padding: 20px 15px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.price-summary-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Price Summary Headers */
.price-summary-item h3 {
  font-size: 1.5rem;
  font-weight: 600;
  text-transform: uppercase;
  margin: 0 0 10px 0;
  letter-spacing: 0.5px;
}

/* Price Summary Values */
.price-summary-item p {
  font-size: 1.5rem;
  font-weight: bold;
  margin: 0;
  line-height: 1.2;
}

/* Highlight specific item (optional) */
.price-summary-item:first-child {
  border: 2px solid #0073aa;
  position: relative;
}

.price-summary-item:first-child::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #0073aa, #00aaff);
  border-radius: 8px 8px 0 0;
}

/* Responsive for tablets */
@media (max-width: 991px) {
  .price-summary-item {
    flex: 1 1 calc(33.333% - 10px);
  }
}

/* Responsive for mobile */
@media (max-width: 767px) {
  .price-summary {
    gap: 10px;
    margin: 15px 0;
    padding: 0 10px;
  }
  
  .price-summary-item {
    flex: 1 1 calc(50% - 5px);
    padding: 15px 10px;
  }
  
  .price-summary-item h3 {
    font-size: 1.2rem;
  }
  
  .price-summary-item p {
    font-size: 1.2rem;
  }
}

/* For very large screens, keep items reasonable size */
@media (min-width: 1400px) {
  .price-summary-item {
    max-width: 250px;
  }
}

/* Handle subscript formatting in price summary */
.price-summary-item p sub {
  font-size: 0.7em;
  vertical-align: baseline;
  position: relative;
  top: 0.3em;
}

/* 17) Color utilities for price changes */
.green {
  color: #0da059;
}

.red {
  color: #ea3323;
}