/* ============================================================
   notes.css – Konspektebi Marketplace Styles
   Matches konspektebi.ge visual language (Georgian edu site)
   ============================================================ */

/* ── CSS Variables ────────────────────────────────────────── */
:root {
  --primary:      #2563eb;
  --primary-dark: #1d4ed8;
  --accent:       #f59e0b;
  --success:      #16a34a;
  --danger:       #dc2626;
  --bg:           #f8fafc;
  --surface:      #ffffff;
  --border:       #e2e8f0;
  --text:         #1e293b;
  --text-muted:   #64748b;
  --radius:       12px;
  --shadow:       0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-lg:    0 8px 30px rgba(0,0,0,.12);
  --transition:   .2s ease;
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── Layout ───────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.page-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: 3rem 1.5rem;
  text-align: center;
}

.page-header h1 { font-size: clamp(1.6rem, 4vw, 2.5rem); margin-bottom: .5rem; }
.page-header p  { opacity: .85; font-size: 1.05rem; }

/* ── Filter Bar ───────────────────────────────────────────── */
.filter-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
}

.filter-bar select,
.filter-bar input {
  padding: .45rem .85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .9rem;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--transition);
}

.filter-bar select:focus,
.filter-bar input:focus {
  outline: none;
  border-color: var(--primary);
}

.filter-bar .search-input { flex: 1; min-width: 180px; }

.filter-bar .btn-reset {
  padding: .45rem 1rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .9rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition);
}

.filter-bar .btn-reset:hover { background: var(--bg); color: var(--text); }

/* ── Notes Grid ───────────────────────────────────────────── */
.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  padding: 2rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* ── Note Card ────────────────────────────────────────────── */
.note-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}

.note-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.note-card__cover {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.note-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.note-card__body { padding: 1rem 1.1rem; flex: 1; display: flex; flex-direction: column; }

.note-card__subject {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: .35rem;
}

.note-card__title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: .5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.note-card__author {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: auto;
  padding-bottom: .75rem;
}

.note-card__author img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}

.note-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
  margin-top: .75rem;
}

.note-card__price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
}

.note-card__price .currency { font-size: .8rem; font-weight: 600; }

/* ── Star Rating ──────────────────────────────────────────── */
.stars {
  display: inline-flex;
  gap: 1px;
  font-size: .95rem;
  line-height: 1;
}

.star-filled  { color: var(--accent); }
.star-empty   { color: #cbd5e1; }

.rating-text {
  font-size: .78rem;
  color: var(--text-muted);
  margin-left: .3rem;
}

/* ── Loading / Empty States ───────────────────────────────── */
.state-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 1.5rem;
  color: var(--text-muted);
  gap: 1rem;
  grid-column: 1 / -1;
}

.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* ── Toggle Switch ────────────────────────────────────────── */
.toggle-switch { position:relative; display:inline-block; width:44px; height:24px; cursor:pointer; }
.toggle-switch input { opacity:0; width:0; height:0; }
.toggle-track {
  position:absolute; inset:0; border-radius:99px;
  background:var(--border); transition:background .2s;
}
.toggle-track::after {
  content:''; position:absolute; top:3px; left:3px;
  width:18px; height:18px; border-radius:50%;
  background:#fff; transition:transform .2s;
  box-shadow:0 1px 3px rgba(0,0,0,.2);
}
.toggle-switch input:checked + .toggle-track { background:var(--primary); }
.toggle-switch input:checked + .toggle-track::after { transform:translateX(20px); }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Product Detail Page ──────────────────────────────────── */
.product-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1.5rem 3rem;
}

.product-main {}

.product-sidebar {
  position: sticky;
  top: 80px;
  align-self: start;
}

/* Purchase Card */
.purchase-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.purchase-card__preview {
  position: relative;
  background: #f1f5f9;
  aspect-ratio: 3/4;
  overflow: hidden;
}

.purchase-card__preview img { width: 100%; height: 100%; object-fit: cover; }

.watermark-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.watermark-overlay span {
  font-size: 2rem;
  font-weight: 900;
  color: rgba(255,255,255,.35);
  transform: rotate(-35deg);
  text-transform: uppercase;
  letter-spacing: .15em;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0,0,0,.3);
}

.purchase-card__info { padding: 1.25rem; }

.price-tag {
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 1rem;
}

.btn {
  display: block;
  width: 100%;
  padding: .85rem 1rem;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-primary:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

.btn-success { background: var(--success); color: #fff; }

.purchase-meta {
  margin-top: .9rem;
  font-size: .82rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.purchase-meta span::before { margin-right: .4rem; }

/* Product Info */
.product-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: .75rem;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.25rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: .3rem .75rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  background: #dbeafe;
  color: var(--primary);
}

.author-block {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: 1.1rem;
  background: var(--bg);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
}

.author-block img {
  width: 52px; height: 52px;
  border-radius: 50%;
  object-fit: cover;
  background: #dbeafe;
}

.author-block__info strong { display: block; font-size: .95rem; }
.author-block__info span  { font-size: .83rem; color: var(--text-muted); }

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--border);
}

.description-text { color: var(--text-muted); line-height: 1.8; }

/* ── Reviews ──────────────────────────────────────────────── */
.reviews-section { margin-top: 2.5rem; }

.review-form {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.75rem;
}

.review-form h3 { margin-bottom: 1rem; font-size: 1rem; }

.star-picker {
  display: flex;
  gap: .4rem;
  font-size: 1.6rem;
  margin-bottom: 1rem;
  cursor: pointer;
}

.star-picker .sp-star { color: #cbd5e1; transition: color var(--transition); }
.star-picker .sp-star.active,
.star-picker .sp-star:hover { color: var(--accent); }

.review-form textarea {
  width: 100%;
  padding: .7rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  resize: vertical;
  font-family: inherit;
  font-size: .9rem;
  min-height: 80px;
  margin-bottom: .75rem;
  background: var(--surface);
}

.review-form textarea:focus { outline: none; border-color: var(--primary); }

.review-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.review-item:last-child { border-bottom: none; }

.review-header {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: .5rem;
}

.review-header img {
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: #dbeafe;
}

.review-header strong { font-size: .9rem; }
.review-header .review-date { font-size: .78rem; color: var(--text-muted); margin-left: auto; }

.review-comment { font-size: .9rem; color: var(--text-muted); line-height: 1.6; }

/* ── Toast Notification ───────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: .8rem 1.4rem;
  border-radius: 10px;
  background: var(--text);
  color: #fff;
  font-size: .9rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  transform: translateY(6px);
  opacity: 0;
  transition: all .3s ease;
  z-index: 9999;
  pointer-events: none;
  max-width: 320px;
}

.toast.show  { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }

/* ── Preview Image Slider ─────────────────────────────────── */
.preview-slider {
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2rem;
  background: #f8fafc;
  border: 1px solid var(--border);
}

.preview-slider--single img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: contain;
  display: block;
}

.preview-slider__track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.preview-slider__track::-webkit-scrollbar { display: none; }

.preview-slide {
  flex-shrink: 0;
  width: 100%;
  scroll-snap-align: start;
  aspect-ratio: 3/4;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
}
.preview-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.92);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px; height: 36px;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow .15s, opacity .15s;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  color: var(--text);
}
.slider-btn:hover   { box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.slider-btn:disabled { opacity: .25; cursor: default; pointer-events: none; }
.slider-btn--prev   { left: .6rem; }
.slider-btn--next   { right: .6rem; }

.slider-dots {
  position: absolute;
  bottom: .65rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: .4rem;
}
.slider-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.22);
  cursor: pointer;
  padding: 0;
  transition: background .2s, transform .2s;
}
.slider-dot.active {
  background: var(--primary);
  transform: scale(1.35);
}

.preview-slider-empty {
  width: 100%;
  aspect-ratio: 3/4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  border-radius: var(--radius);
  margin-bottom: 2rem;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .product-layout {
    grid-template-columns: 1fr;
  }

  .product-sidebar {
    position: static;
    order: -1; /* sidebar goes above on mobile */
  }

  .filter-bar { gap: .5rem; }
}
