/* Holiday Calendar - Custom Styles */

/* Holiday Cards */
.holiday-card {
  transition: all 0.3s ease;
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
}

.holiday-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(
    to bottom,
    transparent,
    currentColor,
    transparent
  );
  opacity: 0.3;
}

.holiday-card:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
}

/* Loading State */
.loading-state {
  animation: fadeIn 0.3s ease;
}

.loading-state .animate-spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Empty State */
.empty-state {
  animation: fadeIn 0.3s ease;
}

/* Error State */
.error-state {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Year Navigation Buttons */
#prevYear,
#nextYear {
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

#prevYear::before,
#nextYear::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease;
}

#prevYear:hover::before,
#nextYear:hover::before {
  width: 300px;
  height: 300px;
}

#prevYear:hover,
#nextYear:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(20, 184, 166, 0.4);
}

/* Filter Selects */
select {
  transition: all 0.2s ease;
  cursor: pointer;
}

select:hover {
  border-color: #14b8a6;
  background-color: #f0fdfa;
}

select:focus {
  outline: none;
  border-color: #14b8a6;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
  background-color: #f0fdfa;
}

/* Compact controls */
.holiday-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.control-label {
  font-weight: 700;
  color: #111827;
  font-size: 0.95rem;
}

.control-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.5rem;
}

.control-select,
.control-btn {
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  padding: 0.6rem 0.75rem;
  font-weight: 600;
  color: #111827;
  background: #ffffff;
  transition: all 0.15s ease;
  min-height: 42px;
}

.control-select:focus,
.control-btn:focus {
  outline: none;
  border-color: #437874;
  box-shadow: 0 0 0 3px rgba(67, 120, 116, 0.15);
}

.control-btn {
  background: #437874;
  color: #ffffff;
  border-color: #437874;
}

.control-btn:hover {
  background: #3a6b67;
}

.control-select {
  width: 100%;
}

/* Table layout */
.holiday-table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.holiday-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  overflow: hidden;
}

.holiday-table th {
  text-align: left;
  padding: 0.85rem 0.75rem;
  font-weight: 700;
  color: #1f2937;
  background: linear-gradient(90deg, #f5f8f7, #eef3f2);
  border-bottom: 2px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 1;
}

.holiday-table td {
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid #e5e7eb;
  color: #1f2937;
  vertical-align: top;
}

.holiday-table tr:hover {
  background: #f7fbfa;
}

.holiday-date {
  min-width: 180px;
}

.holiday-date-top {
  font-size: 0.85rem;
  font-weight: 700;
  color: #6b7280;
}

.holiday-date-main {
  font-size: 0.95rem;
  font-weight: 700;
  color: #111827;
}

.holiday-name {
  font-weight: 700;
}

.holiday-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.85rem;
  border: 1px solid transparent;
}

.holiday-badge.afghan {
  background: #fff7ed;
  color: #b45309;
  border-color: #fbbf24;
}

.holiday-badge.islamic {
  background: #ecfdf3;
  color: #065f46;
  border-color: #34d399;
}

.holiday-badge.international {
  background: #eef2ff;
  color: #3730a3;
  border-color: #c7d2fe;
}

.holiday-past {
  background: #fff1f2;
}

.holiday-past:hover {
  background: #ffe4e6;
}

.holiday-upcoming {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0.35rem;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  background: #ecfdf3;
  color: #065f46;
  border: 1px solid #34d399;
  font-weight: 700;
  font-size: 0.8rem;
}

.holiday-table tfoot td {
  padding: 0.75rem;
  font-weight: 600;
  color: #374151;
  background: #f9fafb;
}

@media (max-width: 640px) {
  .holiday-date {
    min-width: 140px;
  }
  .holiday-table th,
  .holiday-table td {
    padding: 0.65rem 0.5rem;
  }
  .holiday-table th {
    position: static;
  }
}

/* Holiday Type Badges */
.holiday-card span {
  white-space: nowrap;
  transition: all 0.2s ease;
}

.holiday-card:hover span {
  transform: scale(1.05);
}

/* Date Box Styling */
.holiday-card .w-20 {
  transition: all 0.3s ease;
}

.holiday-card:hover .w-20 {
  transform: scale(1.1) rotate(5deg);
}

/* Calendar Info Boxes */
.holiday-card .bg-white\/60 {
  transition: all 0.2s ease;
}

.holiday-card .bg-white\/60:hover {
  background-color: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* TODAY Badge Animation */
.holiday-card .bg-teal-600 {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

/* UPCOMING Badge */
.holiday-card .bg-green-600 {
  animation: subtle-pulse 3s infinite;
}

@keyframes subtle-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.9;
  }
}

/* Responsive Improvements */
@media (max-width: 768px) {
  .holiday-card {
    padding: 1.5rem;
  }

  .holiday-card .flex {
    flex-direction: column;
  }

  .holiday-card .w-20 {
    width: 5rem;
    height: 5rem;
  }

  .holiday-card .text-3xl {
    font-size: 2rem;
  }

  .holiday-card span {
    margin-top: 0.75rem;
    margin-left: 0;
    align-self: flex-start;
  }

  .holiday-card .grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

/* Additional spacing improvements */
#holidaysList {
  padding-top: 0.5rem;
}

/* Better spacing for empty and error states */
.empty-state,
.error-state {
  padding: 3rem 1rem;
}

@media (min-width: 640px) {
  .empty-state,
  .error-state {
    padding: 4rem 1rem;
  }
}

/* Improved container spacing */
#holidaysContainer {
  margin-bottom: 2rem;
}

/* Better button spacing on mobile */
@media (max-width: 640px) {
  #prevYear,
  #nextYear {
    font-size: 0.875rem;
    padding: 0.625rem 1rem;
  }

  #yearSelect {
    font-size: 0.875rem;
    padding: 0.625rem 0.75rem;
  }
}

/* Container Animation */
#holidaysContainer {
  animation: slideIn 0.5s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Holiday List Animation */
#holidaysList {
  animation: fadeIn 0.5s ease;
}

/* Year Title */
#yearTitle {
  background: linear-gradient(to right, #14b8a6, #0d9488);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Smooth Transitions */
* {
  transition-property: color, background-color, border-color, transform, opacity;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Improved spacing for calendar info boxes */
.holiday-card .bg-white\/60 {
  min-height: 4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Better visual hierarchy */
.holiday-card h3 {
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

/* Improved date box hover effect */
.holiday-card .bg-white\/60:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Better spacing for type badge */
.holiday-card > div > div:last-child {
  margin-top: 0.5rem;
}

@media (min-width: 768px) {
  .holiday-card > div > div:last-child {
    margin-top: 0;
  }
}
