/* style.css */
:root {
  --accent-rgb: 29, 120, 29; /* RGB value for the accent color (green) */
}

body.mobile-first {
  background: var(--bg);
  min-height: 100vh;
}

h3 {
  margin: 0;
}
input[type="range"] {
  width: 100%;
  height: 3px;
}

#app-root {
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  /* padding: 1rem; */
}

.rounded-rect {
  border-radius: 1.2em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  background: var(--bg);
  margin-bottom: 1rem;
  padding: 1rem;
}

.fab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  font-size: 2rem;
  position: fixed;
  bottom: 2rem;
  right: 1em;
  /* transform: translateX(-50%); */
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  z-index: 100;
}

/* Editable Titles */
.editable-title {
  cursor: pointer;
  position: relative;
  padding: 0.2em 0.5em;
  margin-left: -0.5em;
  border-radius: 0.3em;
}

.editable-title:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.editable-title:hover::after {
  content: "✏️";
  font-size: 0.8em;
  margin-left: 0.5em;
  opacity: 0.7;
}

.editable-title.editing {
  background-color: var(--bg);
  border: 1px solid var(--border);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  outline: none;
}

/* Project list */
.project-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 1.2em;
  /* box-shadow: 0 2px 8px var(--border); */
  box-shadow: 0 5px 20px -15px var(--border);
  background: var(--bg);
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
}

.project-name {
  flex: 1;
  cursor: pointer;
}

/* Project section */
.project-section {
  position: relative;
  min-height: 80vh;
  padding: 0;
  padding-bottom: 10em !important;
}

.project-controls {
  border-radius: 1.2em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  background: var(--bg);
  margin-bottom: 2em;
  padding: 0.8em;
}

.project-controls h3 {
  margin-top: 0;
}

.note {
  font-size: 0.9em;
  margin-top: 0.5em;
}

/* Layer items */
.layer-item-outer {
  position: relative;
  margin-bottom: 1em;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.layer-item {
  position: relative;
  display: flex;
  gap: 0;
  width: 100%;
  box-shadow: 0 5px 20px -15px var(--border);
  background: var(--bg);
  margin-top: 3em;
  cursor: pointer;
  flex: 1;
}

.layer-item-actions {
  display: flex;
  flex-direction: row;
  gap: 1em;
  margin-top: 1em;
}

.layer-action-btn {
  background: none;
  border: none;
  color: var(--accent);
  margin: 0;
  font-size: 1rem;
  height: 3rem;
  width: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--accent);
  cursor: pointer;
  transition: all 0.2s ease;
}

.layer-action-btn.filled {
  background-color: var(--accent);
  color: var(--bg);
}

.layer-action-btn:disabled {
  opacity: 0.8;
  cursor: not-allowed;
  border: 1px solid var(--border);
}

.delete-btn {
  position: absolute;
  top: -1.5em;
  right: -0.2em;
  z-index: 10;
}

.layer-action-btn:hover {
  background-color: var(--accent);
  color: var(--bg);
}

.layer-item-wrapper {
  display: flex;
  flex-direction: row;
  width: 100%;
  overflow: hidden;
  border-radius: 1em;
  border: 1px solid var(--border);
}

.layer-buttons {
  display: flex;
  flex-direction: column;
  width: 25%;
}
.layer-buttons button {
  height: 100%;
  margin: 0;
  border-radius: 0;
  border: none;
  border-right: 1px solid var(--border);
}
.layer-buttons button:first-child {
  border-bottom: 1px solid var(--border);
}
.layer-details {
  padding: 1em;
  width: 100%;
  position: relative;
}

.layer-waveforms-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  pointer-events: none;
  display: flex;
  flex-direction: column;
}

.layer-waveform-segment {
  position: relative;
  height: 50%;
}

.layer-waveform {
  height: 50%;
  opacity: 0.5;
  padding: 1em 2px;
  position: relative;
}

.waveform-label {
  position: absolute;
  left: 0;
  /* top: 45%; */
  font-size: 0.45rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 5px;
  border-radius: 2px;
  /* background-color: rgba(255, 255, 255, 0.7); */
  mix-blend-mode: overlay;
  pointer-events: none; /* Ensure labels don't interfere with clicks */
  color: var(--accent);
  opacity: 0.7;
}

.layer-waveform-segment:nth-child(1) .waveform-label {
  top: 20%;
}

.layer-waveform-segment:nth-child(2) .waveform-label {
  top: 60%;
}

.layer-hum-waveform .waveform-label {
  color: var(--accent);
  opacity: 0.9;
}

.layer-ai-waveform .waveform-label {
  color: #2c5282; /* A slightly different blue shade that complements the accent green */
  opacity: 0.9;
}

.layer-details-upper,
.layer-details > div:last-child {
  position: relative;
  z-index: 2;
}

.layer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.layer-status {
  margin-top: 0.5em;
  font-size: 0.9em;
  color: var(--text-light);
}

.layer-volume-control {
  padding: 0.5em 0;
}

.new-layer-form {
  margin-top: 2em;
  display: flex;
  gap: 0.5em;
}

/* Drawer */
.drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
}

.drawer-body {
  background: var(--accent-bg);
  border-radius: 1.2em 1.2em 0 0;
  overflow: hidden;
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.08);
  max-width: 600px;
  margin: 0 auto;
}

.drawer-content {
  padding: 1.5em 1em 2em 1em;
  height: 50vh;
  overflow-y: auto;
}

.drawer-header {
  padding: 1em;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.close-btn {
  font-size: 1.5em;
  background: none;
  border: none;
  color: var(--text-light);
  padding: 0.2em 0.5em;
  cursor: pointer;
}

.control-group {
  margin-top: 0.5em;
  display: flex;
  /* flex-direction: column; */
  gap: 0.5em;
}

.control-group label {
  margin-right: 1em;
}

/* Section divider */
.section-divider {
  margin-top: 1.5em;
  border-top: 1px solid var(--border);
  padding-top: 1em;
}

/* Audio processing options */
.processing-option {
  margin-top: 0.8em;
  margin-bottom: 1.2em;
}

.checkbox-label {
  display: flex;
  align-items: center;
  margin-bottom: 0.5em;
}

.checkbox-label span {
  margin-left: 0.5em;
}

.help-text {
  color: var(--text-light);
  display: block;
  margin-top: 0.3em;
  margin-bottom: 0.8em;
  font-size: 0.85em;
}

/* Waveform */
.waveform-section {
  margin-top: 1.5em;
  display: flex;
}
.waveform-controls {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.waveform-controls button {
  margin: 0;
  border-radius: 0;
  border: none;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.5em;
  font-size: 0.85em;
  color: var(--text-light);
  background: var(--accent-bg);
  cursor: pointer;
  transition: all 0.2s ease;
  height: 100%;
}

.waveform-container {
  width: 100%;
  /* display: flex;
  flex-direction: column;
  gap: 0.5em; */
}

.waveform {
  height: 48px;
  width: 100%;
  margin-bottom: 0.5em;
}

/* AI section */
.prompt-suggestions {
  margin-top: 0.5em;
  font-size: 0.85em;
}

.tag-button {
  background: var(--accent-bg);
  padding: 2px 8px;
  border-radius: 12px;
  margin: 0 2px;
  border: 1px solid var(--border);
  cursor: pointer;
}

.advanced-settings {
  font-size: 0.9em;
  padding: 0.7rem 0;
  border: none;
}

.advanced-settings summary {
  cursor: pointer;
  color: var(--accent);
}

.settings-content {
  padding-left: 1em;
}

.range-control {
  margin-bottom: 0.8em;
}

.range-control input[type="range"] {
  width: 100%;
}

.ai-buttons {
  margin-top: 0.5em;
}

.ai-buttons button {
  margin-right: 0.5em;
}

/* Button styles */
.primary-btn {
  background: var(--accent);
  color: var(--bg);
  padding: 0.6em 1.2em;
}

.secondary-btn {
  background: var(--accent);
  color: var(--bg);
  padding: 0.6em 1.2em;
  margin-left: 0.5em;
  font-size: 0.85em;
}

.loading-btn {
  background: var(--accent);
  color: var(--bg);
  padding: 0.6em 1.2em;
  opacity: 0.7;
}

.error-btn {
  background: var(--accent);
  color: var(--bg);
  padding: 0.6em 1.2em;
}

.error-message {
  margin-top: 1em;
  color: var(--accent);
  font-size: 0.9em;
}

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

.loading-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--bg);
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
}

/* Toggle Buttons */
.toggle-button {
  background-color: var(--accent-bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9em;
}

.toggle-button.active {
  background-color: var(--accent);
  color: var(--bg);
}

.toggle-button-group {
  display: flex;
  margin-bottom: 0.8em;
}

.toggle-button-group .toggle-button {
  border-radius: 0;
  border-right: none;
}

.toggle-button-group .toggle-button:first-child {
  border-radius: 6px 0 0 6px;
}

.toggle-button-group .toggle-button:last-child {
  border-radius: 0 6px 6px 0;
  border-right: 1px solid var(--border);
}

/* Authentication Styles */
.auth-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  background: var(--bg);
}

.auth-card {
  background: var(--accent-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-header h1 {
  margin: 0 0 0.5rem 0;
  color: var(--text);
}

.auth-header p {
  margin: 0;
  color: var(--text-light);
  font-size: 0.9rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 600;
  color: var(--text);
  font-size: 0.9rem;
}

.form-group input {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(29, 120, 29, 0.2);
}

.auth-button {
  background: var(--accent);
  color: var(--bg);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.auth-button:hover {
  background: var(--accent-hover, #166616);
  transform: translateY(-1px);
}

.auth-button:disabled {
  background: var(--text-light);
  cursor: not-allowed;
  transform: none;
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
  color: var(--text-light);
  font-size: 0.9rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-divider::before {
  margin-right: 1rem;
}

.auth-divider::after {
  margin-left: 1rem;
}

.oauth-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.oauth-button {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.oauth-button:hover {
  background: var(--accent-bg);
  border-color: var(--accent);
}

.auth-links {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9rem;
}

.auth-links a {
  color: var(--accent);
  text-decoration: none;
}

.auth-links a:hover {
  text-decoration: underline;
}

.auth-error {
  background: #fee;
  color: #c33;
  padding: 0.75rem;
  border-radius: 4px;
  border: 1px solid #fcc;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.auth-success {
  background: #efe;
  color: #363;
  padding: 0.75rem;
  border-radius: 4px;
  border: 1px solid #cfc;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.user-menu {
  position: relative;
  display: inline-block;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  min-width: 200px;
  z-index: 1000;
  margin-top: 0.5rem;
}

.user-dropdown-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 0.9rem;
}

.user-dropdown-item:last-child {
  border-bottom: none;
}

.user-dropdown-item:hover {
  background: var(--accent-bg);
}

.user-dropdown-item.danger {
  color: #c33;
}

.user-dropdown-item.danger:hover {
  background: #fee;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.app-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.auth-modal-content {
  background: var(--bg);
  border-radius: 8px;
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
}

.auth-modal-header {
  padding: 1.5rem 1.5rem 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.auth-modal-title {
  margin: 0;
  font-size: 1.25rem;
  color: var(--text);
}

.auth-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.auth-modal-close:hover {
  background: var(--accent-bg);
}

.auth-modal-body {
  padding: 1.5rem;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .auth-card {
    padding: 1.5rem;
    margin: 1rem;
  }
  
  .auth-modal-content {
    margin: 0.5rem;
  }
  
  .auth-modal-body {
    padding: 1rem;
  }
}
