/* Modern Pro Notes Application Styling */
:root {
  /* Requested Color Palette */
  --bg-primary: #F4F6FF;
  --bg-surface: #FFFFFF;
  --bg-sidebar: #10375C;
  --text-primary: #10375C;
  --text-secondary: #5A6B7C;
  --text-light: #F4F6FF;
  --text-muted: #8E9AAF;
  
  --accent-gold: #F3C623;
  --accent-orange: #EB8317;
  --accent-navy: #10375C;
  --accent-blue: #2196F3;
  
  --border-color: #E2E8F0;
  --shadow-sm: 0 2px 8px rgba(16, 55, 92, 0.06);
  --shadow-md: 0 8px 24px rgba(16, 55, 92, 0.1);
  --shadow-lg: 0 16px 36px rgba(16, 55, 92, 0.16);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  /* Note Card Colors */
  --note-white: #FFFFFF;
  --note-yellow: #FFF9D0;
  --note-blue: #E3F2FD;
  --note-green: #E8F5E9;
  --note-pink: #FCE4EC;
  --note-purple: #F3E5F5;
  --note-orange: #FFE0B2;
  --note-gray: #ECEFF1;
}

/* Dark Mode Palette Overrides */
[data-theme="dark"] {
  --bg-primary: #0A192F;
  --bg-surface: #102A43;
  --bg-sidebar: #061527;
  --text-primary: #F4F6FF;
  --text-secondary: #9FB3C8;
  --text-muted: #627D98;
  --border-color: #1E3A5F;
  
  --note-white: #102A43;
  --note-yellow: #3D3512;
  --note-blue: #132E4F;
  --note-green: #143823;
  --note-pink: #3D1C28;
  --note-purple: #2C1B3A;
  --note-orange: #3D2612;
  --note-gray: #1E293B;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  display: flex;
  height: 100vh;
  overflow: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Main Layout */
#app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar Styling */
sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 16px;
  flex-shrink: 0;
  z-index: 100;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  transition: width 0.3s ease;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px 24px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-header img, .brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #10375C;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(243, 198, 35, 0.4);
}

.brand-header h1 {
  font-size: 20px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: 0.5px;
}

.brand-header span {
  color: var(--accent-gold);
}

.sidebar-nav {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  color: rgba(244, 246, 255, 0.75);
  border-radius: var(--radius-md);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-item-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-item i {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-light);
  transform: translateX(4px);
}

.nav-item.active {
  background: linear-gradient(135deg, var(--accent-orange), #C76B0B);
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(235, 131, 23, 0.35);
}

.badge-count {
  background-color: rgba(255, 255, 255, 0.15);
  color: var(--text-light);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.nav-item.active .badge-count {
  background-color: rgba(255, 255, 255, 0.3);
}

/* Storage & Theme Controls in Sidebar Footer */
.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-light);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

/* Main Content Area */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--bg-primary);
}

/* Top Dashboard Header Bar */
header.top-bar {
  height: 72px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  gap: 20px;
  box-shadow: var(--shadow-sm);
  z-index: 10;
}

.search-box {
  position: relative;
  width: 420px;
  max-width: 100%;
}

.search-box i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 15px;
}

.search-box input {
  width: 100%;
  padding: 12px 16px 12px 46px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

.search-box input:focus {
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 3px rgba(235, 131, 23, 0.15);
  background-color: var(--bg-surface);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-orange), #C76B0B);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(235, 131, 23, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #F99120, var(--accent-orange));
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(235, 131, 23, 0.4);
}

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

.btn-secondary:hover {
  background-color: var(--border-color);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background-color: var(--accent-gold);
  color: #10375C;
  border-color: var(--accent-gold);
}

/* Dashboard View Body */
.content-body {
  flex: 1;
  padding: 24px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Dashboard Statistics Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.stat-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-icon.total { background: rgba(16, 55, 92, 0.1); color: var(--accent-navy); }
.stat-icon.pinned { background: rgba(243, 198, 35, 0.2); color: #B38600; }
.stat-icon.favorite { background: rgba(235, 131, 23, 0.15); color: var(--accent-orange); }
.stat-icon.archived { background: rgba(33, 150, 243, 0.15); color: var(--accent-blue); }
.stat-icon.trash { background: rgba(244, 67, 54, 0.15); color: #E53935; }
.stat-icon.today { background: rgba(76, 175, 80, 0.15); color: #43A047; }

.stat-info h4 {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-info .stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 2px;
}

/* Control Bar (Filters, Sort, Grid/List view toggle) */
.controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  background-color: var(--bg-surface);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.filter-group, .sort-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-group label, .sort-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.select-dropdown {
  padding: 8px 14px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

.view-toggle {
  display: flex;
  background-color: var(--bg-primary);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.view-btn {
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-btn.active {
  background-color: var(--bg-surface);
  color: var(--accent-orange);
  box-shadow: var(--shadow-sm);
}

/* Section Titles */
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.section-title i {
  color: var(--accent-orange);
}

/* Notes Cards Grid */
.notes-container.grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.notes-container.list-view {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Single Note Card Design */
.note-card {
  background-color: var(--card-bg, var(--bg-surface));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.note-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.note-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.note-title {
  font-size: 16px;
  font-weight: 700;
  color: #10375C;
  line-height: 1.3;
  word-break: break-word;
}

[data-theme="dark"] .note-title {
  color: #F4F6FF;
}

.card-actions-quick {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pin-btn, .fav-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 15px;
  color: var(--text-muted);
  transition: color 0.2s ease, transform 0.2s ease;
}

.pin-btn.active { color: var(--accent-orange); }
.fav-btn.active { color: var(--accent-gold); }

.note-preview-img {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin: 10px 0;
}

.note-description {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.tag-pill {
  background-color: rgba(16, 55, 92, 0.08);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 10px;
}

[data-theme="dark"] .tag-pill {
  background-color: rgba(244, 246, 255, 0.12);
}

.note-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 11px;
  color: var(--text-muted);
}

.priority-badge {
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
}

.priority-High { background-color: #FFEBEE; color: #D32F2F; }
.priority-Medium { background-color: #FFF8E1; color: #F57F17; }
.priority-Low { background-color: #E8F5E9; color: #388E3C; }

/* Empty State Styling */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 48px;
  color: var(--accent-orange);
  margin-bottom: 14px;
  opacity: 0.8;
}

.empty-state h3 {
  font-size: 18px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

/* Modal Windows (Editor, Settings, Import) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(16, 55, 92, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
  width: 680px;
  max-width: 92vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

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

.modal-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.close-modal-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s ease;
}

.close-modal-btn:hover { color: var(--accent-orange); }

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input, .form-textarea, .form-select {
  padding: 12px 14px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--accent-orange);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Color Picker Radios */
.color-picker {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.color-option {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.color-option:hover, .color-option.selected {
  transform: scale(1.15);
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 3px rgba(235, 131, 23, 0.2);
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* Custom Context Menu */
.context-menu {
  position: fixed;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  width: 180px;
  z-index: 2000;
  display: none;
  flex-direction: column;
  padding: 6px 0;
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.context-menu-item:hover {
  background-color: var(--bg-primary);
  color: var(--accent-orange);
}

.context-menu-item i {
  width: 16px;
  text-align: center;
  color: var(--text-secondary);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 3000;
}

.toast {
  background-color: var(--bg-sidebar);
  color: var(--text-light);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeIn 0.3s ease forwards;
}

.toast.success i { color: var(--accent-gold); }
.toast.error i { color: #FF5252; }
