:root {
  --bg-desktop: linear-gradient(135deg, #fce4ec 0%, #fff3e0 25%, #f3e5f5 50%, #e8eaf6 75%, #fce4ec 100%);
  --bg-app: #ffffff;
  --bg-sidebar: #fcfcfc;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --border-color: #f3f4f6;
  --primary-color: #8b5cf6;
  --primary-hover: #7c3aed;
  --secondary-bg: #f3f4f6;
  --secondary-hover: #e5e7eb;
  --danger-color: #ef4444;
  --radius: 12px;
  --radius-app: 24px;
  --transition: all 0.2s ease;
  --sidebar-width: 280px;
}

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

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

body {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 14px;
  background: var(--bg-desktop);
  color: var(--text-main);
  line-height: 1.6;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 3vh 4vw;
}

a { text-decoration: none; color: inherit; }

/* Main App Wrapper */
.app-container {
  display: flex;
  width: 100%;
  max-width: 1400px;
  height: 94vh;
  background: var(--bg-app);
  border-radius: var(--radius-app);
  box-shadow: 0 20px 40px rgba(0,0,0,0.08);
  overflow: hidden;
  position: relative;
}

/* Sidebar Layout */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 24px 16px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 24px;
}
.sidebar-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary-color), #d946ef);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 16px;
}
.sidebar-brand {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 4px; }

.section-title {
  padding: 24px 12px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition);
  gap: 12px;
}
.nav-item:hover {
  background: #f3f4f6;
  color: var(--text-main);
}
.nav-item.active {
  background: var(--secondary-bg);
  color: var(--text-main);
  font-weight: 600;
}

.sidebar-footer {
  margin-top: 24px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(139,92,246,0.1), rgba(217,70,239,0.1));
  border-radius: var(--radius);
  border: 1px solid rgba(139,92,246,0.2);
}
.storage-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}
.storage-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.storage-btn {
  width: 100%;
  padding: 8px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

/* Main Content Wrapper */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-app);
  height: 100%;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 48px;
  border-bottom: 1px solid var(--border-color);
}
.search-container {
  position: relative;
  width: 400px;
}
.search-input {
  width: 100%;
  padding: 12px 16px 12px 40px;
  background: #f9fafb;
  border: 1px solid var(--border-color);
  border-radius: 24px;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}
.search-input:focus {
  background: #fff;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.1);
}
.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.btn-new {
  background: var(--primary-color);
  color: #fff;
  padding: 12px 24px;
  border-radius: 24px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(139,92,246,0.2);
  height: 44px; /* 높이 통일 */
}
.btn-new:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}
.user-profile {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--secondary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: var(--text-main);
  border: 2px solid white;
  box-shadow: 0 0 0 1px var(--border-color);
}

.content {
  padding: 40px 60px;
  flex: 1;
  overflow-y: auto;
}

/* Notes Content Styling */
.note-header {
  margin-bottom: 40px;
}
.note-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}
.note-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: #f9fafb;
  border: 1px solid var(--border-color);
  border-radius: 16px;
}

.note-body {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #374151;
}
.note-body h3, .note-body h4 {
  margin-top: 32px;
  margin-bottom: 16px;
  font-weight: 600;
  color: var(--text-main);
}
.note-body ul, .note-body ol {
  padding-left: 24px;
  margin-bottom: 24px;
}
.note-body li {
  margin-bottom: 8px;
}
.note-body p {
  margin-bottom: 24px;
}

/* Dashboard List */
.dashboard-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
}
.note-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.note-card {
  padding: 24px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.note-card:hover {
  border-color: #d1d5db;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.note-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-main);
}
.note-card-preview {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.note-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--text-light);
}
.note-card-actions {
  display: flex;
  gap: 12px;
}
.note-card-actions a {
  color: var(--primary-color);
  font-weight: 500;
}
.note-card-actions a:hover {
  text-decoration: underline;
}

/* Forms */
.form-group {
  margin-bottom: 24px;
}
.form-group label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-main);
}
.form-control {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  background: #f9fafb;
  transition: var(--transition);
}
.form-control:focus {
  outline: none;
  background: #fff;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.1);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  height: 44px; /* 높이 통일 */
}
.btn-primary { background: var(--primary-color); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--secondary-bg); color: var(--text-main); }
.btn-secondary:hover { background: var(--secondary-hover); }
.btn-text { background: transparent; color: var(--text-muted); padding: 12px 16px; font-weight: 500;}
.btn-text:hover { color: var(--text-main); }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
  body { padding: 0; }
  .app-container { border-radius: 0; height: 100vh; position: relative; width: 100vw; }
  
  .sidebar { 
    position: absolute; 
    left: -100%; 
    z-index: 50; 
    transition: left 0.3s ease; 
    box-shadow: 4px 0 24px rgba(0,0,0,0.1); 
  }
  .sidebar.mobile-open { left: 0; }
  
  #mobile-menu-btn { display: block !important; color: var(--text-main); }
  
  .top-bar { padding: 16px; flex-wrap: wrap; gap: 12px; }
  .search-container { width: 100%; margin-top: 4px; }
  
  .content { padding: 20px 16px; }
  
  .note-title { font-size: 1.5rem; }
  .note-card { padding: 16px; }
  
  .btn-new { padding: 8px 16px; font-size: 0.9rem; }
  
  .form-actions { flex-direction: column; justify-content: stretch; gap: 8px; margin-top: 24px;}
  .form-actions .btn { width: 100%; justify-content: center; }
  .form-actions .btn-text { text-align: center; padding: 12px; }
}
