/* Specs Overlay Styles */

:root {
  --spec-gold: #8C6A2A;
  --spec-gold-light: #F4E8D2;
  --spec-gold-dark: #6E5A45;
  --spec-bg-glass: rgba(251, 247, 240, 0.95);
  --spec-border: rgba(140, 106, 42, 0.3);
}

/* Base body adjustments when spec mode is on */
body.spec-mode-active {
  padding-bottom: 60px; /* Space for the bottom spec toolbar */
}

/* Floating Toolbar */
.spec-toolbar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(46, 36, 27, 0.95);
  backdrop-filter: blur(10px);
  border-top: 2px solid var(--spec-gold);
  color: #fff;
  z-index: 99999;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.spec-toolbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.spec-toolbar-brand .badge {
  background: var(--spec-gold);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
  letter-spacing: 0.05em;
}

.spec-toolbar-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--spec-gold-light);
}

.spec-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.spec-btn {
  background: transparent;
  border: 1px solid var(--spec-gold);
  color: var(--spec-gold-light);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.spec-btn:hover {
  background: var(--spec-gold);
  color: #fff;
  box-shadow: 0 0 10px rgba(140, 106, 42, 0.4);
}

.spec-btn.primary {
  background: var(--spec-gold);
  color: #fff;
  border-color: var(--spec-gold);
}

.spec-btn.primary:hover {
  background: #a37c35;
}

/* Toggle Switch */
.spec-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  cursor: pointer;
}

.spec-switch input {
  display: none;
}

.spec-slider {
  width: 40px;
  height: 20px;
  background-color: #555;
  border-radius: 20px;
  position: relative;
  transition: .3s;
}

.spec-slider:before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  border-radius: 50%;
  transition: .3s;
}

.spec-switch input:checked + .spec-slider {
  background-color: var(--spec-gold);
}

.spec-switch input:checked + .spec-slider:before {
  transform: translateX(20px);
}

/* Inline Spec Card */
.spec-inline-card {
  border: 2px dashed var(--spec-gold);
  background: var(--spec-bg-glass);
  border-radius: 12px;
  padding: 18px;
  margin: 15px 0;
  box-shadow: 0 4px 15px rgba(140, 106, 42, 0.1);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #2e241b;
  position: relative;
  transition: all 0.3s ease;
  z-index: 10;
  display: none;
  animation: fadeInSpec 0.4s ease forwards;
}

body.spec-mode-on .spec-inline-card {
  display: block;
}

/* Minimal empty image frame — shown only where a real image is still needed */
.spec-placeholder {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  min-height: 170px;
  padding: 22px 18px;
  border: 2px dashed var(--spec-gold);
  border-radius: 14px;
  background: var(--spec-bg-glass);
  color: #4a3c2b;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0 0 16px;
  grid-column: 1 / -1;
  z-index: 5;
  animation: fadeInSpec 0.4s ease forwards;
}

body.spec-mode-on .spec-placeholder {
  display: flex;
}

.spec-ph-icon { font-size: 1.9rem; opacity: 0.65; line-height: 1; }
.spec-ph-title { font-weight: 700; font-size: 0.95rem; line-height: 1.35; max-width: 34ch; }
.spec-ph-size { font-size: 0.8rem; color: #7a6547; }
.spec-ph-file {
  font-size: 0.72rem;
  color: #8a6a1f;
  background: rgba(140, 106, 42, 0.1);
  padding: 2px 8px;
  border-radius: 6px;
}

/* Compact size label inside empty review / case image slots */
.spec-ph-mini { display: none; }
body.spec-mode-on .spec-ph-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  position: absolute;
  inset: 0;
  z-index: 2;
  text-align: center;
  padding: 12px;
  color: #7a6547;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  pointer-events: none;
}
.spec-ph-mini .spec-ph-icon { font-size: 1.5rem; opacity: 0.55; line-height: 1; }
.spec-ph-mini .spec-ph-size { font-weight: 700; font-size: 0.85rem; color: #4a3c2b; }
.spec-ph-mini .spec-ph-sub { font-size: 0.72rem; color: #7a6547; }

@keyframes fadeInSpec {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.spec-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--spec-border);
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.spec-card-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--spec-gold-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.spec-card-badge {
  background: var(--spec-gold-light);
  border: 1px solid var(--spec-gold);
  color: var(--spec-gold-dark);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: bold;
}

.spec-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 768px) {
  .spec-card-grid {
    grid-template-columns: 1fr;
  }
}

.spec-card-item {
  font-size: 0.85rem;
  line-height: 1.4;
}

.spec-card-item strong {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6e5a45;
  margin-bottom: 3px;
}

.spec-card-item code {
  background: #f0e7d5;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.8rem;
  color: #a05a00;
}

/* Sidebar Drawer styling */
.spec-drawer {
  position: fixed;
  top: 0;
  right: -550px;
  width: 500px;
  max-width: 90%;
  height: 100%;
  background: #fff;
  box-shadow: -5px 0 25px rgba(0,0,0,0.15);
  z-index: 100000;
  transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  color: #333;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.spec-drawer.is-open {
  right: 0;
}

.spec-drawer-header {
  padding: 20px;
  background: var(--spec-gold-dark);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.spec-drawer-header h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
}

.spec-drawer-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 5px;
  line-height: 1;
}

.spec-drawer-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  background: #fcfbfa;
}

/* Checklist and Progress */
.spec-progress-container {
  background: #f4e8d2;
  border: 1px solid var(--spec-border);
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.spec-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: bold;
  color: var(--spec-gold-dark);
  margin-bottom: 6px;
}

.spec-progress-bar-bg {
  height: 10px;
  background: rgba(0,0,0,0.06);
  border-radius: 5px;
  overflow: hidden;
}

.spec-progress-bar {
  height: 100%;
  background: var(--spec-gold);
  width: 0%;
  transition: width 0.4s ease;
}

/* Tabs inside drawer */
.spec-tabs {
  display: flex;
  gap: 5px;
  border-bottom: 2px solid var(--spec-gold-light);
  margin-bottom: 15px;
  overflow-x: auto;
  padding-bottom: 5px;
}

.spec-tab-btn {
  background: transparent;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: #6e5a45;
  border-radius: 6px 6px 0 0;
  white-space: nowrap;
}

.spec-tab-btn.active {
  background: var(--spec-gold-light);
  color: var(--spec-gold-dark);
  border-bottom: 2px solid var(--spec-gold);
}

/* Checklist items */
.spec-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.spec-list-item {
  background: #fff;
  border: 1px solid #eadecc;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
  transition: background 0.2s ease;
}

.spec-list-item:hover {
  background: #faf7f2;
}

.spec-list-item.checked {
  border-color: #d4c19d;
  background: #fbf9f5;
}

.spec-list-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--spec-gold);
  cursor: pointer;
  margin-top: 2px;
}

.spec-list-content {
  flex: 1;
}

.spec-list-title {
  font-weight: bold;
  font-size: 0.9rem;
  color: #2e241b;
  margin-bottom: 4px;
}

.spec-list-details {
  font-size: 0.8rem;
  color: #555;
  line-height: 1.4;
}

.spec-list-details strong {
  color: #222;
}

.spec-list-tag {
  display: inline-block;
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: #eadecc;
  color: #6e5a45;
  font-weight: bold;
  margin-top: 4px;
}

.spec-list-tag.priority-high {
  background: #f2dede;
  color: #a94442;
}

/* Highlight styles when overlay is on */
.spec-highlight-element {
  outline: 2px dashed var(--spec-gold) !important;
  outline-offset: 2px !important;
  position: relative !important;
}

/* Floating overlay hint on sections */
.spec-floating-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--spec-gold);
  color: #fff;
  padding: 3px 8px;
  font-size: 0.75rem;
  border-radius: 4px;
  font-weight: bold;
  z-index: 100;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Backdrop */
.spec-drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.4);
  z-index: 9999;
  display: none;
}

.spec-drawer-backdrop.is-open {
  display: block;
}

/* Notification banner for Cloudflare deploy context */
.spec-deploy-banner {
  background: #fff3cd;
  border: 1px solid #ffeeba;
  color: #856404;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.85rem;
  line-height: 1.4;
}
