/* Base styles and variables */
:root {
  --primary-color: #2196F3;
  --primary-dark: #1976D2;
  --primary-light: #BBDEFB;
  --accent-color: #FF4081;
  --text-primary: #212121;
  --text-secondary: #757575;
  --divider-color: #BDBDBD;
  --background-color: #f5f5f5;
  --card-color: #ffffff;
  --sidebar-width: 300px;
  --header-height: 60px;
  --border-radius: 8px;
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: var(--background-color);
  color: var(--text-primary);
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar styling */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--card-color);
  border-right: 1px solid var(--divider-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: var(--transition);
}

.sidebar-header {
  padding: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--divider-color);
}

.sidebar-header h1 {
  font-size: 22px;
  font-weight: 600;
  color: var(--primary-color);
}

.action-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  height: 40px;
  width: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.action-btn:hover {
  background-color: var(--primary-light);
  color: var(--primary-dark);
}

.search-container {
  padding: 10px 15px;
  border-bottom: 1px solid var(--divider-color);
}

.search-container input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--divider-color);
  border-radius: var(--border-radius);
  outline: none;
  font-size: 14px;
}

.search-container input:focus {
  border-color: var(--primary-color);
}

.notes-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.note-item {
  padding: 15px;
  margin-bottom: 10px;
  background-color: var(--card-color);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow);
  border-left: 3px solid transparent;
  position: relative;
}

.note-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.note-item.active {
  border-left-color: var(--primary-color);
  background-color: var(--primary-light);
}

.note-item.favorite .note-star {
  color: gold;
}

.note-title {
  font-weight: 600;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note-preview {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note-date {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 5px;
}

.note-star {
  position: absolute;
  top: 15px;
  right: 15px;
  color: var(--text-secondary);
  cursor: pointer;
}

/* Main content area */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: var(--card-color);
}

.note-toolbar {
  display: flex;
  justify-content: space-between;
  padding: 15px 20px;
  background-color: var(--card-color);
  border-bottom: 1px solid var(--divider-color);
}

.left-tools, .right-tools {
  display: flex;
  align-items: center;
  gap: 15px;
}

#last-edited {
  font-size: 12px;
  color: var(--text-secondary);
}

.tool-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  height: 36px;
  width: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.tool-btn:hover {
  background-color: var(--primary-light);
  color: var(--primary-dark);
}

.tool-btn.active {
  color: var(--primary-color);
  background-color: var(--primary-light);
}

.note-editor {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
  overflow-y: auto;
}

#note-title {
  font-size: 24px;
  font-weight: 600;
  padding: 10px 0;
  margin-bottom: 15px;
  border: none;
  border-bottom: 1px solid var(--divider-color);
  outline: none;
  background: transparent;
  width: 100%;
}

.editor-container {
  flex: 1;
  position: relative;
}

#note-content {
  width: 100%;
  height: 100%;
  padding: 15px 0;
  border: none;
  outline: none;
  resize: none;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: transparent;
}

.preview-content {
  width: 100%;
  height: 100%;
  padding: 15px 0;
  overflow-y: auto;
  line-height: 1.6;
}

.preview-content h1, .preview-content h2, .preview-content h3 {
  margin: 1em 0 0.5em;
}

.preview-content p {
  margin-bottom: 1em;
}

.preview-content ul, .preview-content ol {
  margin-left: 20px;
  margin-bottom: 1em;
}

.preview-content a {
  color: var(--primary-color);
  text-decoration: none;
}

.preview-content a:hover {
  text-decoration: underline;
}

.preview-content blockquote {
  border-left: 4px solid var(--primary-light);
  padding-left: 15px;
  color: var(--text-secondary);
  margin: 1em 0;
}

.preview-content pre {
  background-color: #f1f1f1;
  padding: 15px;
  border-radius: var(--border-radius);
  overflow-x: auto;
}

.preview-content code {
  font-family: monospace;
  background-color: #f1f1f1;
  padding: 2px 4px;
  border-radius: 3px;
}

/* Dropdown */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  top: 40px;
  min-width: 160px;
  background-color: var(--card-color);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  border-radius: var(--border-radius);
  z-index: 10;
}

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

.dropdown-content a {
  color: var(--text-primary);
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  transition: var(--transition);
}

.dropdown-content a:hover {
  background-color: var(--primary-light);
  color: var(--primary-dark);
}

/* Welcome screen */
.welcome-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(33, 150, 243, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.welcome-content {
  background-color: white;
  border-radius: var(--border-radius);
  padding: 40px;
  text-align: center;
  max-width: 80%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.welcome-content h2 {
  color: var(--primary-color);
  margin-bottom: 20px;
  font-size: 28px;
}

.welcome-content p {
  margin-bottom: 30px;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.6;
}

.features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-bottom: 30px;
}

.feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 120px;
}

.feature i {
  font-size: 24px;
  color: var(--primary-color);
  margin-bottom: 10px;
}

#get-started-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition);
}

#get-started-btn:hover {
  background-color: var(--primary-dark);
}

/* Color palette */
.color-palette {
  display: flex;
  justify-content: center;
  gap: 15px;
  padding: 15px;
  border-top: 1px solid var(--divider-color);
}

.color-option {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--divider-color);
  transition: var(--transition);
}

.color-option:hover, .color-option.selected {
  transform: scale(1.2);
  border-color: var(--primary-color);
}

/* Modal styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: var(--border-radius);
  max-width: 90%;
  width: 400px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.modal-content h3 {
  margin-bottom: 15px;
  color: var(--text-primary);
}

.modal-content p {
  margin-bottom: 20px;
  color: var(--text-secondary);
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-buttons button {
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
}

#cancel-delete-btn {
  background: none;
  border: 1px solid var(--divider-color);
  color: var(--text-secondary);
}

#cancel-delete-btn:hover {
  background-color: var(--background-color);
}

#confirm-delete-btn {
  background-color: #f44336;
  color: white;
  border: none;
}

#confirm-delete-btn:hover {
  background-color: #d32f2f;
}

/* Toast notifications */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

.toast {
  background-color: var(--card-color);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: var(--border-radius);
  margin-top: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  animation: slideIn 0.3s, fadeOut 0.5s 2.5s forwards;
  max-width: 300px;
}

.toast.success {
  border-left: 4px solid #4CAF50;
}

.toast.error {
  border-left: 4px solid #F44336;
}

.toast.info {
  border-left: 4px solid var(--primary-color);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* Utility classes */
.hidden {
  display: none !important;
}

/* Responsive design */
@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--divider-color);
    max-height: 40vh;
  }
  
  .main-content {
    height: 60vh;
  }
  
  .welcome-content {
    padding: 20px;
    max-width: 95%;
  }
  
  .features {
    gap: 10px;
  }
  
  .feature {
    width: 80px;
  }
}

@media (max-width: 480px) {
  .note-toolbar {
    padding: 10px;
  }
  
  .tool-btn {
    height: 32px;
    width: 32px;
  }
  
  #note-title {
    font-size: 20px;
  }
  
  .modal-content {
    padding: 20px;
  }
}

