/* Animated Currency Cards */
@property --rotate {
  syntax: "<angle>";
  initial-value: 132deg;
  inherits: false;
}

:root {
  --card-height: 280px;
  --card-width: auto;
  --primary-dark: #1B1464;  /* Dark blue from logo */
  --accent: #786D3C;  /* Gold accent from logo */
  --card-glow-1: #786D3C;
  --card-glow-2: #1B1464;
  --card-glow-3: #2e1b7a;
}

.currency-data-section {
  padding: 5rem 0;
  margin: 3rem 0;
  background-color: #ffffff;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border-top: 1px solid rgba(120, 109, 60, 0.2);
  border-bottom: 1px solid rgba(120, 109, 60, 0.2);
}

.currency-data-section .section-header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 0 1.5rem;
}

.currency-data-section .section-header h2 {
  color: var(--primary-dark);
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  position: relative;
  display: inline-block;
}

.currency-data-section .update-time {
  color: #666;
  font-size: 0.9rem;
  display: block;
  margin-top: 1rem;
}

.currency-cards-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  padding: 2rem 1.5rem 4rem;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.currency-card {
  background: #ffffff;
  width: 100%;
  height: var(--card-height);
  padding: 6px;
  position: relative;
  border-radius: 12px;
  justify-content: center;
  align-items: center;
  text-align: center;
  display: flex;
  flex-direction: column;
  color: var(--primary-dark);
  font-family: 'Comfortaa', sans-serif;
  box-shadow: 0 10px 25px rgba(27, 20, 100, 0.2), 0 5px 15px rgba(120, 109, 60, 0.3);
  transform: translateY(-8px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}

.currency-card:hover {
  box-shadow: 0 15px 30px rgba(27, 20, 100, 0.3), 0 10px 20px rgba(120, 109, 60, 0.4);
  transform: translateY(-12px);
}

.currency-card::before, 
.currency-card::after {
  content: "";
  position: absolute;
  left: -2px;
  right: -2px;
  top: -2px;
  bottom: -2px;
  border-radius: 12px;
  background: linear-gradient(
    var(--rotate), 
    var(--card-glow-1) 0%, 
    var(--card-glow-2) 43%,
    var(--card-glow-3) 100%
  );
  z-index: -1;
  animation: spin 2.5s linear infinite;
  opacity: 1;
}

.currency-card::after {
  position: absolute;
  border-radius: 12px;
  z-index: -1;
  filter: blur(15px);
}

@keyframes spin {
  0% {
    --rotate: 0deg;
  }
  100% {
    --rotate: 360deg;
  }
}

.currency-content {
  z-index: 1;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  height: 100%;
  background-color: #ffffff;
  border-radius: 10px;
  justify-content: flex-start;
  position: relative;
}

.currency-header {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 0.8rem;
}

.currency-flag {
  width: auto;
  height: 22px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
  object-fit: cover;
}

.currency-code {
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--primary-dark);
}

.currency-rate {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  margin-bottom: 1.5rem;
}

.currency-rate-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
  gap: 0.3rem;
}

.rate-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-dark);
  white-space: nowrap;
}

.currency-arrow {
  color: var(--accent);
  font-size: 1rem;
  white-space: nowrap;
}

.target-code {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

.target-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  word-break: break-word;
  max-width: 100%;
  overflow-wrap: break-word;
}

.currency-more-btn {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  background-color: var(--primary-dark);
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(27, 20, 100, 0.25);
  position: absolute;
  bottom: 1.8rem;
  right: 1.8rem;
}

.currency-more-btn:hover {
  background-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(27, 20, 100, 0.35);
}

.currency-updated {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  margin-bottom: 1rem;
}

.update-label {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 0.3rem;
}

.update-time {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary-dark);
}

/* Responsive breakpoints */
@media (min-width: 1400px) {
  .currency-cards-container {
    grid-template-columns: repeat(4, 1fr);
    gap: 2.5rem;
    max-width: 1400px;
  }
  
  :root {
    --card-height: 300px;
  }
  
  .currency-content {
    padding: 2rem;
  }
  
  .rate-value {
    font-size: 1.2rem;
  }
  
  .target-value {
    font-size: 1.1rem;
  }
}

@media (max-width: 1200px) {
  .currency-cards-container {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
  }
  
  :root {
    --card-height: 260px;
  }
}

@media (max-width: 992px) {
  .currency-cards-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  
  :root {
    --card-height: 240px;
  }
  
  .currency-content {
    padding: 1.5rem;
  }
  
  .currency-header {
    margin-bottom: 1.2rem;
  }
  
  .currency-rate {
    margin-bottom: 1.2rem;
  }
}

@media (max-width: 768px) {
  .currency-data-section {
    padding: 3rem 0;
  }
  
  .currency-data-section .section-header h2 {
    font-size: 2rem;
  }
  
  .currency-cards-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1rem 1rem 3rem;
  }
  
  :root {
    --card-height: 220px;
  }
  
  .currency-code {
    font-size: 1.2rem;
  }
  
  .rate-value {
    font-size: 1.2rem;
  }
  
  .target-value {
    font-size: 1.2rem;
  }
  
  .currency-arrow {
    font-size: 1.1rem;
  }
  
  .target-code {
    font-size: 0.9rem;
  }
  
  .currency-content {
    padding: 1.2rem;
  }
  
  .currency-header {
    margin-bottom: 1rem;
  }
  
  .currency-rate {
    margin-bottom: 1rem;
  }
  
  .update-time {
    font-size: 0.9rem;
  }
  
  .currency-more-btn {
    padding: 0.5rem 1.2rem;
    font-size: 0.85rem;
    bottom: 1.2rem;
    right: 1.2rem;
  }
}

@media (max-width: 576px) {
  .currency-data-section {
    padding: 2rem 0;
  }
  
  .currency-data-section .section-header h2 {
    font-size: 1.8rem;
  }
  
  .currency-cards-container {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem 1rem 2rem;
    max-width: 400px;
    margin: 0 auto;
  }
  
  :root {
    --card-height: 200px;
  }
  
  .currency-code {
    font-size: 1rem;
  }
  
  .rate-value {
    font-size: 1rem;
  }
  
  .target-value {
    font-size: 1rem;
  }
  
  .currency-arrow {
    font-size: 0.9rem;
  }
  
  .target-code {
    font-size: 0.8rem;
  }
  
  .currency-content {
    padding: 0.8rem;
  }
  
  .currency-header {
    margin-bottom: 0.6rem;
  }
  
  .currency-rate {
    margin-bottom: 0.6rem;
  }
  
  .update-time {
    font-size: 0.75rem;
  }
  
  .currency-more-btn {
    padding: 0.3rem 0.8rem;
    font-size: 0.75rem;
    bottom: 0.8rem;
    right: 0.8rem;
  }
}

@media (max-width: 400px) {
  .currency-cards-container {
    max-width: 320px;
    padding: 0.5rem 0.5rem 1.5rem;
  }
  
  :root {
    --card-height: 180px;
  }
  
  .currency-code {
    font-size: 0.9rem;
  }
  
  .rate-value {
    font-size: 0.9rem;
  }
  
  .target-value {
    font-size: 0.9rem;
  }
  
  .currency-arrow {
    font-size: 0.8rem;
  }
  
  .target-code {
    font-size: 0.75rem;
  }
  
  .currency-content {
    padding: 0.6rem;
  }
  
  .currency-header {
    margin-bottom: 0.5rem;
  }
  
  .currency-rate {
    margin-bottom: 0.5rem;
  }
  
  .update-time {
    font-size: 0.7rem;
  }
  
  .currency-more-btn {
    padding: 0.25rem 0.6rem;
    font-size: 0.7rem;
    bottom: 0.6rem;
    right: 0.6rem;
  }
}

/* Dark Mode Animated Cards */
[data-theme="dark"] .currency-data-section {
  background-color: var(--bg-color);
  border-top: 1px solid rgba(74, 74, 74, 0.2);
  border-bottom: 1px solid rgba(74, 74, 74, 0.2);
}

[data-theme="dark"] .currency-data-section .section-header h2 {
  color: var(--text-light);
}

[data-theme="dark"] .currency-data-section .section-header h2::after {
  background: var(--accent);
}

[data-theme="dark"] .currency-data-section .update-time {
  color: var(--text-dark);
}

[data-theme="dark"] .currency-card {
  background: var(--card-bg);
  color: var(--text-dark);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3), 0 5px 15px rgba(74, 74, 74, 0.3);
}

[data-theme="dark"] .currency-card:hover {
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4), 0 10px 20px rgba(74, 74, 74, 0.5);
}

[data-theme="dark"] .currency-card::before, 
[data-theme="dark"] .currency-card::after {
  --card-glow-1: #4a4a4a;
  --card-glow-2: #2d2d2d;
  --card-glow-3: #1a1a1a;
  opacity: 0.8;
}

[data-theme="dark"] .currency-card::after {
  filter: blur(20px);
}

[data-theme="dark"] .currency-content {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
}

[data-theme="dark"] .currency-flag {
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .currency-code {
  color: var(--text-light);
}

[data-theme="dark"] .rate-value {
  color: var(--text-light);
}

[data-theme="dark"] .currency-arrow {
  color: var(--accent-light);
  text-shadow: 0 0 5px rgba(74, 74, 74, 0.5);
}

[data-theme="dark"] .target-code {
  color: var(--accent-light);
}

[data-theme="dark"] .target-value {
  color: var(--accent-light);
}

[data-theme="dark"] .currency-more-btn {
  background-color: var(--primary-dark);
  color: var(--text-light);
}

[data-theme="dark"] .currency-more-btn:hover {
  background-color: var(--accent);
}

[data-theme="dark"] .currency-updated {
  color: var(--text-dark);
}

[data-theme="dark"] .update-label {
  color: var(--text-dark);
}

@media (max-width: 768px) {
  [data-theme="dark"] .currency-card {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(74, 74, 74, 0.4);
  }
  
  [data-theme="dark"] .currency-card:hover {
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.5), 0 8px 16px rgba(74, 74, 74, 0.6);
  }
}
