@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

:root {
  --color-bg: #1a1a2e;
  --color-text: #e6e6e6;
  --color-primary: #0f3460;
  --color-secondary: #16213e;
  --color-accent: #e94560;
  --color-day-shift: #4caf50;
  --color-night-shift: #3f51b5;
  --color-holiday: #e67e22;
  --color-tbc: #f39c12;
  --color-no-work: #333;
  --color-weekend: rgba(255, 255, 255, 0.08);
  --color-today: #ff9800;
  --border-radius: 8px;
  --transition-speed: 0.3s;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  max-height: 1600px;
  display: flex;
  flex-direction: column;
}

/* Header Section */
header {
  margin-bottom: 1rem;
  text-align: center;
}

h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--color-accent);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.control-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.date-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-button {
  background-color: var(--color-primary);
  color: var(--color-text);
  border: none;
  border-radius: var(--border-radius);
  padding: 0.5rem 1rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color var(--transition-speed), transform 0.15s ease;
  min-height: 44px;
  min-width: 44px;
}

.nav-button:hover {
  background-color: var(--color-accent);
  transform: scale(1.05);
}

.action-button {
  background-color: var(--color-accent);
  color: var(--color-text);
  border: none;
  border-radius: var(--border-radius);
  padding: 0.5rem 1rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color var(--transition-speed), transform 0.15s ease;
  min-height: 44px;
}

.action-button:hover {
  background-color: var(--color-primary);
  transform: scale(1.05);
}

/* Main Content */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

section {
  background-color: var(--color-secondary);
  border-radius: var(--border-radius);
  padding: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--color-accent);
}

h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--color-accent);
}

/* Calendar */
.calendar-container {
  overflow: hidden;
}

.weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 8px;
  text-align: center;
  font-weight: bold;
}

.weekdays div:nth-child(6),
.weekdays div:nth-child(7) {
  color: var(--color-accent);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.calendar-day {
  aspect-ratio: 1/0.8;
  padding: 0.4rem;
  border-radius: var(--border-radius);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  background-color: var(--color-no-work);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.calendar-day:hover {
  transform: scale(1.03);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.weekend {
  background-color: var(--color-weekend);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.weekend.day-shift, .weekend.night-shift,
.weekend.holiday-shift, .weekend.tbc-shift {
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.today-marker {
  border: 3px solid var(--color-today);
  box-shadow: 0 0 12px rgba(255, 152, 0, 0.5);
  animation: today-pulse 2s ease-in-out infinite;
}

@keyframes today-pulse {
  0%, 100% { box-shadow: 0 0 12px rgba(255, 152, 0, 0.5); }
  50% { box-shadow: 0 0 20px rgba(255, 152, 0, 0.8); }
}

.day-number {
  font-size: 1.2rem;
  font-weight: bold;
}

.day-shift {
  background: linear-gradient(135deg, var(--color-day-shift), #388e3c);
  color: #fff;
}

.night-shift {
  background: linear-gradient(135deg, var(--color-night-shift), #303f9f);
  color: #fff;
}

.holiday-shift {
  background: linear-gradient(135deg, var(--color-holiday), #d4650a);
  color: #fff;
}

.tbc-shift {
  background: linear-gradient(135deg, var(--color-tbc), #e08e0b);
  color: #fff;
}

.other-month {
  opacity: 0.5;
}

.shift-indicator {
  width: 100%;
  text-align: center;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: bold;
}

/* Shift Info Section */
.shift-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.status-line {
  font-size: 1rem;
}

.status-day {
  color: var(--color-day-shift);
  font-weight: 600;
}

.status-night {
  color: var(--color-night-shift);
  font-weight: 600;
}

.status-holiday {
  color: var(--color-holiday);
  font-weight: 600;
}

.status-tbc {
  color: var(--color-tbc);
  font-weight: 600;
}

.status-off {
  color: var(--color-text);
  opacity: 0.7;
}

.shift-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
}

.shift-badge.shift-day {
  background-color: var(--color-day-shift);
  color: #fff;
}

.shift-badge.shift-nights {
  background-color: var(--color-night-shift);
  color: #fff;
}

.shift-badge.shift-holiday {
  background-color: var(--color-holiday);
  color: #fff;
}

.shift-badge.shift-tbc {
  background-color: var(--color-tbc);
  color: #fff;
}

/* Week Summary */
.week-summary h3 {
  margin-bottom: 0.5rem;
}

.week-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.week-pill {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  min-width: 44px;
  text-align: center;
}

.week-pill:hover {
  transform: scale(1.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.week-pill-today {
  border: 2px solid var(--color-today);
}

.week-pill-day {
  background-color: var(--color-day-shift);
  color: #fff;
}

.week-pill-nights {
  background-color: var(--color-night-shift);
  color: #fff;
}

.week-pill-holiday {
  background-color: var(--color-holiday);
  color: #fff;
}

.week-pill-tbc {
  background-color: var(--color-tbc);
  color: #fff;
}

.week-pill-off {
  background-color: var(--color-no-work);
  color: var(--color-text);
  opacity: 0.6;
}

/* Footer */
footer {
  margin-top: 0.5rem;
  text-align: center;
  font-size: 0.7rem;
  opacity: 0.5;
}

/* Responsive adjustments */
@media only screen and (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  h1 {
    font-size: 1.8rem;
  }

  .calendar-day {
    padding: 0.3rem;
  }

  .day-number {
    font-size: 1rem;
  }

  .shift-indicator {
    font-size: 0.7rem;
  }
}

@media only screen and (max-width: 480px) {
  .container {
    padding: 0.5rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  .control-panel {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .date-nav {
    justify-content: center;
  }

  .nav-button, .action-button {
    min-height: 48px;
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
  }

  .weekdays {
    gap: 4px;
    margin-bottom: 4px;
  }

  .weekdays div {
    font-size: 0.75rem;
  }

  .calendar-grid {
    gap: 4px;
  }

  .calendar-day {
    padding: 0.3rem;
    aspect-ratio: 1/0.9;
  }

  .day-number {
    font-size: 0.9rem;
  }

  .shift-indicator {
    font-size: 0.65rem;
    padding: 1px 2px;
  }

  .status-line {
    font-size: 0.95rem;
  }

  .week-pills {
    gap: 4px;
  }

  .week-pill {
    padding: 8px 10px;
    font-size: 0.8rem;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  section {
    padding: 0.75rem;
  }

  footer {
    font-size: 0.65rem;
  }
}
