/* =====================================================
   standard.css
   Base styles, typography, colors, variables, reset.
   ===================================================== */

/* ---- CSS Variables ---- */
:root {
  --primary:        #2563eb;
  --primary-dark:   #1d4ed8;
  --primary-light:  #dbeafe;
  --secondary:      #f59e0b;
  --secondary-dark: #d97706;
  --danger:         #ef4444;
  --danger-dark:    #dc2626;
  --success:        #22c55e;
  --bg:             #f1f5f9;
  --surface:        #ffffff;
  --text:           #1e293b;
  --text-muted:     #64748b;
  --text-light:     #94a3b8;
  --border:         #e2e8f0;
  --border-hover:   #cbd5e1;
  --shadow-sm:      0 1px 3px rgba(0,0,0,.08);
  --shadow:         0 4px 12px rgba(0,0,0,.10);
  --shadow-lg:      0 12px 32px rgba(0,0,0,.14);
  --radius:         14px;
  --radius-sm:      8px;
  --radius-xs:      6px;
  --header-h:       64px;
  --dashboard-h:    52px;
  --filter-h:       50px;
  --transition:     .2s ease;
}

/* ---- Global Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---- Utility Classes ---- */
.hidden { display: none !important; }

/* ---- Layout Container ---- */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- Main Layout ---- */
.main {
  padding-top: calc(var(--header-h) + var(--dashboard-h) + var(--filter-h) + 24px);
  padding-bottom: 60px;
  min-height: 100vh;
}

/* ---- Dashboard Header ---- */
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0;
  padding: 10px 20px;
  border-bottom: 2px solid var(--border);
}
.dashboard-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0;
  line-height: 1.1;
}
.dashboard-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  white-space: nowrap;
}
.dashboard-header.customer-mode {
  background: linear-gradient(135deg, var(--primary-light), rgba(124,58,237,.08));
  border-radius: 0;
  padding: 10px 20px;
  border: 2px solid var(--primary);
}
.dashboard-header.customer-mode .dashboard-title {
  color: var(--primary);
  font-size: 26px;
}
.dashboard-header.customer-mode .dashboard-subtitle {
  color: var(--text);
  font-weight: 500;
}

/* ---- Results Bar ---- */
.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}
.results-count {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}
.results-bar-right { display: flex; align-items: center; gap: 12px; }

.availability-toggle {
  height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition);
}

.availability-toggle:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.availability-toggle.active {
  border-color: var(--success);
  background: #dcfce7;
  color: #166534;
}

/* ---- Toggle Button ---- */
.view-toggle {
  display: flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.toggle-btn {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--transition);
}
.toggle-btn.active {
  background: var(--primary);
  color: #fff;
}
.toggle-btn:not(.active):hover { background: var(--border); color: var(--text); }

/* ---- Sort Select ---- */
.sort-select-wrap {
  position: relative;
}
.sort-select {
  appearance: none;
  -webkit-appearance: none;
  height: 34px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition);
}
.sort-select:focus { border-color: var(--primary); }

/* ---- Articles Grid ---- */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.empty-icon { font-size: 64px; margin-bottom: 16px; }
.empty-state h3 { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.empty-state p  { font-size: 15px; }

/* ---- Loading State ---- */
.loading-state {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.skeleton-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  height: 360px;
  background: linear-gradient(90deg, #f0f4f8 25%, #e8ecf0 50%, #f0f4f8 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
