/* General Wrapper - Updated */
.tpw-wrapper {
  font-family: "Arial", sans-serif;
  color: #333;
  background-color: #f8f5ed;
  padding: 20px;
  border-radius: 8px;
  width: 100%; /* Changed from max-width: 800px */
  margin: 0 auto;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  overflow-x: auto; /* Allow horizontal scroll on the entire widget if needed */
}

/* Headings */
.tpw-teacher-name,
.tpw-material-title,
.tpw-timeline-title {
  font-family: "Georgia", serif; /* Serif font for headings */
  color: #6b4e3e; /* Dark reddish-brown for headings */
}

.tpw-teacher-name {
  font-size: 2.2em;
  text-align: center;
  margin-bottom: 15px;
  border-bottom: 2px solid #d4c2b0; /* Lighter brown separator */
  padding-bottom: 10px;
}

.tpw-material-title {
  font-size: 1.6em;
  margin-top: 25px;
  margin-bottom: 10px;
  color: #6b4e3e;
}

/* Form Styling */
.tpw-form-wrapper {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px;
  background-color: #f0e9e0; /* Slightly darker beige for form area */
  border-radius: 6px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.tpw-form-wrapper form {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.tpw-form-wrapper input[type="text"] {
  padding: 10px 15px;
  border: 1px solid #d4c2b0;
  border-radius: 5px;
  font-size: 1em;
  flex-grow: 1;
  max-width: 300px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: border-color 0.2s ease-in-out;
}

.tpw-form-wrapper input[type="text"]:focus {
  border-color: #a08060;
  outline: none;
  box-shadow: 0 0 0 2px rgba(107, 78, 62, 0.2);
}

.tpw-form-wrapper button[type="submit"] {
  background-color: #6b4e3e; /* Dark reddish-brown button */
  color: #fff;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  font-size: 1em;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out, transform 0.1s ease-in-out;
}

.tpw-form-wrapper button[type="submit"]:hover {
  background-color: #5a4030; /* Slightly darker on hover */
  transform: translateY(-1px);
}

.tpw-form-wrapper button[type="submit"]:active {
  transform: translateY(0);
}

/* Teacher Info */
.tpw-teacher-region {
  text-align: center;
  font-size: 1.1em;
  margin-bottom: 20px;
  color: #555;
}

/* Material Section */
.tpw-material {
  background-color: #fff;
  border: 1px solid #e0d8ce;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 25px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.tpw-material-count {
  font-size: 0.95em;
  color: #777;
  margin-bottom: 15px;
}

/* Horizontal Timeline */
.tpw-timeline {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  padding: 40px 0;
  margin-top: 20px;
  min-width: 100%;
  width: auto; /* Allow natural width expansion */
  /* Remove overflow-x and scrollbar styles */
}

.tpw-timeline::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #d4c2b0;
  transform: translateY(-50%);
  z-index: 0;
}

.tpw-timeline-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 120px; /* Reduced minimum width */
  position: relative;
  z-index: 1;
  padding: 0 5px; /* Reduced padding */
  text-align: center;
}

.tpw-timeline-marker {
  position: relative;
  top: auto;
  left: auto;
  width: 40px;
  height: 40px;
  background-color: var(--marker-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
  color: #fff;
  z-index: 1;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  margin-bottom: 15px;
  flex-shrink: 0;
}

.tpw-timeline-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
}

.tpw-timeline-emoji {
  line-height: 1;
}

.tpw-timeline-box {
  background-color: #f0e9e0;
  border: 1px solid #d4c2b0;
  border-radius: 6px;
  padding: 12px; /* Reduced padding */
  flex-grow: 1;
  width: 100%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  white-space: normal;
  word-wrap: break-word; /* Ensure text wraps properly */
}

.tpw-timeline-title {
  font-size: 1.1em; /* Slightly smaller font */
  margin: 0;
  color: #6b4e3e;
  word-wrap: break-word;
}

.tpw-timeline-date {
  display: block;
  font-size: 0.8em; /* Smaller date font */
  color: #888;
  margin-bottom: 5px;
  word-wrap: break-word;
}

/* Timeline States - keep existing styles */
.tpw-timeline-done .tpw-timeline-box {
  background-color: #e0d8ce;
  border-color: #c0b0a0;
}

.tpw-timeline-current .tpw-timeline-marker {
  box-shadow: 0 0 0 4px rgba(33, 150, 243, 0.3);
}

.tpw-timeline-current .tpw-timeline-box {
  background-color: #fff;
  border-color: var(--marker-color);
}

.tpw-timeline-upcoming .tpw-timeline-marker {
  color: #666;
}

.tpw-timeline-upcoming .tpw-timeline-box {
  background-color: #f8f5ed;
  border-color: #e0d8ce;
  color: #999;
}

.tpw-timeline-upcoming .tpw-timeline-title {
  color: #999;
}

/* SOS Specific Styling */
.tpw-timeline-sos .tpw-timeline-marker {
  box-shadow: 0 0 0 4px rgba(244, 67, 54, 0.3);
}

.tpw-timeline-sos .tpw-timeline-box {
  background-color: #fde0dd;
  border-color: var(--marker-color);
}

.tpw-timeline-sos .tpw-timeline-title {
  color: var(--marker-color);
}

/* Responsive Adjustments - Updated */
@media (max-width: 768px) {
  .tpw-timeline {
    flex-direction: column; /* Stack vertically on mobile */
    align-items: center;
    padding: 20px 0;
  }

  .tpw-timeline::before {
    display: none; /* Hide horizontal line on mobile */
  }

  .tpw-timeline-item {
    width: 100%;
    max-width: 300px;
    margin-bottom: 20px;
    padding: 0;
  }

  .tpw-timeline-item:last-child {
    margin-bottom: 0;
  }
}

@media (max-width: 480px) {
  .tpw-timeline-item {
    max-width: 250px;
  }

  .tpw-timeline-box {
    padding: 10px;
  }

  .tpw-timeline-title {
    font-size: 1em;
  }
}

/* Confirmation Message */
.tpw-message {
  background-color: #e0d8ce; /* Light beige for messages */
  border-left: 5px solid #6b4e3e; /* Accent border */
  padding: 15px;
  margin-top: 20px;
  border-radius: 0 8px 8px 0;
  font-size: 0.95em;
  line-height: 1.5;
  color: #444;
}

/* Error/Info Messages */
.tpw-error,
.tpw-info {
  text-align: center;
  padding: 15px;
  margin-top: 20px;
  border-radius: 8px;
  font-size: 1.1em;
}

.tpw-error {
  background-color: #fde0dd;
  color: #e74c3c;
  border: 1px solid #e74c3c;
}

.tpw-info {
  background-color: #e0f7fa;
  color: #00796b;
  border: 1px solid #00796b;
}
