/* 
 * GoRealo Modern Mortgage Rates UI
 * Beautiful, responsive design with improved user experience
 */

/* Main container */
.mortgage-rates-modern {
  max-width: 1140px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Tab navigation */
.mortgage-rates-tabs {
  display: flex;
  margin-bottom: 20px;
  border-radius: 12px;
  background: white;
  padding: 4px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
  border: 1px solid #eaedf7;
}

.mortgage-rates-tab {
  flex: 1;
  text-align: center;
  padding: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #666;
  font-weight: 500;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.mortgage-rates-tab.active {
  color: #0046E5;
  font-weight: 600;
}

.tab-indicator {
  position: absolute;
  height: calc(100% - 8px);
  top: 4px;
  z-index: 0;
  background: #f0f5ff;
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Year group buttons */
.year-group-nav {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.year-button {
  padding: 8px 16px;
  background: white;
  border: 1px solid #eaedf7;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
  font-weight: 500;
}

.year-button:hover {
  background: #f9faff;
  border-color: #d0d9f0;
}

.year-button.active {
  background: #0046E5;
  color: white;
  border-color: #0046E5;
  box-shadow: 0 2px 8px rgba(0, 70, 229, 0.3);
}

/* Rates card */
.rates-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  margin-bottom: 30px;
  transition: all 0.3s ease;
  position: relative;
}

.rates-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Card header */
.rates-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid #eaedf7;
}

.rates-card-title {
  display: flex;
  align-items: center;
}

.rates-card-title h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: #333;
}

.rates-card-title .live-indicator {
  display: inline-block;
  background-color: #28a745;
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 30px;
  margin-left: 10px;
  position: relative;
  animation: pulse 2s infinite;
}

.rates-updated {
  font-size: 0.85rem;
  color: #666;
}

/* Rates content */
.rates-content {
  padding: 0;
}

/* Modern table */
.rates-table-modern {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.rates-table-modern thead th {
  text-align: left;
  padding: 15px 20px;
  font-weight: 600;
  font-size: 0.9rem;
  color: #666;
  background: #f9fafd;
  position: sticky;
  top: 0;
  z-index: 1;
}

.rates-table-modern tbody tr {
  transition: all 0.2s ease;
}

.rates-table-modern tbody tr:hover {
  background-color: #f9faff;
}

.rates-table-modern td {
  padding: 15px 20px;
  border-top: 1px solid #f0f3fa;
}

/* Highlight best rates */
.rates-table-modern tr.best-rate {
  background-color: rgba(40, 167, 69, 0.06);
}

.rates-table-modern tr.best-rate:hover {
  background-color: rgba(40, 167, 69, 0.1);
}

.best-rate-badge {
  display: inline-block;
  background: linear-gradient(45deg, #28a745, #5cb85c);
  color: white;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 30px;
  margin-left: 8px;
  vertical-align: middle;
}

/* Rate and APR styling */
.rate-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: #28a745;
}

.apr-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0046E5;
}

/* Disclaimer */
.rates-disclaimer {
  padding: 15px 20px;
  background-color: #f9fafd;
  border-top: 1px solid #eaedf7;
  font-size: 0.8rem;
  color: #666;
  line-height: 1.5;
}

/* Compact footer view */
.mortgage-rates-compact {
  margin: 15px 0;
}

.compact-rates-wrapper {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 15px;
  position: relative;
}

.compact-rates-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.compact-rate-item {
  flex: 1 0 200px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 10px 15px;
  position: relative;
  transition: all 0.2s ease;
}

.compact-rate-item.best-rate {
  background: rgba(40, 167, 69, 0.2);
}

.compact-rate-type {
  display: block;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
}

.compact-rate-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  margin-right: 5px;
}

.compact-rate-apr {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
}

.compact-rates-updated {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 8px;
}

.compact-rates-link {
  display: inline-block;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.2s ease;
}

.compact-rates-link:hover {
  color: #fff;
  border-bottom-color: #fff;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .year-group-nav {
    justify-content: center;
  }
  
  .rates-card-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .rates-updated {
    margin-top: 8px;
  }
  
  .rates-table-modern {
    display: block;
    overflow-x: auto;
  }
  
  .compact-rates-list {
    flex-direction: column;
  }
  
  .compact-rate-item {
    flex: 1 0 auto;
  }
}

/* Animations */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
} 