/* New Sections Styling */

/* Services Grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

/* Fix for text overflow in section headings */
section h2, section p {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  max-width: 100%;
}

.service-card {
  background: linear-gradient(180deg, rgba(255,255,255,.15), rgba(255,255,255,.05));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(120, 219, 255, 0.1), transparent);
  transition: all 0.6s ease;
}

.service-card:hover::before {
  left: 100%;
}

.service-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 
    0 15px 35px rgba(0,0,0,.2),
    0 0 25px rgba(120, 219, 255, 0.4),
    inset 0 0 15px rgba(255,255,255,.2);
  border: 1px solid rgba(120, 219, 255, 0.5);
}

.service-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
  filter: drop-shadow(0 0 10px rgba(120, 219, 255, 0.6));
}

.service-card h3 {
  margin: 16px 0 12px;
  color: var(--text-heading);
  font-size: 1.3rem;
}

.service-card p {
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.6;
}

.service-features {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.feature {
  color: var(--accent);
  font-size: 0.9rem;
  padding: 4px 0;
  border-bottom: 1px solid rgba(120, 219, 255, 0.2);
}

/* Nutrition Tabs */
.nutrition-tabs {
  margin-top: 24px;
}

.tab-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 12px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.1);
  color: var(--text);
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  backdrop-filter: blur(5px);
}

.tab-btn:hover,
.tab-btn.active {
  background: linear-gradient(135deg, rgba(120, 219, 255, 0.2), rgba(255, 119, 198, 0.2));
  border-color: var(--accent);
  box-shadow: 0 0 15px rgba(120, 219, 255, 0.4);
  transform: translateY(-2px);
}

.tab-content {
  position: relative;
}

.tab-panel {
  display: none;
  animation: fadeInUp 0.5s ease;
}

.tab-panel.active {
  display: block;
}

.nutrition-card {
  background: linear-gradient(180deg, rgba(255,255,255,.15), rgba(255,255,255,.05));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  backdrop-filter: blur(10px);
}

.nutrition-card h3 {
  color: var(--text-heading);
  margin-bottom: 24px;
  font-size: 1.4rem;
}

.nutrition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.nutrition-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: rgba(255,255,255,.1);
  border-radius: var(--radius-md);
  border: 1px solid rgba(120, 219, 255, 0.2);
  transition: all 0.3s ease;
}

.nutrition-item:hover {
  background: rgba(120, 219, 255, 0.1);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.nutrition-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 8px rgba(120, 219, 255, 0.6));
}

.nutrition-item h4 {
  margin: 0 0 4px;
  color: var(--text-heading);
  font-size: 1.1rem;
}

.nutrition-item p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Emergency Grid */
.emergency-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.emergency-card {
  border-radius: var(--radius-xl);
  padding: 24px;
  backdrop-filter: blur(10px);
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}

.emergency-card.urgent {
  background: linear-gradient(180deg, rgba(255, 69, 58, 0.15), rgba(255, 69, 58, 0.05));
  border: 2px solid rgba(255, 69, 58, 0.4);
}

.emergency-card.warning {
  background: linear-gradient(180deg, rgba(255, 159, 10, 0.15), rgba(255, 159, 10, 0.05));
  border: 2px solid rgba(255, 159, 10, 0.4);
}

.emergency-card.info {
  background: linear-gradient(180deg, rgba(120, 219, 255, 0.15), rgba(120, 219, 255, 0.05));
  border: 2px solid rgba(120, 219, 255, 0.4);
}

.emergency-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0,0,0,.2);
}

.emergency-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.emergency-icon {
  font-size: 2rem;
}

.emergency-header h3 {
  margin: 0;
  color: var(--text-heading);
}

.emergency-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}

.emergency-list li {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,.1);
  color: var(--text);
}

.emergency-list li:before {
  content: '• ';
  color: var(--accent);
  font-weight: bold;
  margin-right: 8px;
}

.emergency-btn {
  background: linear-gradient(135deg, #ff453a, #ff6b6b) !important;
  animation: pulse 2s infinite;
}

/* Tips Carousel */
.tips-carousel {
  position: relative;
  margin-top: 24px;
  overflow: hidden;
  border-radius: var(--radius-xl);
}

.tip-card {
  background: linear-gradient(180deg, rgba(255,255,255,.15), rgba(255,255,255,.05));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  backdrop-filter: blur(10px);
  display: none;
  position: relative;
  overflow: hidden;
}

.tip-card.active {
  display: block;
  animation: slideInRight 0.5s ease;
}

.tip-number {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: #051019;
  font-size: 1.2rem;
}

.tip-card h3 {
  color: var(--text-heading);
  margin-bottom: 16px;
  font-size: 1.4rem;
}

.tip-card p {
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 20px;
}

.tip-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tip-tag {
  padding: 6px 12px;
  background: rgba(120, 219, 255, 0.2);
  border: 1px solid rgba(120, 219, 255, 0.4);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  color: var(--accent);
}

.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 24px;
}

.carousel-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.1);
  color: var(--text);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.2rem;
  backdrop-filter: blur(5px);
}

.carousel-btn:hover {
  background: linear-gradient(135deg, rgba(120, 219, 255, 0.2), rgba(255, 119, 198, 0.2));
  border-color: var(--accent);
  transform: scale(1.1);
}

.carousel-dots {
  display: flex;
  gap: 8px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(120, 219, 255, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
}

.dot.active,
.dot:hover {
  background: var(--accent);
  transform: scale(1.2);
}

/* Community Features */
.community-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.community-card {
  background: linear-gradient(180deg, rgba(255,255,255,.15), rgba(255,255,255,.05));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.community-card:hover {
  transform: translateY(-8px) rotateY(5deg);
  box-shadow: 
    0 20px 40px rgba(0,0,0,.2),
    0 0 30px rgba(120, 219, 255, 0.4);
  border: 1px solid rgba(120, 219, 255, 0.6);
}

.community-icon {
  font-size: 3.5rem;
  margin-bottom: 20px;
  display: block;
  filter: drop-shadow(0 0 15px rgba(120, 219, 255, 0.8));
}

.community-card h3 {
  color: var(--text-heading);
  margin-bottom: 16px;
  font-size: 1.3rem;
}

.community-card p {
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.6;
}

.contest-info,
.forum-stats,
.event-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
  padding: 16px;
  background: rgba(120, 219, 255, 0.1);
  border-radius: var(--radius-md);
  border: 1px solid rgba(120, 219, 255, 0.2);
}

.contest-prize,
.contest-entries,
.forum-stat,
.next-event,
.event-location {
  font-size: 0.9rem;
  color: var(--text);
}

.contest-prize {
  color: var(--accent2);
  font-weight: 600;
}

/* Community reveal fallback (ensures animation under 🤝 Pet Community) */
.community-features .option .community-card {
  opacity: 0;
  transform: translateY(20px) scale(0.98);
  transition: transform 600ms var(--ease-out-cubic), opacity 600ms var(--ease-out-cubic);
  will-change: transform, opacity;
}
.community-features .option.from-right .community-card {
  transform: translateX(40px) scale(0.98);
}
.community-features .option.from-left .community-card {
  transform: translateX(-40px) scale(0.98);
}
/* Trigger when option becomes visible (set by scroll observers) or when JS slide-in activates */
.community-features .option.in-view .community-card,
.community-features .option .community-card.slide-in-active {
  opacity: 1;
  transform: translateX(0) translateY(0) scale(1);
}

/* Animations */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .services-grid,
  .emergency-grid,
  .community-features {
    grid-template-columns: 1fr;
  }
  
  .tab-buttons {
    justify-content: center;
  }
  
  .tab-btn {
    flex: 1;
    min-width: 120px;
  }
  
  .nutrition-grid {
    grid-template-columns: 1fr;
  }
  
  .tip-card {
    padding: 24px;
  }
  
  .tip-number {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
}