:root {
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --accent-color: #e74c3c;
  --background-color: #f5f6fa;
  --text-color: #2c3e50;
  --border-color: #dcdde1;
  --success-color: #2ecc71;
  --error-color: #e74c3c;
}

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

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  background-color: #f5f5f5;
  color: #333;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

h1 {
  text-align: center;
  margin-bottom: 30px;
  color: #2c3e50;
}

/* Tab Navigation */
.tabs {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
  border-bottom: 2px solid #ddd;
}

.tab-button {
  padding: 12px 24px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #666;
  position: relative;
  transition: all 0.3s ease;
}

.tab-button:hover {
  color: #2c3e50;
}

.tab-button.active {
  color: #2c3e50;
  font-weight: bold;
}

.tab-button.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: #2c3e50;
}

/* Form Styles */
.tab-content {
  display: none;
  padding: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tab-content.active {
  display: block;
}

.form-group {
  margin-bottom: 20px;
  width: 100%;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 8px 12px;
  box-sizing: border-box;
}

.form-group input {
  height: 38px;
}

.form-group textarea {
  min-height: 80px;
}

/* Button Styles */
.button-group {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
}

button {
  padding: 12px 24px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s ease;
}

.next-button,
.prev-button {
  background-color: #2c3e50;
  color: white;
}

.next-button:hover,
.prev-button:hover {
  background-color: #34495e;
}

.add-phase-button,
.add-item-button {
  background-color: #27ae60;
  color: white;
}

.add-phase-button:hover,
.add-item-button:hover {
  background-color: #219a52;
}

.submit-button {
  background-color: #e74c3c;
  color: white;
}

.submit-button:hover {
  background-color: #c0392b;
}

/* Phase and Item Styles */
.phase-item,
.item-item {
  border: 1px solid #ddd;
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 4px;
  background-color: #f9f9f9;
}

/* Responsive Design */
@media (max-width: 768px) {
  .tabs {
    flex-direction: column;
  }

  .tab-button {
    width: 100%;
    text-align: left;
    padding: 15px;
    border-bottom: 1px solid #ddd;
  }

  .button-group {
    flex-direction: column;
    gap: 10px;
  }

  button {
    width: 100%;
  }
}

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

body {
  font-family: "Roboto", sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
}

header {
  text-align: center;
  margin-bottom: 3rem;
}

.header-image {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.tooltip {
  position: absolute;
  background: var(--primary-color);
  color: white;
  padding: 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
  z-index: 1000;
}

.form-group:hover .tooltip {
  opacity: 1;
  visibility: visible;
}

.form-actions {
  text-align: center;
  margin-top: 2rem;
}

.submit-btn {
  background-color: var(--secondary-color);
  color: white;
  padding: 1rem 2rem;
  border: none;
  border-radius: 4px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.submit-btn:hover {
  background-color: #2980b9;
}

/* Dynamic sections styling */
.phase-section,
.item-section {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
}

/* Form validation styles */
input:invalid,
select:invalid,
textarea:invalid {
  border-color: var(--error-color);
}

input:valid,
select:valid,
textarea:valid {
  border-color: var(--success-color);
}

/* Loading state */
.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--secondary-color);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Microphone button styles */
.mic-button {
  position: absolute;
  right: 10px;
  top: 35px;
  background: var(--secondary-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
}

.mic-button:hover {
  background-color: #2980b9;
}

.mic-button.recording {
  background-color: var(--error-color);
  animation: pulse 1.5s infinite;
}

.mic-button i {
  font-size: 16px;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

/* Adjust textarea container for mic button */
.textarea-container {
  position: relative;
  width: 100%;
}

textarea {
  padding-right: 45px;
}

/* 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);
  overflow-y: auto;
}

.modal-content {
  background-color: #fefefe;
  margin: 5% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 800px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.close-button {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close-button:hover,
.close-button:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

/* Modal Content Styles */
#modalData {
  margin-top: 20px;
}

#modalData h3 {
  color: #333;
  margin-top: 20px;
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 2px solid #eee;
}

#modalData p {
  margin: 8px 0;
  line-height: 1.5;
}

.phase-summary,
.item-summary {
  background-color: #f8f9fa;
  padding: 15px;
  margin: 10px 0;
  border-radius: 4px;
  border-left: 4px solid #007bff;
}

.phase-summary p,
.item-summary p {
  margin: 5px 0;
}

/* Responsive Modal */
@media screen and (max-width: 768px) {
  .modal-content {
    width: 95%;
    margin: 10% auto;
  }
}

.form-row {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-bottom: 15px;
}

.half-width {
  width: 100%;
  margin-bottom: 15px;
}

.half-width:last-child {
  margin-bottom: 0;
}

.half-width label {
  margin-bottom: 8px;
  height: 20px;
  line-height: 20px;
}

.half-width input {
  width: 100%;
  padding: 8px 12px;
  height: 38px;
  box-sizing: border-box;
}

/* Adjust the Notes textarea to have consistent spacing */
.item-item {
  width: 100%;
  margin-bottom: 20px;
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.item-item .form-group:last-child {
  margin-top: 15px;
  width: 100%;
}

.item-item .form-group:last-child textarea {
  min-height: 80px;
  width: 100%;
  box-sizing: border-box;
}

/* Ensure new items maintain the same layout */
#items-container .item-item {
  display: flex;
  flex-direction: column;
}

#items-container .item-item .form-row {
  display: flex;
  flex-direction: column;
  width: 100%;
}

#items-container .item-item .form-row .half-width {
  width: 100%;
}
