/* Medical Tips Page Styles */

/* Hero Section Animation */
.medical-tips-hero {
  animation: fadeInDown 1s ease-out;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Category Button Enhancements */
.tip-category-btn {
  position: relative;
  overflow: hidden;
}

.tip-category-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.4s ease;
}

.tip-category-btn:hover::before {
  width: 120px;
  height: 120px;
}

/* Tip Cards Advanced Styling */
.tip-card {
  position: relative;
  backdrop-filter: blur(10px);
}

.tip-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 0.6s ease;
  z-index: 1;
}

.tip-card:hover::before {
  left: 100%;
}

/* Featured Card Special Effects */
.tip-card:first-child {
  position: relative;
}

.tip-card:first-child::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #3B82F6, #1D4ED8, #3B82F6);
  border-radius: 22px;
  z-index: -1;
  animation: borderGlow 3s ease-in-out infinite;
}

@keyframes borderGlow {
  0%, 100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* Daily Tip Widget Animation */
.daily-tip-widget {
  animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

/* Checkmark Animation */
.tip-card li span {
  display: inline-block;
  transition: transform 0.3s ease;
}

.tip-card:hover li span {
  transform: scale(1.2);
  animation: checkBounce 0.5s ease;
}

@keyframes checkBounce {
  0% { transform: scale(1.2); }
  50% { transform: scale(1.4); }
  100% { transform: scale(1.2); }
}

/* Newsletter Form Enhancement */
.newsletter-section form {
  position: relative;
}

.newsletter-section input:focus {
  animation: inputFocus 0.3s ease;
}

@keyframes inputFocus {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

/* Hover Effects for Buttons */
button {
  position: relative;
  overflow: hidden;
}

button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.3s ease;
}

button:hover::after {
  width: 200px;
  height: 200px;
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.loading::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  border: 2px solid #E2E8F0;
  border-top: 2px solid #3B82F6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  transform: translate(-50%, -50%);
  z-index: 10;
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Scroll Animations */
.scroll-animate {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.scroll-animate.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Category Filter Sticky */
.tips-categories {
  position: sticky;
  top: 80px;
  z-index: 100;
  margin-bottom: 50px;
}

/* Enhanced Shadow Effects */
.tip-card:hover {
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* Text Selection */
::selection {
  background: rgba(59, 130, 246, 0.2);
  color: #1E293B;
}

::-moz-selection {
  background: rgba(59, 130, 246, 0.2);
  color: #1E293B;
}

/* Responsive Enhancements */
@media (max-width: 768px) {
  .medical-tips-hero {
    padding: 60px 0 40px !important;
  }
  
  .tips-categories {
    position: static;
    margin: 0 16px 32px;
  }
  
  .tip-card {
    animation-delay: 0s !important;
  }
  
  .tip-category-btn {
    margin-bottom: 8px;
  }
}

@media (max-width: 480px) {
  .medical-tips-hero h1 {
    font-size: 28px !important;
    line-height: 1.3 !important;
  }
  
  .medical-tips-hero p {
    font-size: 15px !important;
  }
  
  .tips-categories > div {
    padding: 16px !important;
  }
  
  .tip-card {
    padding: 20px !important;
    margin-bottom: 16px;
  }
  
  .tip-card h3 {
    font-size: 18px !important;
  }
  
  .daily-tip-widget > div {
    padding: 24px !important;
  }
  
  .newsletter-section > div {
    padding: 24px !important;
  }
}

/* Print Styles */
@media print {
  .tips-categories,
  .newsletter-section,
  button {
    display: none !important;
  }
  
  .tip-card {
    break-inside: avoid;
    margin-bottom: 20px;
    box-shadow: none;
    border: 1px solid #E2E8F0;
  }
  
  .medical-tips-hero {
    padding: 20px 0 !important;
  }
  
  .medical-tips-hero h1 {
    color: #000 !important;
    font-size: 24px !important;
  }
}

/* Dark Mode Support (if needed later) */
@media (prefers-color-scheme: dark) {
  .tip-card {
    background: #1E293B !important;
    border-color: #334155 !important;
    color: #F1F5F9;
  }
  
  .tip-card h3 {
    color: #F1F5F9 !important;
  }
  
  .tip-card p {
    color: #CBD5E1 !important;
  }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .tip-card {
    border: 2px solid #000;
  }
  
  button {
    border: 2px solid #000;
  }
}

/* Focus Visible for Accessibility */
button:focus-visible,
input:focus-visible {
  outline: 2px solid #3B82F6;
  outline-offset: 2px;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #F1F5F9;
}

::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}