/* Basic reset and typography */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f9fafb;
  color: #333;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 2200px;
  margin: 20px auto;
  padding: 15px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.1);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-section {
  grid-column: 1;
  padding: 25px;
  border: 2px solid #e0e7ff;
  border-radius: 12px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  position: relative;
  overflow: hidden;
}

.form-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6, #06b6d4);
}

.form-section h2 {
  color: #1e40af;
  font-size: 1.5rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.form-section h2 i {
  color: #3b82f6;
  font-size: 1.8rem;
}

.entries-section {
  grid-column: 2;
  padding: 20px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  max-height: 600px;
  overflow-y: auto;
}

h1 {
  text-align: center;
  color: #1e40af;
  font-weight: 700;
  margin-bottom: 20px;
  font-size: 2.5rem;
}

.top-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 15px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  /* Removed flex-wrap to keep in one line */
  gap: 10px;
}

.nav-buttons {
  display: flex;
  gap: 10px;
}

.nav-buttons .btn {
  background: #059669;
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background-color 0.3s ease;
}

.nav-buttons .btn:hover {
  background: #047857;
}

.week-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  /* Removed flex-wrap to keep in one line */
}

.filter-form {
  display: flex;
  align-items: center;
  gap: 10px;
  /* Removed flex-wrap to keep in one line */
}

.filter-form label {
  font-weight: 600;
  color: #374151;
  margin: 0;
}

.filter-form input[type="date"] {
  padding: 6px 6px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 0.9rem;
}

.filter-btn {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: left;
  gap: 4px;
}

.filter-btn:hover {
  background: #2563eb;
}

.reset-btn {
  background: #6b7280;
  color: white;
  padding: 6px 12px;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background-color 0.3s ease;
}

.reset-btn:hover {
  background: #4b5563;
}

h1 i {
  margin-right: 10px;
  color: #2563eb;
}

h2 {
  color: #2563eb;
  margin-bottom: 15px;
  font-weight: 600;
  border-bottom: 2px solid #93c5fd;
  padding-bottom: 5px;
}

.form-section, .print-section {
  margin-bottom: 30px;
}

.form-group {
  margin-bottom: 20px;
  position: relative;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #374151;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

label i {
  color: #3b82f6;
  margin-right: 8px;
  font-size: 1rem;
  transition: color 0.3s ease;
}

label:hover i {
  color: #1d4ed8;
}

input[type="date"],
select,
textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 1rem;
  background: #ffffff;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

input[type="date"]:focus,
select:focus,
textarea:focus {
  border-color: #3b82f6;
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background: #fefefe;
}

textarea {
  min-height: 80px;
  resize: vertical;
  line-height: 1.5;
}

select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 40px;
  cursor: pointer;
}

button {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
  position: relative;
  overflow: hidden;
}

button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

button:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

button:hover::before {
  left: 100%;
}

button:active {
  transform: translateY(0);
}

.entries-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.entry-card {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 15px;
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.05);
}

.entry-card h3 {
  margin-top: 0;
  color: #1e40af;
  font-weight: 700;
}

.entry-card p {
  margin: 5px 0;
  line-height: 1.3;
}

.actions {
  margin-top: 10px;
  display: flex;
  gap: 10px;
}

.actions a.btn {
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  transition: background-color 0.3s ease;
}

.actions a.edit {
  background-color: #2563eb;
  color: white;
}

.actions a.edit:hover {
  background-color: #1e40af;
}

.actions a.delete {
  background-color: #dc2626;
  color: white;
}

.actions a.delete:hover {
  background-color: #b91c1c;
}

.print-section {
  text-align: center;
  grid-column: 1 / -1;
  margin-top: 20px;
}

.print-section a.print {
  background-color: #16a34a;
  color: white;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.3s ease;
}

.print-section a.print:hover {
  background-color: #15803d;
}

/* Checkbox styling */
.form-group label:has(input[type="checkbox"]) {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-weight: normal;
  font-size: 0.9rem;
  color: #6b7280;
  cursor: pointer;
}

/* Reduce spacing between checkboxes inside collapsible content */
.collapsible-content label {
  margin-bottom: 4px !important;
  gap: 4px !important;
  font-size: 0.85rem;
  color: #4b5563;
  display: flex !important;
  align-items: center;
  cursor: pointer;
}

.collapsible-content {
  padding: 6px 8px !important;
}

.form-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #3b82f6;
  cursor: pointer;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.modal-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 0;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 12px 12px 0 0;
}

.modal-header h3 {
  margin: 0;
  color: #1f2937;
  font-size: 1.25rem;
  font-weight: 600;
}

.modal-header .close {
  color: #6b7280;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s ease;
}

.modal-header .close:hover {
  color: #374151;
}

.modal-body {
  padding: 24px;
}

.modal-body p {
  margin: 0 0 16px 0;
  color: #374151;
  line-height: 1.5;
}

.entry-details {
  background: #f9fafb;
  padding: 16px;
  border-radius: 8px;
  margin: 16px 0;
  border-left: 4px solid #3b82f6;
}

.entry-details p {
  margin: 8px 0;
  font-size: 0.9rem;
}

.warning-text {
  color: #dc2626 !important;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-footer {
  padding: 16px 24px 24px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: #f9fafb;
  border-radius: 0 0 12px 12px;
}

.cancel-btn {
  background: #6b7280;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.cancel-btn:hover {
  background: #4b5563;
}

.delete-btn {
  background: #dc2626;
  color: white;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.2s ease;
}

.delete-btn:hover {
  background: #b91c1c;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    margin: 10px;
    padding: 10px;
    max-width: none;
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .form-section, .entries-section {
    grid-column: 1;
    padding: 15px;
  }

  .entries-section {
    max-height: 400px;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  .top-navigation {
    flex-direction: column;
    gap: 20px;
    align-items: stretch;
  }

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

  .week-filter {
    justify-content: center;
  }

  .filter-form {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .filter-form label {
    text-align: center;
  }

  button, .actions a.btn {
    font-size: 0.9rem;
    padding: 8px 14px;
  }

  input[type="date"], select, textarea {
    font-size: 0.9rem;
    padding: 10px 12px;
  }

  .modal-content {
    width: 95%;
    max-width: none;
    margin: 5% auto;
  }

  .modal-header, .modal-body, .modal-footer {
    padding: 15px;
  }

  .entry-card {
    padding: 12px;
  }

  .manual-textarea {
    min-height: 50px;
  }
}

@media (max-width: 480px) {
  .container {
    margin: 5px;
    padding: 5px;
    gap: 10px;
  }

  .form-section, .entries-section {
    padding: 10px;
  }

  .entries-section {
    max-height: 300px;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.1rem;
  }

  .top-navigation {
    gap: 10px;
  }

  .nav-buttons .btn {
    font-size: 0.8rem;
    padding: 6px 10px;
  }

  .filter-btn, .reset-btn {
    font-size: 0.8rem;
    padding: 6px 10px;
  }

  button {
    font-size: 0.85rem;
    padding: 10px 16px;
  }

  .actions a.btn {
    font-size: 0.8rem;
    padding: 6px 10px;
  }

  input[type="date"], select, textarea {
    font-size: 0.85rem;
    padding: 8px 10px;
  }

  label {
    font-size: 0.9rem;
  }

  .entry-card h3 {
    font-size: 0.9rem;
  }

  .entry-card p {
    font-size: 0.85rem;
  }

  .modal-content {
    width: 98%;
    margin: 2% auto;
  }

  .modal-header h3 {
    font-size: 1.1rem;
  }

  .modal-body p {
    font-size: 0.9rem;
  }

  .toast {
    max-width: 90%;
    font-size: 12px;
    padding: 12px;
  }

  .collapsible-header {
    padding: 6px 10px;
    font-size: 0.9rem;
  }

  .collapsible-content {
    padding: 8px;
  }

  .manual-textarea {
    min-height: 40px;
  }

  .add-manual-btn, .remove-manual-btn {
    padding: 6px 8px;
    font-size: 0.8rem;
  }
}
