:root{
  --primary: #64b5f6;
  --primary-dark: #2b8fd6;
  --primary-light: #bfe9ff;
  --secondary: #03dac6;
  --background: #f5f5f5;
  --surface: #ffffff;
  --error: #b00020;
  --on-primary: #ffffff;
  --on-secondary: #000000;
  --on-background: #000000;
  --on-surface: #000000;
  --on-error: #ffffff;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  height: 100%;
  font-family: 'Roboto', 'Noto Sans SC', system-ui, -apple-system, sans-serif;
  background-color: var(--background);
  color: var(--on-background);
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
}

.app-bar {
  background-color: var(--primary);
  color: var(--on-primary);
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  z-index: 10;
}

.app-bar h1 {
  font-size: 20px;
  font-weight: 500;
}

.main-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.sidebar {
  width: 300px;
  background-color: var(--surface);
  box-shadow: 1px 0 3px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition: var(--transition);
  z-index: 5;
}

@media (max-width: 768px) {
  .sidebar {
    position: absolute;
    height: calc(100% - 56px);
    top: 56px;
    left: 0;
    transform: translateX(-100%);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .overlay {
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 4;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
  }
  
  .overlay.active {
    opacity: 1;
    pointer-events: all;
  }
}

.sidebar-header {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.sidebar-header strong {
  font-size: 16px;
  font-weight: 500;
}

.notebooks-list {
  flex: 1;
  overflow-y: auto;
}

.notebook {
  padding: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.notebook::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background-color: var(--primary);
  transform: translateX(-100%);
  transition: var(--transition);
}

.notebook:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

.notebook.selected {
  background-color: rgba(100, 181, 246, 0.05);
}

.notebook.selected::after {
  transform: translateX(0);
}

.notebook .title {
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--on-surface);
}

.notebook .meta {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.54);
}

.empty-state {
  padding: 24px;
  text-align: center;
  color: rgba(0, 0, 0, 0.54);
  font-size: 14px;
}

.editor-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--surface);
  overflow: hidden;
  position: relative;
}

.editor-toolbar {
  padding: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.title-input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 18px;
  font-weight: 500;
  background: transparent;
  color: var(--on-surface);
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}

.title-input:focus {
  border-bottom: 2px solid var(--primary);
}

.content-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 16px;
  resize: none;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.5;
  background: transparent;
  color: var(--on-surface);
}

.editor-actions {
  padding: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.btn {
  background-color: transparent;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn i {
  font-size: 18px;
}

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

.btn:active {
  background-color: rgba(0, 0, 0, 0.1);
  transform: translateY(1px);
}

.btn-primary {
  background-color: var(--primary);
  color: var(--on-primary);
}

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

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

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.menu-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.menu-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.menu-btn .line {
  width: 24px;
  height: 2px;
  background-color: white;
  position: relative;
}

.menu-btn .line::before,
.menu-btn .line::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 2px;
  background-color: white;
  left: 0;
  transition: var(--transition);
}

.menu-btn .line::before {
  top: -8px;
}

.menu-btn .line::after {
  top: 8px;
}

.menu-btn.active .line {
  background-color: transparent;
}

.menu-btn.active .line::before {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-btn.active .line::after {
  transform: rotate(-45deg) translate(5px, -5px);
}

.account-area {
  display: flex;
  align-items: center;
}

.account-btn {
  color: var(--on-primary);
  background: transparent;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 4px;
  transition: var(--transition);
}

.account-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background-color: var(--surface);
  border-radius: 12px;
  width: 90%;
  max-width: 560px;
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: var(--transition);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.modal-backdrop.active .modal {
  transform: translateY(0);
}

.modal-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-title {
  font-size: 20px;
  font-weight: 500;
  color: var(--on-surface);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.message {
  margin-bottom: 16px;
  color: var(--on-surface);
  line-height: 1.5;
}

.auth-tabs {
  display: flex;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.auth-tabs button {
  flex: 1;
  padding: 12px;
  background: transparent;
  border: none;
  font-size: 16px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.54);
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}

.auth-tabs button.active {
  color: var(--primary);
}

.auth-tabs button.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary);
}

.auth-field {
  margin-bottom: 16px;
}

.auth-field input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  font-size: 16px;
  transition: var(--transition);
}

.auth-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(100, 181, 246, 0.2);
}

.account-menu {
  position: absolute;
  right: 16px;
  top: 64px;
  background-color: var(--surface);
  border-radius: 4px;
  box-shadow: var(--shadow);
  min-width: 200px;
  z-index: 100;
  transform-origin: top right;
  transform: scale(0.9);
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.account-menu.active {
  transform: scale(1);
  opacity: 1;
  pointer-events: all;
}

.account-menu-item {
  padding: 12px 16px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.account-menu-item:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.account-menu-divider {
  height: 1px;
  background-color: rgba(0, 0, 0, 0.1);
  margin: 8px 0;
}

.loader {
  width: 48px;
  height: 48px;
  border: 3px solid var(--primary-light);
  border-bottom-color: transparent;
  border-radius: 50%;
  display: inline-block;
  box-sizing: border-box;
  animation: rotation 1s linear infinite;
}

@keyframes rotation {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

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

.slide-in {
  animation: slideIn 0.3s ease forwards;
}

@keyframes slideIn {
  from { transform: translateX(-20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.empty-editor {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: rgba(0, 0, 0, 0.54);
  text-align: center;
}

.empty-editor i {
  font-size: 48px;
  margin-bottom: 16px;
  color: rgba(0, 0, 0, 0.3);
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 12px 24px;
  border-radius: 4px;
  font-size: 14px;
  z-index: 1000;
  transition: var(--transition);
}

.toast.active {
  transform: translateX(-50%) translateY(0);
}
