/* Daily Notes - Minimal Styling */

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

:root {
  --bg-color: #ffffff;
  --text-color: #1a1a1a;
  --border-color: #e0e0e0;
  --link-color: #0066cc;
  --code-bg: #f5f5f5;
  --header-bg: #fafafa;
  --success-color: #28a745;
  --error-color: #dc3545;
  --muted-color: #6c757d;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --border-color: #333333;
    --link-color: #4d9fff;
    --code-bg: #2a2a2a;
    --header-bg: #222222;
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
}

/* Auth Screen */
#auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.auth-container {
  max-width: 400px;
  width: 100%;
  padding: 40px;
  background: var(--header-bg);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.auth-container h1 {
  margin-bottom: 10px;
  font-size: 28px;
  font-weight: 600;
}

.auth-container p {
  margin-bottom: 30px;
  color: var(--muted-color);
}

.auth-form input {
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 16px;
  background: var(--bg-color);
  color: var(--text-color);
}

.auth-form button {
  width: 100%;
  padding: 12px;
  background: var(--link-color);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
}

.auth-form button:hover {
  opacity: 0.9;
}

.auth-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-message {
  margin-top: 15px;
  padding: 10px;
  border-radius: 4px;
  text-align: center;
  font-size: 14px;
}

.auth-message.success {
  background: rgba(40, 167, 69, 0.1);
  color: var(--success-color);
  border: 1px solid var(--success-color);
}

.auth-message.error {
  background: rgba(220, 53, 69, 0.1);
  color: var(--error-color);
  border: 1px solid var(--error-color);
}

/* App Screen */
#app-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

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

.app-title {
  font-size: 16px;
  font-weight: 600;
}

.app-controls {
  display: flex;
  align-items: center;
  gap: 15px;
}

.save-status {
  font-size: 13px;
  color: var(--muted-color);
}

.save-status.saving {
  color: var(--link-color);
}

.save-status.saved {
  color: var(--success-color);
}

.save-status.error {
  color: var(--error-color);
}

.logout-btn {
  background: none;
  border: none;
  color: var(--muted-color);
  cursor: pointer;
  font-size: 13px;
  text-decoration: underline;
  padding: 0;
}

.logout-btn:hover {
  color: var(--text-color);
}

/* Editor */
.editor-container {
  flex: 1;
  overflow: auto;
  padding: 20px;
}

#editor {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  min-height: 100%;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.6;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  color: var(--text-color);
}

/* Markdown styling (for future WYSIWYG editor) */
.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  margin-top: 24px;
  margin-bottom: 16px;
  font-weight: 600;
  line-height: 1.25;
}

.markdown-body h1 {
  font-size: 2em;
}

.markdown-body h2 {
  font-size: 1.5em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.markdown-body h3 {
  font-size: 1.25em;
}

.markdown-body code {
  padding: 2px 6px;
  background: var(--code-bg);
  border-radius: 3px;
  font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
  font-size: 0.9em;
}

.markdown-body pre {
  padding: 16px;
  background: var(--code-bg);
  border-radius: 6px;
  overflow-x: auto;
}

.markdown-body a {
  color: var(--link-color);
  text-decoration: none;
}

.markdown-body a:hover {
  text-decoration: underline;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 2em;
  margin-bottom: 16px;
}

/* Hidden class */
.hidden {
  display: none !important;
}

/* Loading state */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--muted-color);
}

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
}

.toast {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: toast-slide-in 0.3s ease-out;
  min-width: 300px;
}

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

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

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

.toast-icon {
  flex-shrink: 0;
  font-size: 20px;
  line-height: 1;
}

.toast-error .toast-icon {
  color: var(--error-color);
}

.toast-success .toast-icon {
  color: var(--success-color);
}

.toast-info .toast-icon {
  color: var(--link-color);
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 14px;
}

.toast-message {
  font-size: 13px;
  color: var(--muted-color);
  line-height: 1.4;
}

.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--muted-color);
  cursor: pointer;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.toast-close:hover {
  opacity: 1;
}

@keyframes toast-slide-in {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toast-slide-out {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

.toast.toast-hiding {
  animation: toast-slide-out 0.3s ease-out forwards;
}

/* Mobile responsive */
@media (max-width: 480px) {
  .toast-container {
    right: 10px;
    left: 10px;
    max-width: none;
  }

  .toast {
    min-width: auto;
  }

  @keyframes toast-slide-in {
    from {
      transform: translateY(-100px);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  @keyframes toast-slide-out {
    from {
      transform: translateY(0);
      opacity: 1;
    }
    to {
      transform: translateY(-100px);
      opacity: 0;
    }
  }
}
