/**
 * Dierenweide Inplanner - Modern Stylesheet
 * Moderne, responsive styling voor de dierenweide inplanner
 */

/* ========================================
   Basis variabelen en reset
   ======================================== */
:root {
  --primary-color: #d25068;
  --primary-dark: #c41d3e;
  --primary-light: #fd9cae;
  --secondary-color: #350695;
  --success-color: #4caf50;
  --warning-color: #ff9800;
  --error-color: #f44336;

  --text-primary: #333;
  --text-secondary: #666;
  --text-light: #999;

  --bg-primary: #ffffff;
  --bg-secondary: #f9f9f9;
  --bg-tertiary: #f5f5f5;

  --border-color: #ddd;
  --border-radius: 8px;
  --box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);

  --font-family: "Roboto", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}
.wpsm_nav,
.wpsm_nav-tabs {
  display: none !important;
}
/* ========================================
   Hoofdcontainer
   ======================================== */
.dierenweide-wrapper {
  font-family: var(--font-family);
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  background: var(--bg-primary);
}

/* ========================================
   Tab navigatie (zonder externe plugin)
   ======================================== */
.dierenweide-tabs {
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  overflow: hidden;
}

.tab-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: var(--bg-tertiary);
  padding: 0;
  border-bottom: 3px solid var(--primary-color);
}

.tab-button {
  background: transparent;
  border: none;
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  text-transform: capitalize;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.tab-button:nth-child(4n) {
  border-right: none;
}

.tab-button:hover {
  background: rgba(210, 80, 104, 0.1);
  color: var(--primary-color);
}

.tab-button.active {
  background: var(--primary-color);
  color: white;
  font-weight: 600;
}

.tab-button.active::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-dark);
}

/* Bezettingsindicator */
.tab-month {
  font-size: 13px;
}

.tab-occupancy {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
}

.occupancy-bar {
  width: 60px !important;
  height: 10px !important;
  background: #ddd !important;
  border-radius: 5px;
  overflow: hidden;
  position: relative;
  border: 1px solid #bbb;
}

.tab-button.active .occupancy-bar {
  background: rgba(255, 255, 255, 0.4) !important;
  border-color: rgba(255, 255, 255, 0.5);
}

.occupancy-fill {
  height: 100% !important;
  transition: width 0.3s ease;
  border-radius: 4px;
  min-width: 3px !important;
  display: block !important;
  background: #2196f3 !important;
}

.tab-button.active .occupancy-fill {
  background: #42a5f5 !important;
}

.occupancy-text {
  display: none;
}

/* Tab content */
.tab-content {
  padding: 30px;
  min-height: 400px;
}

/* ========================================
   Kalender styling
   ======================================== */
.dierenweide-calendar {
  width: 100%;
  overflow-x: auto;
}

.calendar-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  color: var(--text-secondary);
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--bg-tertiary);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

table.calendar {
  width: 100%;
  border-collapse: collapse;
  background: white;
  box-shadow: var(--box-shadow);
  border-radius: var(--border-radius);
  overflow: hidden;
  table-layout: fixed;
}

.calendar-row {
  font-family: var(--font-family);
}

td.calendar-day-head {
  background: var(--primary-color);
  color: white;
  font-weight: 600;
  text-align: center;
  padding: 15px 8px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: 14.28%; /* 100% / 7 dagen */
}

td.calendar-day {
  min-height: 120px;
  height: 120px;
  vertical-align: top;
  padding: 10px;
  border: 1px solid var(--border-color);
  position: relative;
  background: var(--bg-primary);
  transition: background 0.2s ease;
  width: 14.28%; /* 100% / 7 dagen */
}

td.calendar-day:hover {
  background: var(--bg-secondary);
}

td.calendar-day-np {
  background: var(--bg-tertiary);
  min-height: 120px;
  height: 120px;
  border: 1px solid var(--border-color);
  width: 14.28%; /* 100% / 7 dagen */
}

.day-number {
  background: var(--secondary-color);
  color: white;
  font-weight: 600;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 14px;
  margin-bottom: 8px;
}

.vrijwilliger,
.vrijwilliger-dag1,
.achterwacht {
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  margin-top: 5px;
  font-weight: 500;
  text-align: center;
  transition: all 0.2s ease;
}

.vrijwilliger {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.vrijwilliger-dag1 {
  background: var(--primary-dark);
  color: white;
  cursor: pointer;
}

.vrijwilliger-dag1:hover {
  background: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(210, 80, 104, 0.3);
}

.achterwacht {
  background: #e8f5e9;
  color: var(--success-color);
  font-size: 11px;
  margin-top: 3px;
}

/* ========================================
   Gebruikersrooster sectie
   ======================================== */
.user-schedule-section {
  margin-top: 30px;
  background: white;
  padding: 25px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

.user-schedule-section h3 {
  color: var(--primary-color);
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 24px;
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: 10px;
}

.schedule-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  flex-wrap: wrap;
  gap: 15px;
}

.schedule-header h2 {
  color: var(--primary-color);
  margin: 0;
}

.year-selector {
  display: flex;
  align-items: center;
  gap: 15px;
}

.year-prev,
.year-next {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.year-prev:hover,
.year-next:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.current-year {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: linear-gradient(
    135deg,
    var(--primary-light) 0%,
    var(--primary-color) 100%
  );
  padding: 25px;
  border-radius: var(--border-radius);
  text-align: center;
  box-shadow: var(--box-shadow);
  transition: transform 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-card-warning {
  background: linear-gradient(135deg, #ffcc80 0%, var(--warning-color) 100%);
}

.stat-value {
  font-size: 42px;
  font-weight: 700;
  color: white;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Schedule list */
.schedule-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 30px;
}

.schedule-upcoming h3,
.schedule-past h3 {
  color: var(--text-primary);
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 18px;
}

.schedule-item {
  background: var(--bg-secondary);
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.schedule-item:hover {
  background: #fff3f5;
  transform: translateX(5px);
}

.schedule-item.past {
  opacity: 0.6;
}

.schedule-dates {
  flex: 1;
  font-size: 15px;
}

.date-separator {
  color: var(--text-light);
  margin: 0 8px;
}

.cancel-week-btn {
  background: var(--error-color);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.cancel-week-btn:hover {
  background: #d32f2f;
  transform: scale(1.05);
}

.no-items {
  color: var(--text-light);
  font-style: italic;
  padding: 20px;
  text-align: center;
}

.no-schedule {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

/* ========================================
   Overzichtstabel
   ======================================== */
.overview-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.summary-card {
  background: linear-gradient(135deg, var(--warning-color) 0%, #f57c00 100%);
  padding: 30px;
  border-radius: var(--border-radius);
  text-align: center;
  box-shadow: var(--box-shadow);
}

.summary-value {
  font-size: 48px;
  font-weight: 700;
  color: white;
  margin-bottom: 5px;
}

.summary-label {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
}

.overview-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  box-shadow: var(--box-shadow);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.overview-table thead {
  background: var(--primary-color);
  color: white;
}

.overview-table th {
  padding: 15px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.overview-table td {
  padding: 12px 15px;
  border-bottom: 1px solid var(--border-color);
}

.overview-table tbody tr:hover {
  background: var(--bg-secondary);
}

.overview-table .negative {
  color: var(--error-color);
  font-weight: 600;
}

.overview-table .positive {
  color: var(--success-color);
  font-weight: 600;
}

/* ========================================
   Widget styling
   ======================================== */
.dierenweide-widget {
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
}

.widget-table {
  width: 100%;
  border-collapse: collapse;
}

.widget-table tr {
  border-bottom: 1px solid var(--border-color);
}

.widget-table tr:last-child {
  border-bottom: none;
}

.widget-table tr.free-week {
  background: #fff3f5;
}

.widget-table td {
  padding: 12px;
  font-size: 14px;
}

.date-cell {
  font-weight: 500;
  color: var(--text-primary);
}

.volunteer-cell {
  text-align: right;
}

.free-indicator {
  color: var(--error-color);
  font-weight: 600;
}

.volunteer-name {
  color: var(--primary-color);
  font-weight: 500;
}

.widget-footer {
  padding: 15px;
  background: var(--bg-tertiary);
  text-align: center;
}

.view-calendar-link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.view-calendar-link:hover {
  color: var(--primary-dark);
}

/* ========================================
   Notificaties
   ======================================== */
.dierenweide-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 25px;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  font-weight: 500;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.notification-success {
  background: var(--success-color);
  color: white;
}

.notification-error {
  background: var(--error-color);
  color: white;
}

/* ========================================
   Loading states
   ======================================== */
.loading {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 16px;
}

.error {
  color: var(--error-color);
  text-align: center;
  padding: 20px;
  background: #ffebee;
  border-radius: var(--border-radius);
  border: 1px solid var(--error-color);
}

/* ========================================
   Responsive design
   ======================================== */
@media (max-width: 1024px) {
  .tab-buttons {
    grid-template-columns: repeat(3, 1fr);
  }

  .tab-button:nth-child(4n) {
    border-right: 1px solid var(--border-color);
  }

  .tab-button:nth-child(3n) {
    border-right: none;
  }
}

@media (max-width: 768px) {
  .tab-buttons {
    grid-template-columns: repeat(3, 1fr);
  }

  .tab-button {
    padding: 12px 8px;
    font-size: 12px;
  }

  .tab-content {
    padding: 15px;
  }

  td.calendar-day,
  td.calendar-day-np {
    min-height: 100px;
    height: 110px;
    padding: 6px;
  }

  td.calendar-day-head {
    padding: 12px 6px;
    font-size: 12px;
  }

  .day-number {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .vrijwilliger,
  .vrijwilliger-dag1,
  .achterwacht {
    font-size: 11px;
    padding: 6px 8px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .schedule-list {
    grid-template-columns: 1fr;
  }

  .schedule-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .dierenweide-notification {
    left: 10px;
    right: 10px;
    top: 10px;
  }
}

@media (max-width: 480px) {
  .tab-buttons {
    grid-template-columns: repeat(2, 1fr);
  }

  .tab-button:nth-child(3n) {
    border-right: 1px solid var(--border-color);
  }

  .tab-button:nth-child(2n) {
    border-right: none;
  }

  td.calendar-day-head {
    font-size: 10px;
    padding: 10px 4px;
  }

  td.calendar-day,
  td.calendar-day-np {
    min-height: 90px;
    height: 100px;
    padding: 5px;
  }

  .day-number {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }

  .vrijwilliger,
  .vrijwilliger-dag1,
  .achterwacht {
    font-size: 10px;
    padding: 5px 6px;
  }

  .stat-value {
    font-size: 32px;
  }

  .schedule-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .cancel-week-btn {
    width: 100%;
  }
}

/* ========================================
   Print styling
   ======================================== */
@media print {
  .tab-buttons,
  .vrijwilliger-dag1,
  .cancel-week-btn,
  .year-selector {
    display: none !important;
  }

  .dierenweide-wrapper {
    box-shadow: none;
  }

  td.calendar-day {
    page-break-inside: avoid;
  }
}
