:root {
  --primary-color: #4a90e2;
  --secondary-color: #f5f5f5;
  --text-color: #333;
  --bg-color: #ffffff;
  --border-color: #ddd;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

body.dark-mode {
  --primary-color: #64b5f6;
  --secondary-color: #424242;
  --text-color: #f0f0f0;
  --bg-color: #1a1a1a;
  --border-color: #444;
  --shadow: 0 2px 10px rgba(255, 255, 255, 0.1);
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--bg-color) 0%, var(--secondary-color) 100%);
  color: var(--text-color);
}

#app-container {
  width: 100%;
  max-width: 400px;
  padding: 20px;
  position: relative;
}

#app-title {
  text-align: center;
  color: var(--primary-color);
  font-size: 2.5em;
  margin-bottom: 30px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

#auth-page, #note-page {
  background: var(--bg-color);
  padding: 30px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

#auth-page:hover, #note-page:hover {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

h2, h3 {
  margin-top: 0;
  color: var(--primary-color);
  text-align: center;
}

textarea, input:not([type="checkbox"]) {
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 16px;
  transition: var(--transition);
  box-sizing: border-box;
  background-color: var(--bg-color);
  color: var(--text-color);
}

textarea:focus, input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

#note-content {
  height: 120px;
  resize: vertical;
}

button {
  display: block;
  width: 100%;
  padding: 12px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 15px;
  font-size: 16px;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 1px;
}

button:hover {
  background-color: #3a7bc8;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

button:active {
  transform: translateY(0);
  box-shadow: none;
}

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

#note-list li {
  background-color: var(--bg-color);
  margin: 10px 0;
  padding: 15px;
  border-radius: 6px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}

#note-list li:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.note-actions button {
  width: auto;
  padding: 8px 12px;
  margin-left: 10px;
  font-size: 14px;
}

#auth-page {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

#auth-page form {
  display: flex;
  flex-direction: column;
}

#note-page {
  display: none;
}

#logout {
  background-color: #e74c3c;
}

#logout:hover {
  background-color: #c0392b;
}

.edit-note {
  background-color: #f39c12;
}

.edit-note:hover {
  background-color: #d35400;
}

.delete-note {
  background-color: #e74c3c;
}

.delete-note:hover {
  background-color: #c0392b;
}

#char-count {
  text-align: right;
  margin-bottom: 10px;
  font-size: 0.9em;
  color: #666;
  transition: var(--transition);
}

.note-content {
  word-break: break-word;
  line-height: 1.5;
}

#search-notes {
  margin-bottom: 15px;
}

@media (max-width: 480px) {
  #app-container {
    padding: 10px;
  }

  #auth-page, #note-page {
    padding: 20px;
  }

  #app-title {
    font-size: 2em;
  }
}

/* Modern scrollbar for textarea */
textarea::-webkit-scrollbar {
  width: 8px;
}

textarea::-webkit-scrollbar-track {
  background: var(--secondary-color);
  border-radius: 4px;
}

textarea::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

textarea::-webkit-scrollbar-thumb:hover {
  background: #3a7bc8;
}

#theme-toggle-wrapper {
  position: absolute;
  top: 20px;
  right: 20px;
}

.theme-toggle {
  opacity: 0;
  position: absolute;
}

.theme-toggle-label {
  background: linear-gradient(to bottom, #4a607c, #1a252f);
  border-radius: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px;
  position: relative;
  height: 16.5px;
  width: 41px;
}

.theme-toggle-label .fa-moon {
  color: #f1c40f;
  font-size: 14px;
}

.theme-toggle-label .fa-sun {
  color: #f39c12;
  font-size: 14px;
}

.theme-toggle-label .ball {
  background: linear-gradient(to bottom, #b5bcf5, #e0e0e0);
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  height: 22px;
  width: 22px;
  transform: translateX(0px);
  transition: transform 0.2s linear;
}

.theme-toggle:checked + .theme-toggle-label {
  background: linear-gradient(to bottom, #569dda, #3476b9);
}

.theme-toggle:checked + .theme-toggle-label .ball {
  transform: translateX(24px);
}