:root {
  --mint: #34d399;
  --mint-dark: #047857;
  --mint-darker: #065f46;
  --mint-light: #6ee7b7;
  --mint-pale: #ecfdf5;
  --mint-border: #a7f3d0;
  --mint-bg: #f0fdf4;
  --text: #111827;
  --text-muted: #6b7280;
  --error: #dc2626;
  --white: #ffffff;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.1);
  --radius: 10px;
  --radius-lg: 16px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--mint-bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.hidden { display: none !important; }

/* Auth layout - split screen */
.auth-page {
  display: flex !important;
  min-height: 100vh;
}

.auth-layout {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

.auth-hero {
  flex: 1;
  background: linear-gradient(135deg, #047857 0%, #059669 50%, #10b981 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}

@media (max-width: 768px) {
  .auth-layout { flex-direction: column; }
  .auth-hero { min-height: 200px; padding: 32px; }
}

.hero-content {
  max-width: 380px;
  text-align: center;
  color: white;
}

.hero-logo {
  width: 120px;
  height: 120px;
  margin-bottom: 24px;
  object-fit: contain;
}

.hero-icon {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.95;
}

.hero-content h1 {
  margin: 0 0 12px;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero-content p {
  margin: 0;
  font-size: 17px;
  opacity: 0.9;
  line-height: 1.5;
}

.auth-form-section {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: var(--white);
}

.auth-form-card {
  width: 100%;
  max-width: 380px;
}

.auth-form-card h2 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 600;
  color: var(--mint-darker);
}

.form-hint {
  margin: 0 0 28px;
  font-size: 15px;
  color: var(--text-muted);
}

.auth-form-card label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

.auth-form-card input {
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 20px;
  border: 1px solid var(--mint-border);
  border-radius: var(--radius);
  font-size: 16px;
  background: var(--mint-pale);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-form-card input::placeholder {
  color: var(--text-muted);
}

.auth-form-card input:focus {
  outline: none;
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.3);
}

.btn-primary {
  width: 100%;
  padding: 14px 20px;
  margin-top: 8px;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  background: var(--mint);
  color: var(--mint-darker);
  transition: background 0.2s, transform 0.1s;
}

.btn-primary:hover {
  background: var(--mint-light);
}

.btn-primary:active { transform: scale(0.98); }

.error {
  color: var(--error);
  font-size: 14px;
  margin: 12px 0 0;
}

.form-footer {
  margin: 24px 0 0;
  text-align: center;
  font-size: 15px;
  color: var(--text-muted);
}

.form-footer a {
  color: var(--mint-dark);
  font-weight: 600;
  text-decoration: none;
}

.form-footer a:hover { text-decoration: underline; }

/* Dashboard */
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  background: var(--white);
  border-bottom: 1px solid var(--mint-border);
  box-shadow: var(--shadow);
}

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

.header-logo-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.header-brand .header-title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: var(--mint-darker);
  letter-spacing: -0.02em;
}

.dashboard-header h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--mint-darker);
}

.main-nav {
  display: flex;
  gap: 4px;
  margin: 0 24px;
}

.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: color 0.15s, background 0.15s;
}

.nav-link:hover {
  color: var(--mint-dark);
  background: var(--mint-pale);
}

.nav-link.active {
  color: var(--mint-darker);
  background: var(--mint-border);
}

.header-actions { display: flex; gap: 10px; }

.btn-ghost {
  padding: 10px 18px;
  background: transparent;
  border: 1px solid var(--mint-border);
  border-radius: var(--radius);
  color: var(--mint-dark);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-ghost:hover {
  background: var(--mint-pale);
  border-color: var(--mint);
}

.dashboard-main {
  display: flex;
  gap: 40px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 36px 40px;
  box-sizing: border-box;
}

.boards-sidebar {
  flex-shrink: 0;
  width: 200px;
}

.board-tab-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}

.board-tab-wrapper .board-tab {
  flex: 1;
  margin-bottom: 0;
}

.board-delete-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.board-delete-btn:hover {
  color: var(--error);
  background: #fef2f2;
}

.boards-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.board-tab {
  display: block;
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 4px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.board-tab:hover {
  background: var(--mint-pale);
}

.board-tab.active {
  background: var(--mint-border);
  font-weight: 600;
  color: var(--mint-darker);
}

.board-tab.add-board {
  color: var(--text-muted);
  font-style: italic;
  margin-top: 8px;
}

.create-board-form {
  margin-top: 8px;
}

.create-board-form .input {
  margin-bottom: 8px;
  padding: 8px 12px;
  font-size: 14px;
}

.create-board-actions {
  display: flex;
  gap: 8px;
}

.create-board-actions .btn-primary { flex: 1; }

.dashboard-content {
  flex: 1;
  min-width: 0;
}

.empty-state {
  text-align: center;
  padding: 64px 32px;
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--mint-border);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.6;
}

.empty-state h3 {
  margin: 0 0 8px;
  font-size: 20px;
  color: var(--mint-darker);
}

.empty-state p {
  margin: 0;
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.5;
}

.bookmarks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

@media (max-width: 640px) {
  .dashboard-main { flex-direction: column; }
  .boards-sidebar {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }
  .boards-title { margin-bottom: 0; }
  #boards-list { display: flex; flex-wrap: wrap; gap: 4px; }
  .board-tab { width: auto; }
  .bookmarks-grid { grid-template-columns: 1fr; }
}

.bookmark-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 16px;
  border: 1px solid var(--mint-border);
  display: flex;
  gap: 16px;
  align-items: flex-start;
  cursor: pointer;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.bookmark-card:hover {
  border-color: var(--mint);
  box-shadow: var(--shadow-md);
}

.bookmark-thumb {
  width: 88px;
  height: 88px;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--mint-pale);
  flex-shrink: 0;
}

.bookmark-thumb-placeholder {
  width: 88px;
  height: 88px;
  border-radius: var(--radius);
  background: var(--mint-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--mint-dark);
  flex-shrink: 0;
}

.bookmark-info { flex: 1; min-width: 0; }

.bookmark-desc {
  font-size: 15px;
  color: var(--text);
  margin: 0 0 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bookmark-meta { font-size: 13px; color: var(--text-muted); }

.bookmark-results-count {
  color: var(--mint-dark);
  font-weight: 600;
}

.bookmark-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1;
  z-index: 1;
  border-radius: 4px;
}

.bookmark-delete:hover {
  color: var(--error);
  background: #fef2f2;
}

.bookmark-move {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--mint-border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.bookmark-move label {
  font-size: 12px;
  color: var(--text-muted);
}

.bookmark-board-select {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--mint-border);
  background: var(--white);
  cursor: pointer;
}

/* Feed search */
.feed-search-bar {
  margin-bottom: 24px;
}

.feed-search-input {
  width: 100%;
  max-width: 400px;
  padding: 12px 16px;
  font-size: 15px;
  border: 1px solid var(--mint-border);
  border-radius: var(--radius);
  background: var(--white);
  transition: border-color 0.2s;
}

.feed-search-input:focus {
  outline: none;
  border-color: var(--mint);
}

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

/* Feed & Liked */
.feed-main,
.liked-main {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 36px 40px;
  box-sizing: border-box;
}

.feed-boards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}

.feed-board-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--mint-border);
  cursor: pointer;
  transition: box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
}

.feed-board-card:hover {
  border-color: var(--mint);
  box-shadow: var(--shadow-md);
}

.feed-board-card-image {
  aspect-ratio: 1;
  background: var(--mint-pale);
  overflow: hidden;
}

.feed-board-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feed-board-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: var(--mint-dark);
}

.feed-board-card-info {
  padding: 16px;
}

.feed-board-card-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--mint-darker);
}

.feed-board-card-owner {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.feed-board-card-likes {
  margin-top: 12px;
}

.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 13px;
  border: 1px solid var(--mint-border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.like-btn:hover {
  border-color: var(--mint);
  background: var(--mint-pale);
}

.like-btn.liked {
  border-color: var(--mint);
  color: var(--mint);
}

.like-count-static {
  font-size: 13px;
  color: var(--text-muted);
}

.feed-board-view {
  margin-top: 24px;
}

.feed-board-owner {
  margin: -8px 0 20px;
  font-size: 14px;
  color: var(--text-muted);
}

.feed-bookmarks {
  margin-top: 16px;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.modal-content {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--mint-border);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  background: var(--mint-pale);
  border-radius: var(--radius);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  color: var(--mint-dark);
}

.modal-close:hover { background: var(--mint-border); }

.detail-img {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: var(--radius);
  background: var(--mint-pale);
  margin-bottom: 16px;
}

.detail-desc {
  font-size: 15px;
  margin-bottom: 20px;
  line-height: 1.5;
  color: var(--text);
}

.detail-products {
  border-top: 1px solid var(--mint-border);
  padding-top: 16px;
}

.detail-products h3 {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--mint-dark);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.result-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  margin-bottom: 8px;
  background: var(--mint-pale);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--mint-border);
  transition: border-color 0.2s;
}

.result-item:hover { border-color: var(--mint); }

.result-item img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
}

.result-item-info { flex: 1; min-width: 0; }

.result-item-name {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
}

.result-item-price {
  font-size: 12px;
  color: var(--mint-dark);
  font-weight: 600;
}
