/* Import theme variables */
@import url('theme.css');

body {
  font-family: var(--font-primary, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif);
  margin: 0;
  padding: 0;
  background: var(--bg-color, #f0fdf4);
  color: var(--text-color, #333);
  transition: background 0.3s ease, color 0.3s ease;
}

/* Header */
header {
  background: linear-gradient(135deg, var(--primary-green, #2e7d32), var(--secondary-green, #66bb6a));
  color: #fff;
  padding: 1.5rem 2rem;
  text-align: center;
  position: relative;
  min-height: 70px;
  display: flex;
  justify-content: center;
  align-items: center;
}

header h1 {
  margin: 0;
  font-size: 2.2rem;
  font-weight: 600;
  background: linear-gradient(45deg, #fff, #f0fdf4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-actions {
  position: absolute;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 1rem;
}

/* Theme toggle button */
.theme-toggle {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.6rem 1rem;
  border-radius: 50px;
  font-size: 0.9rem;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.25);
}

.back-btn {
  color: #fff;
  text-decoration: none;
  font-size: 1rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.3s ease;
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Crop filter */
.filter-container {
  margin: 1.5rem;
  text-align: center;
}

#cropSelect {
  padding: 0.5rem 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
}

/* Calendar Grid */
.calendar {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 0.5rem;
  padding: 1.5rem;
  max-width: 95%;
  margin: auto;
}

.calendar div {
  padding: 0.75rem;
  text-align: center;
  border-radius: 6px;
  transition: transform 0.3s ease, background 0.3s ease, opacity 0.3s ease;
  font-size: 0.95rem;
}

/* Header months */
.month {
  font-weight: bold;
  background: var(--light-green, #e8f5e9);
  animation: fadeInUp 0.4s ease forwards;
}

/* Crop name column */
.crop-name {
  font-weight: bold;
  background: #fff8e1;
  color: #333;
}

/* Cell states */
.month-cell.sow {
  background: #c8e6c9;
}
.month-cell.grow {
  background: #fff9c4;
}
.month-cell.harvest {
  background: #ffccbc;
}

/* Emojis and tooltip */
.emoji {
  font-size: 1.2rem;
  display: block;
}
.tooltip {
  visibility: hidden;
  opacity: 0;
  background: #333;
  color: #fff;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  margin-top: 0.3rem;
  position: absolute;
  transform: translate(-50%, -100%);
  white-space: nowrap;
  transition: opacity 0.3s ease;
  z-index: 20;
}
.month-cell:hover .tooltip {
  visibility: visible;
  opacity: 1;
}

/* Loading state */
.calendar-loading {
  text-align: center;
  padding: 2rem;
}
.loading-spinner {
  border: 4px solid #ddd;
  border-top: 4px solid #4caf50;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  margin: auto;
  animation: spin 1s linear infinite;
}
.loading-text {
  margin-top: 1rem;
  font-size: 1rem;
  color: #666;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
