/* ========================================
   LUNAR CALENDAR FEATURES STYLING
   CSS cho Ngày Âm & Chú thích Ngày Đặc biệt
   ======================================== */

/* ==================== CURRENT DATE SECTION (Countdown) ==================== */

.current-date-section {
  background: var(--color-surface, white);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius-2xl, 1.5rem);
  padding: var(--space-6, 2rem);
  margin-bottom: var(--space-8, 3rem);
  box-shadow: var(--shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));
}

.current-date-header {
  text-align: center;
  margin-bottom: var(--space-5, 1.5rem);
}

.current-date-header h3 {
  font-size: var(--text-xl, 1.25rem);
  font-weight: 700;
  color: var(--color-text, #1f2937);
  margin-bottom: var(--space-2, 0.5rem);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2, 0.5rem);
}

.current-date-header h3 i {
  background: var(--gradient-primary, linear-gradient(135deg, #E63946, #FF1744));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.date-display-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-5, 1.5rem);
}

.date-display-card {
  background: linear-gradient(135deg, rgba(230, 57, 70, 0.05) 0%, rgba(255, 23, 68, 0.05) 100%);
  border: 2px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius-xl, 1rem);
  padding: var(--space-5, 1.5rem);
  transition: all var(--transition-base, 200ms ease);
}

.date-display-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.1));
  border-color: var(--color-primary, #E63946);
}

.date-display-card .date-label {
  font-size: var(--text-sm, 0.875rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary, #6b7280);
  margin-bottom: var(--space-3, 0.75rem);
  display: flex;
  align-items: center;
  gap: var(--space-2, 0.5rem);
}

.date-display-card .date-label i {
  font-size: var(--text-base, 1rem);
  color: var(--color-primary, #E63946);
}

.date-display-card .date-value {
  font-size: var(--text-lg, 1.125rem);
  font-weight: 700;
  color: var(--color-text, #1f2937);
  line-height: 1.5;
}

/* Solar Date Card - special styling */
.date-display-card.solar {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(37, 99, 235, 0.05) 100%);
}

.date-display-card.solar:hover {
  border-color: var(--color-info, #3B82F6);
}

.date-display-card.solar .date-label i {
  color: var(--color-info, #3B82F6);
}

/* Lunar Date Card - special styling */
.date-display-card.lunar {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, rgba(217, 119, 6, 0.05) 100%);
}

.date-display-card.lunar:hover {
  border-color: var(--color-accent, #F59E0B);
}

.date-display-card.lunar .date-label i {
  color: var(--color-accent, #F59E0B);
}

/* Special Day Badge */
.special-day-info {
  margin-top: var(--space-4, 1rem);
  text-align: center;
}

.special-day-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2, 0.5rem);
  padding: var(--space-3, 0.75rem) var(--space-5, 1.5rem);
  border-radius: var(--radius-full, 9999px);
  font-size: var(--text-sm, 0.875rem);
  font-weight: 700;
  animation: specialPulse 2s ease-in-out infinite;
}

@keyframes specialPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Special Day Types */
.special-day-badge.pre-tet {
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
  color: #92400E;
  border: 2px solid #F59E0B;
}

.special-day-badge.giao-thua {
  background: linear-gradient(135deg, #DBEAFE 0%, #BFDBFE 100%);
  color: #1E3A8A;
  border: 2px solid #3B82F6;
  animation: fireworksPulse 1s ease-in-out infinite;
}

@keyframes fireworksPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
  }
}

.special-day-badge.tet {
  background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
  color: #991B1B;
  border: 2px solid #E63946;
}

.special-day-badge.holiday {
  background: linear-gradient(135deg, #F3E8FF 0%, #E9D5FF 100%);
  color: #6B21A8;
  border: 2px solid #9C27B0;
}

.special-day-badge .special-icon {
  font-size: var(--text-xl, 1.25rem);
}

.special-day-badge .special-name {
  font-weight: 700;
}

/* ==================== CALENDAR DAY CELLS WITH LUNAR ==================== */

.calendar-day {
  position: relative;
  min-height: 80px; /* Tăng chiều cao để chứa ngày âm */
}

.day-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: var(--space-1, 0.25rem);
  position: relative;
}

/* Solar date number - larger, primary */
.calendar-day .day-number {
  font-size: var(--text-xl, 1.25rem);
  font-weight: 700;
  color: var(--color-text, #1f2937);
  line-height: 1;
  z-index: 2;
}

/* Lunar date - smaller, below solar date */
.calendar-day .lunar-date {
  font-size: var(--text-xs, 0.75rem);
  font-weight: 600;
  color: var(--color-text-muted, #9ca3af);
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 6px;
  border-radius: var(--radius-sm, 0.375rem);
  white-space: nowrap;
}

/* Special day label */
.special-day-label {
  position: absolute;
  bottom: var(--space-1, 0.25rem);
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.625rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm, 0.375rem);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 2px;
  z-index: 3;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.special-day-label .icon {
  font-size: 0.75rem;
}

.special-day-label .text {
  font-size: 0.625rem;
  line-height: 1;
}

/* Special day label types */
.special-day-label.pre-tet {
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  color: #92400E;
  border: 1px solid #F59E0B;
}

.special-day-label.giao-thua {
  background: linear-gradient(135deg, #DBEAFE, #BFDBFE);
  color: #1E3A8A;
  border: 1px solid #3B82F6;
  animation: labelPulse 1s ease-in-out infinite;
}

@keyframes labelPulse {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.05); }
}

.special-day-label.tet {
  background: linear-gradient(135deg, #FEE2E2, #FECACA);
  color: #991B1B;
  border: 1px solid #E63946;
  font-weight: 800;
}

.special-day-label.holiday {
  background: linear-gradient(135deg, #F3E8FF, #E9D5FF);
  color: #6B21A8;
  border: 1px solid #9C27B0;
}

/* Calendar day with special styling */
.calendar-day.special-day {
  border-width: 2px;
}

.calendar-day.special-pre-tet {
  background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
  border-color: #F59E0B !important;
}

.calendar-day.special-giao-thua {
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
  border-color: #3B82F6 !important;
}

.calendar-day.special-tet {
  background: var(--gradient-primary, linear-gradient(135deg, #E63946, #FF1744));
  border-color: transparent !important;
}

.calendar-day.special-tet .day-number,
.calendar-day.special-tet .lunar-date {
  color: white;
}

.calendar-day.special-tet .lunar-date {
  background: rgba(255, 255, 255, 0.2);
}

.calendar-day.special-holiday {
  background: linear-gradient(135deg, #FAF5FF 0%, #F3E8FF 100%);
  border-color: #9C27B0 !important;
}

/* Tet day - most prominent */
.calendar-day.tet-day {
  background: var(--gradient-primary, linear-gradient(135deg, #E63946, #FF1744));
  border-color: transparent !important;
  box-shadow: var(--shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.1));
}

.calendar-day.tet-day .day-number {
  color: white;
  font-size: var(--text-2xl, 1.5rem);
  font-weight: 900;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.calendar-day.tet-day .lunar-date {
  color: white;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.calendar-day.tet-day .day-label.tet {
  background: white;
  color: var(--color-primary, #E63946);
  border: none;
}

/* ==================== LEGEND WITH SPECIAL DAYS ==================== */

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4, 1rem);
  justify-content: center;
  padding-top: var(--space-6, 2rem);
  border-top: 2px solid var(--color-divider, #e5e7eb);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-2, 0.5rem);
  font-size: var(--text-sm, 0.875rem);
  font-weight: 600;
  color: var(--color-text-secondary, #6b7280);
}

.legend-icon {
  font-size: var(--text-lg, 1.125rem);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg, #f9fafb);
  border-radius: var(--radius-md, 0.5rem);
  border: 2px solid var(--color-border, #e5e7eb);
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
  .date-display-grid {
    grid-template-columns: 1fr;
  }
  
  .calendar-day {
    min-height: 70px;
  }
  
  .calendar-day .day-number {
    font-size: var(--text-lg, 1.125rem);
  }
  
  .calendar-day .lunar-date {
    font-size: 0.625rem;
    padding: 1px 4px;
  }
  
  .special-day-label {
    font-size: 0.5rem;
    padding: 1px 4px;
  }
  
  .special-day-label .icon {
    font-size: 0.625rem;
  }
  
  .special-day-label .text {
    display: none; /* Hide text on very small screens, show only icon */
  }
}

@media (max-width: 480px) {
  .current-date-section {
    padding: var(--space-4, 1rem);
  }
  
  .calendar-day {
    min-height: 60px;
  }
  
  .calendar-day .day-number {
    font-size: var(--text-base, 1rem);
  }
  
  .special-day-badge {
    padding: var(--space-2, 0.5rem) var(--space-3, 0.75rem);
    font-size: var(--text-xs, 0.75rem);
  }
}

/* ==================== ANIMATIONS ==================== */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.current-date-section {
  animation: fadeInUp 0.6s ease-out;
}

.date-display-card {
  animation: fadeInUp 0.6s ease-out;
  animation-fill-mode: backwards;
}

.date-display-card:nth-child(1) {
  animation-delay: 0.1s;
}

.date-display-card:nth-child(2) {
  animation-delay: 0.2s;
}

.date-display-card:nth-child(3) {
  animation-delay: 0.3s;
}

/* ==================== PRINT STYLES ==================== */

@media print {
  .special-day-badge {
    animation: none;
  }
  
  .calendar-day:hover {
    transform: none;
  }
}