/* Component Styles with Glassmorphism Design */

/* Navigation Header */
.nav-header {
  background: var(--bg-secondary);
  backdrop-filter: blur(var(--backdrop-blur));
  -webkit-backdrop-filter: blur(var(--backdrop-blur));
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow:
    0 4px 16px var(--shadow-dark),
    inset 0 1px 0 var(--shadow-light);
}

.nav-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
  padding: 0.5rem 0;
}

.nav-link:hover {
  color: var(--text-primary);
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--accent-primary);
  color: var(--text-invert);
  border: none;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  box-shadow:
    0 2px 8px var(--shadow-dark),
    inset 0 1px 0 var(--shadow-light);
}

.btn-primary:hover {
  background: var(--accent-secondary);
  transform: translateY(-1px);
  box-shadow:
    0 4px 16px var(--shadow-dark),
    inset 0 1px 0 var(--shadow-light);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  box-shadow: inset 0 1px 0 var(--shadow-light);
}

.btn-secondary:hover {
  background: var(--bg-secondary);
  transform: translateY(-1px);
  box-shadow:
    0 2px 8px var(--shadow-dark),
    inset 0 1px 0 var(--shadow-light);
}

.btn-secondary:active {
  transform: translateY(0);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--error-color);
  color: var(--text-invert);
  border: none;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  box-shadow:
    0 2px 8px var(--shadow-dark),
    inset 0 1px 0 var(--shadow-light);
}

.btn-danger:hover {
  background: #D70015;
  transform: translateY(-1px);
}

.btn-danger:active {
  transform: translateY(0);
}

/* Logout Button */
.logout-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.logout-btn:hover {
  background: var(--error-color);
  color: var(--text-invert);
  border-color: var(--error-color);
  transform: translateY(-1px);
}

.logout-btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.logout-btn:hover svg {
  transform: translateX(2px);
}

/* Form Elements */
.input-group {
  margin-bottom: 1rem;
}

/* Auth form specific spacing */
.auth-form .input-group {
  margin-bottom: 1.25rem;
}

.auth-form .input-group:last-of-type {
  margin-bottom: 1.75rem;
}

.input-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
}

.input-group input,
.input-group textarea,
.input-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  box-shadow: inset 0 1px 2px var(--shadow-dark);
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow:
    inset 0 1px 2px var(--shadow-dark),
    0 0 0 3px color-mix(in srgb, var(--accent-primary) 20%, transparent);
}

.input-group input::placeholder,
.input-group textarea::placeholder {
  color: var(--text-muted);
}

.input-group textarea {
  resize: vertical;
  min-height: 100px;
}

/* Cards */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  backdrop-filter: blur(var(--backdrop-blur));
  -webkit-backdrop-filter: blur(var(--backdrop-blur));
  box-shadow:
    0 4px 16px var(--shadow-dark),
    inset 0 1px 0 var(--shadow-light);
  transition: all 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 24px var(--shadow-dark),
    inset 0 1px 0 var(--shadow-light);
}

/* Modals */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-content {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  backdrop-filter: blur(var(--backdrop-blur));
  -webkit-backdrop-filter: blur(var(--backdrop-blur));
  box-shadow:
    0 16px 48px var(--shadow-dark),
    inset 0 1px 0 var(--shadow-light);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.5rem 0 1.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-strong);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

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

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

/* Password Reset Modal Specific Styles */
.modal form {
  padding: 0 1.5rem 1.5rem 1.5rem;
}

.modal .input-group {
  margin-bottom: 1.25rem;
}

.modal .input-group:last-of-type {
  margin-bottom: 1.75rem;
}

.modal .btn-primary {
  width: 100%;
  justify-content: center;
}

/* Mobile-specific modal improvements */
@media (max-width: 768px) {
  .modal {
    padding: 0.5rem;
  }

  .modal-content {
    max-width: 100%;
    margin: 0;
  }

  .modal form {
    padding: 0 1rem 1.5rem 1rem;
  }

  .modal .input-group {
    margin-bottom: 1.5rem;
  }

  .modal .input-group:last-of-type {
    margin-bottom: 2rem;
  }
}

/* Hero Section */
.hero-section {
  flex: 1;
  padding: 3rem 0 2rem 0;
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-content {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 1rem;
}

.hero-title {
  font-size: 3rem;
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 3rem;
  line-height: 1.6;
}

/* Auth Forms */
.auth-container {
  max-width: 400px;
  margin: 0 auto;
}

.auth-form {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2rem;
  backdrop-filter: blur(var(--backdrop-blur));
  -webkit-backdrop-filter: blur(var(--backdrop-blur));
  box-shadow:
    0 8px 32px var(--shadow-dark),
    inset 0 1px 0 var(--shadow-light);
}

.auth-form h3 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--text-strong);
}

.auth-links {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
  padding-top: 0.5rem;
}

.auth-links a {
  color: var(--accent-primary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.auth-links a:hover {
  color: var(--accent-secondary);
}

/* Features Section */
.features-section {
  padding: 2rem 0 4rem 0;
  position: relative;
  z-index: 1;
}

.features-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  text-align: center;
}

.features-section h2 {
  font-size: 2.5rem;
  margin-bottom: 3rem;
  color: var(--text-strong);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.feature-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
  backdrop-filter: blur(var(--backdrop-blur));
  -webkit-backdrop-filter: blur(var(--backdrop-blur));
  box-shadow:
    0 4px 16px var(--shadow-dark),
    inset 0 1px 0 var(--shadow-light);
  transition: all 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 8px 24px var(--shadow-dark),
    inset 0 1px 0 var(--shadow-light);
}

.feature-card h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--text-strong);
}

.feature-card p {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-badge.free {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.status-badge.premium {
  background: var(--accent-primary);
  color: var(--text-invert);
}

.status-badge.expired {
  background: var(--warning-color);
  color: var(--text-invert);
}

/* Loading States */
.loading {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
}

.loading::after {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-color);
  border-top: 2px solid var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Error States */
.error-message {
  background: color-mix(in srgb, var(--error-color) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--error-color) 30%, transparent);
  color: var(--error-color);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.success-message {
  background: color-mix(in srgb, var(--success-color) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--success-color) 30%, transparent);
  color: var(--success-color);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

/* 
Dashboard Specific Styles - Google Drive-like Layout */
.dashboard-main {
  padding: 0;
  position: relative;
  z-index: 1;
}

/* Expand to fill available space and push footer down - desktop/tablet only */
@media (min-width: 768px) {
  .dashboard-main {
    flex: 1;
    display: flex;
    flex-direction: column;
  }
}

.dashboard-content {
  width: 100%;
  background: var(--bg-primary);
}

/* Expand to fill available space - desktop/tablet only */
@media (min-width: 768px) {
  .dashboard-content {
    flex: 1;
    display: flex;
    flex-direction: column;
  }
}

.content-header {
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--bg-secondary) 95%, var(--accent-primary) 5%) 0%,
      var(--bg-secondary) 50%,
      color-mix(in srgb, var(--bg-secondary) 95%, var(--accent-secondary) 5%) 100%);
  border-bottom: 1px solid var(--border-color);
  padding: 1.5rem 2rem;
  backdrop-filter: blur(var(--backdrop-blur));
  -webkit-backdrop-filter: blur(var(--backdrop-blur));
  box-shadow: 0 2px 8px var(--shadow-dark);
  position: relative;
  overflow: hidden;
}

/* Removed decorative ::before element for better mobile performance */

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.content-header h2 {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-strong);
  margin: 0;
}

.selection-info {
  background: var(--accent-primary);
  color: var(--text-invert);
  padding: 0.375rem 0.875rem;
  border-radius: 16px;
  font-size: 0.875rem;
  font-weight: 500;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-icon {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
}

.filters-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: space-between;
  position: relative;
  z-index: 1;
  margin-top: 1rem;
  padding-top: 0.75rem;
}

.search-section {
  flex: 0 1 400px;
  max-width: 400px;
  min-width: 280px;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  box-shadow: inset 0 1px 2px var(--shadow-dark);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow:
    inset 0 1px 2px var(--shadow-dark),
    0 0 0 3px color-mix(in srgb, var(--accent-primary) 20%, transparent);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.filters-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.filter-select {
  padding: 0.75rem 1rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 0.875rem;
  min-width: 140px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: inset 0 1px 2px var(--shadow-dark);
}

.filter-select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow:
    inset 0 1px 2px var(--shadow-dark),
    0 0 0 3px color-mix(in srgb, var(--accent-primary) 20%, transparent);
}

/* Selection Actions Bar */
.selection-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
  padding: 0.875rem 2rem;
  backdrop-filter: blur(var(--backdrop-blur));
  -webkit-backdrop-filter: blur(var(--backdrop-blur));
  box-shadow: inset 0 1px 0 var(--shadow-light);
}

.selection-controls {
  display: flex;
  gap: 0.75rem;
}

.bulk-actions {
  display: flex;
  gap: 0.75rem;
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
}

/* Notes Grid - Google Drive Style */
.notes-grid {
  padding: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  max-width: 100%;
}

/* Expand notes grid to fill available space - desktop/tablet only */
@media (min-width: 768px) {
  .notes-grid {
    flex: 1;
    min-height: 0;
    /* Allow grid to shrink if needed */
  }
}

/* Remove domain sections for cleaner grid */
.domain-section {
  display: contents;
}

.domain-header {
  display: none;
}

.domain-notes {
  display: contents;
}

.note-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow:
    0 2px 8px var(--shadow-dark),
    inset 0 1px 0 var(--shadow-light);
  display: flex;
  flex-direction: column;
  height: 200px;
  position: relative;
  overflow: hidden;
}

.note-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 24px var(--shadow-dark),
    inset 0 1px 0 var(--shadow-light);
}

.note-card.selected {
  border-color: var(--accent-primary);
  background: color-mix(in srgb, var(--accent-primary) 8%, var(--bg-secondary));
  box-shadow:
    0 4px 16px color-mix(in srgb, var(--accent-primary) 30%, transparent),
    inset 0 1px 0 var(--shadow-light);
}

.note-card-selection {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 10;
  background: var(--bg-primary);
  border-radius: 6px;
  padding: 0.25rem;
  box-shadow: 0 2px 8px var(--shadow-dark);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.note-card:hover .note-card-selection,
.note-card.selected .note-card-selection {
  opacity: 1;
}

.note-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent-primary);
}

.note-card-content {
  flex: 1;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.note-card-header {
  margin-bottom: 0.75rem;
}

.note-card-title {
  font-weight: 600;
  color: var(--text-strong);
  font-size: 0.9375rem;
  line-height: 1.3;
  margin-bottom: 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.note-card-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.note-card-preview {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
  margin-bottom: 0.75rem;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}

.empty-state h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.empty-state p {
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

/* Domain Organization Styles */
.domain-section {
  margin-bottom: 2rem;
}

.domain-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.domain-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.domain-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-strong);
  margin: 0;
}

.note-count {
  font-size: 0.875rem;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.domain-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.select-domain-btn {
  font-size: 0.8125rem;
  padding: 0.375rem 0.75rem;
}

.domain-notes {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

/* Enhanced Note Card Styles */
.note-card-url {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  background: var(--bg-tertiary);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: auto;
}

.tag {
  display: inline-block;
  background: var(--text-strong);
  color: var(--text-invert);
  font-size: 0.625rem;
  font-weight: 500;
  padding: 0.125rem 0.375rem;
  border-radius: 6px;
  text-transform: lowercase;
}

/* Loading Animation Enhancement */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  color: var(--text-secondary);
}

.loading::after {
  content: '';
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* AI Summary Actions */
.ai-summary-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ai-summary-generate {
  padding: 0.75rem 1.5rem;
  background: var(--accent-primary);
  color: var(--text-invert);
  border: none;
  border-radius: 0.5rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-summary-generate:hover:not(:disabled) {
  background: var(--accent-secondary);
  transform: translateY(-1px);
}

.ai-summary-generate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ai-summary-generate.secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.ai-summary-generate.secondary:hover:not(:disabled) {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
}

/* Button Loading States */
.btn-primary.loading,
.btn-secondary.loading,
.btn-danger.loading {
  position: relative;
  color: transparent;
}

.btn-primary.loading::after,
.btn-secondary.loading::after,
.btn-danger.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid currentColor;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.btn-primary.loading::after {
  border-color: var(--text-invert);
  border-top-color: transparent;
}

.btn-secondary.loading::after {
  border-color: var(--text-primary);
  border-top-color: transparent;
}

.btn-danger.loading::after {
  border-color: var(--text-invert);
  border-top-color: transparent;
}

/* Note Side Panel */
.note-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  height: 100vh;
  background: var(--bg-primary);
  border-left: 1px solid var(--border-color);
  backdrop-filter: blur(var(--backdrop-blur));
  -webkit-backdrop-filter: blur(var(--backdrop-blur));
  box-shadow: -4px 0 24px var(--shadow-dark);
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.note-panel:not(.hidden) {
  transform: translateX(0);
}

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

.panel-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.panel-close:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.panel-actions {
  display: flex;
  gap: 0.5rem;
}

.note-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

/* Note View Mode */
.note-view {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.note-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-strong);
  margin: 0 0 0.5rem 0;
  line-height: 1.3;
}

.note-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.note-date {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.note-domain {
  font-size: 0.8125rem;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  display: inline-block;
  width: fit-content;
}

.note-content-display {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Support extension formatting in display */
.note-content-display b,
.note-content-display strong {
  font-weight: 600;
  color: var(--text-strong);
}

.note-content-display u {
  text-decoration: underline;
}

.note-content-display s {
  text-decoration: line-through;
}

.note-content-display a {
  color: var(--accent-primary);
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.2s ease;
}

.note-content-display a:hover {
  color: var(--accent-secondary);
  text-decoration: none;
}

.note-url-display {
  margin-top: 1rem;
}

.note-url-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--accent-primary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  word-break: break-all;
}

.note-url-link:hover {
  background: var(--bg-tertiary);
  transform: translateY(-1px);
}

.note-tags-display {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.note-tag {
  background: var(--text-strong);
  color: var(--text-invert);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8125rem;
  font-weight: 500;
}

/* Note Edit Mode */
.note-edit {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.note-content-input {
  min-height: 200px;
  max-height: 400px;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-primary);
  outline: none;
  overflow-y: auto;
  resize: vertical;
  font-family: inherit;
}

/* Custom scrollbars for note content input only */
.note-content-input::-webkit-scrollbar {
  width: 6px;
}

.note-content-input::-webkit-scrollbar-track {
  background: transparent;
}

.note-content-input::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.note-content-input::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.note-content-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-primary) 20%, transparent);
}

.note-content-input[contenteditable="true"]:empty::before {
  content: attr(placeholder);
  color: var(--text-muted);
  pointer-events: none;
}

/* Support extension formatting in editor */
.note-content-input b,
.note-content-input strong {
  font-weight: 600;
}

.note-content-input u {
  text-decoration: underline;
}

.note-content-input s {
  text-decoration: line-through;
}

.note-content-input a {
  color: var(--accent-primary);
  text-decoration: underline;
}

.edit-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

/* Notification System */
.notification {
  position: fixed;
  top: 20px;
  right: 420px;
  /* Account for side panel */
  padding: 1rem 1.5rem;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 1100;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  backdrop-filter: blur(var(--backdrop-blur));
  -webkit-backdrop-filter: blur(var(--backdrop-blur));
  box-shadow:
    0 8px 24px var(--shadow-dark),
    inset 0 1px 0 var(--shadow-light);
}

.notification.show {
  transform: translateX(0);
}

.notification-success {
  background: color-mix(in srgb, var(--success-color) 15%, var(--bg-secondary));
  border: 1px solid color-mix(in srgb, var(--success-color) 30%, transparent);
  color: var(--success-color);
}

.notification-error {
  background: color-mix(in srgb, var(--error-color) 15%, var(--bg-secondary));
  border: 1px solid color-mix(in srgb, var(--error-color) 30%, transparent);
  color: var(--error-color);
}

.notification-warning {
  background: color-mix(in srgb, var(--warning-color) 15%, var(--bg-secondary));
  border: 1px solid color-mix(in srgb, var(--warning-color) 30%, transparent);
  color: var(--warning-color);
}

.notification-info {
  background: color-mix(in srgb, var(--info-color) 15%, var(--bg-secondary));
  border: 1px solid color-mix(in srgb, var(--info-color) 30%, transparent);
  color: var(--info-color);
}

/* Account Specific Styles */
.account-main {
  flex: 1;
  padding: 1rem;
  position: relative;
  z-index: 1;
}

.account-container {
  max-width: 800px;
  margin: 0 auto;
}

.account-container h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: var(--text-strong);
  text-align: center;
}

.account-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(var(--backdrop-blur));
  -webkit-backdrop-filter: blur(var(--backdrop-blur));
  box-shadow:
    0 4px 16px var(--shadow-dark),
    inset 0 1px 0 var(--shadow-light);
}

.account-section h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--text-strong);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.account-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
}

.info-item label {
  font-weight: 500;
  color: var(--text-primary);
}

.info-item span {
  color: var(--text-secondary);
}

.subscription-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.subscription-status {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.status-details p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.subscription-actions {
  display: flex;
  gap: 1rem;
}

.premium-features {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.premium-features h4 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.premium-features ul {
  list-style: none;
  padding: 0;
}

.premium-features li {
  padding: 0.25rem 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.premium-features li::before {
  content: '✓';
  color: var(--success-color);
  font-weight: bold;
  margin-right: 0.5rem;
}

.security-settings,
.data-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.security-note,
.data-note {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Form Validation States */
.input-group.error input,
.input-group.error textarea,
.input-group.error select {
  border-color: var(--error-color);
  box-shadow:
    inset 0 1px 2px var(--shadow-dark),
    0 0 0 3px color-mix(in srgb, var(--error-color) 20%, transparent);
}

.input-group.success input,
.input-group.success textarea,
.input-group.success select {
  border-color: var(--success-color);
  box-shadow:
    inset 0 1px 2px var(--shadow-dark),
    0 0 0 3px color-mix(in srgb, var(--success-color) 20%, transparent);
}

.field-error {
  color: var(--error-color);
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.field-success {
  color: var(--success-color);
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

/* Footer Styles */
.site-footer {
  background: rgba(27, 79, 114, 0.1);
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  margin-top: auto;
  flex-shrink: 0;
  backdrop-filter: blur(var(--backdrop-blur));
  -webkit-backdrop-filter: blur(var(--backdrop-blur));
  position: relative;
  z-index: 10;
  /* Add safe area padding for mobile browser UI */
  padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--text-primary);
}

.footer-text {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-text p {
  margin: 0;
}

/* Privacy and Terms Page Specific Styles */
.privacy-main,
.terms-main {
  flex: 1;
  padding: 2rem 0 4rem 0;
  position: relative;
  z-index: 1;
}

.privacy-container,
.terms-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  backdrop-filter: blur(var(--backdrop-blur));
  -webkit-backdrop-filter: blur(var(--backdrop-blur));
  box-shadow:
    0 4px 16px var(--shadow-dark),
    inset 0 1px 0 var(--shadow-light);
  margin-bottom: 2rem;
}

.privacy-container h1,
.terms-container h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-strong);
  text-align: center;
}

.last-updated {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 2rem;
  font-style: italic;
}

.privacy-section,
.terms-section {
  margin-bottom: 2rem;
}

.privacy-section h2,
.terms-section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.privacy-section p,
.terms-section p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.privacy-section ul,
.terms-section ul {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.privacy-section li,
.terms-section li {
  margin-bottom: 0.5rem;
}

.privacy-section strong,
.terms-section strong {
  color: var(--text-strong);
  font-weight: 600;
}

/* Dashboard Layout Fix */
.dashboard-content {
  width: 100%;
  background: var(--bg-primary);
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .footer-links {
    justify-content: center;
  }

  .privacy-container,
  .terms-container {
    padding: 1.5rem;
    margin: 0 1rem 2rem 1rem;
  }

  .privacy-container h1,
  .terms-container h1 {
    font-size: 2rem;
  }

  .dashboard-content {
    min-height: calc(100vh - 140px);
  }

  .notes-grid {
    padding: 1rem;
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .note-card {
    height: 140px;
  }

  .note-card-content {
    padding: 0.75rem;
  }

  .note-card-title {
    font-size: 0.875rem;
    -webkit-line-clamp: 1;
    line-clamp: 1;
  }

  .note-card-preview {
    font-size: 0.75rem;
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }

  .note-card-date {
    font-size: 0.6875rem;
  }

  .note-panel {
    width: 100%;
    right: 0;
  }

  /* Remove sticky nav on tablet/mobile to prevent browser UI conflicts */
  .nav-header {
    position: relative;
    top: auto;
  }
}

@media (max-width: 480px) {

  .privacy-container,
  .terms-container {
    padding: 1rem;
    margin: 0 0.5rem 1rem 0.5rem;
  }

  .privacy-container h1,
  .terms-container h1 {
    font-size: 1.75rem;
  }

  .content-header {
    padding: 1rem;
  }

  .header-top {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .header-right {
    justify-content: center;
  }

  .filters-bar {
    flex-direction: column;
    gap: 1rem;
  }

  .search-section {
    flex: 1;
    max-width: none;
    min-width: auto;
  }

  .filters-section {
    justify-content: center;
  }

  .notes-grid {
    padding: 0.75rem;
    gap: 0.5rem;
  }

  /* Remove sticky nav on mobile to prevent browser UI conflicts */
  .nav-header {
    position: relative;
    top: auto;
  }

  .note-card {
    height: 120px;
    border-radius: 8px;
  }

  .note-card-content {
    padding: 0.5rem;
  }

  .note-card-header {
    margin-bottom: 0.5rem;
  }

  .note-card-title {
    font-size: 0.8125rem;
    line-height: 1.2;
    margin-bottom: 0.125rem;
  }

  .note-card-preview {
    font-size: 0.6875rem;
    line-height: 1.3;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    margin-bottom: 0.5rem;
  }

  .note-card-date {
    font-size: 0.625rem;
  }

  .note-card-selection {
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.125rem;
  }

  .note-checkbox {
    width: 14px;
    height: 14px;
  }
}