body {
  font-family: Arial, Helvetica, sans-serif;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
}

#app {
  max-width: 800px;
  width: 100%;
  padding: 20px;
  box-sizing: border-box;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid #eee;
  margin-bottom: 24px;
}

h1 {
  margin: 0;
}

main {
  text-align: left;
}

ul {
  list-style-type: none;
  padding: 0;
}

li {
  margin-bottom: 10px;
}

#calendarSelect {
  flex-grow: 1;
}

#sourceList {
  list-style-type: none;
  padding: 0;
}

#sourceList li {
  /* Remove or comment out these styles as they're conflicting */
  /*
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
  */
}

.source-item {
  padding: 25px;  /* Increased padding */
  margin: 20px 0;  /* Increased margin */
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  box-sizing: border-box;
}

.source-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.source-main {
  display: flex;
  align-items: center;
  gap: 15px;
  justify-content: flex-start;
  width: 100%;
}

.source-name {
  font-weight: 500;
  color: #2c5282;
  text-decoration: none;
  flex-grow: 1;
}

.source-name:hover {
  text-decoration: underline;
}

.source-details {
  font-size: 0.9em;
  color: #666;
  margin-top: 8px;
}

.source-detail-line {
  margin: 4px 0;
}

.detail-label {
  font-weight: 500;
  color: #555;
  margin-right: 6px;
}

.last-pulled, .last-event {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.delete-icon {
  cursor: pointer;
  color: #e53e3e;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.delete-icon:hover {
  background-color: #fed7d7;
}

.disabled {
  opacity: 0.6;
}

.calendar-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

#newCalendarButton {
  white-space: nowrap;
}

/* Add these styles for the header */
.site-header {
  padding: 20px 0;
}

.site-title {
  color: #333;
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: bold;
}

.site-title:hover {
  text-decoration: none;
  color: #666;
}

.calendar-detail {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.form-group textarea {
  height: 100px;
  resize: vertical;
}

.sources-section {
  margin-top: 40px;
}

#calendarForm {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 30px;
}

#calendarForm button {
  margin-top: 10px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.help-text {
  font-size: 0.9em;
  color: #666;
  margin-top: 4px;
  margin-left: 24px;
}

/* Toggle switch styles */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 24px;
  margin-right: 10px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: #2196F3;
}

input:checked + .toggle-slider:before {
  transform: translateX(16px);
}

.source-item.disabled {
  opacity: 0.6;
}

.calendar-settings-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  padding-right: 40px;
}

.calendar-settings-form input {
  margin-right: 20px;
}

/* Add more spacing in the add source form */
#addSourceForm {
  margin-bottom: 30px;
  display: flex;
  gap: 10px;
}

#sourceUrlInput {
  flex-grow: 1;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

/* Add these styles */
.hidden {
  display: none !important;
}

.submit-button {
  position: relative;
  min-width: 80px;  /* Prevent button size changes during loading */
}

.button-loading {
  color: #666;
}

/* Optional: Add a disabled state style */
button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

input:disabled {
  background-color: #f5f5f5;
  cursor: not-allowed;
}

/* Loading state styles */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: #666;
}

.spinner {
  width: 40px;
  height: 40px;
  margin-bottom: 16px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-spinner p {
  margin: 0;
  font-size: 16px;
}

/* Add this to your existing calendar-detail styles */
.calendar-detail.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
  background: #f8f9fa;
  border-radius: 8px;
}

/* Add these to your existing loading state styles */

.error-message {
  text-align: center;
  padding: 20px;
  color: #e53e3e;
  background: #fff5f5;
  border: 1px solid #feb2b2;
  border-radius: 8px;
  margin: 20px 0;
}

/* Adjust the loading spinner for the events list */
#eventList .loading-spinner {
  min-height: 150px;  /* Smaller height for the events list */
  background: #f8f9fa;
  border-radius: 8px;
  margin: 20px 0;
}

/* Initial app loading state */
#app > .loading-spinner {
  min-height: 100vh;
  background: #fff;
}

.feed-links {
  margin-top: 10px;
  margin-left: 24px;
  display: flex;
  gap: 8px;
}

.feed-pill {
  display: inline-block;
  padding: 4px 12px;
  background-color: #e2e8f0;
  color: #4a5568;
  text-decoration: none;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.2s;
}

.feed-pill:hover {
  background-color: #cbd5e0;
}

/* Add styles for the no-events message */
.no-events-message {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  background: #f8f9fa;
  border-radius: 8px;
  margin: 20px 0;
}

.no-events-message p {
  margin: 0;
  font-size: 16px;
}

.back-button {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  color: #666;
  text-decoration: none;
  font-size: 16px;
  transition: color 0.2s;
}

.back-button:hover {
  color: #333;
}

/* Add this to your loading state styles section */
#sourceList .loading-spinner {
  min-height: 150px;  /* Smaller height for the sources list */
  background: #f8f9fa;
  border-radius: 8px;
  margin: 20px 0;
  padding: 20px;
}

#sourceList .loading-spinner p {
  color: #666;
}
