/* ===== Praca.ua Dashboard Blocks v5 — Snap Preview ===== */
/* CSS isolation: all classes prefixed with db- */

/* ── Snap Container ── */
.db-snap-container {
  position: relative;
  display: flex;
  flex-direction: column;
  scroll-snap-type: y mandatory;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  height: auto;
  max-height: none;
  gap: 6px;
  padding: 6px 0 28px;
}

/* ── Snap Section (one per block) ── */
.db-snap-section {
  scroll-snap-align: start;
  scroll-snap-stop: always;
  min-height: 38vh;
  display: flex;
  flex-direction: column;
  padding: 14px 12px 10px;
  margin: 2px 6px;
  border-radius: 16px;
  background: #181828;
  border: 1px solid rgba(255,255,255,0.06);
  position: relative;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.db-snap-section.is-active {
  border-color: rgba(242,106,74,0.3);
  box-shadow: 0 0 24px rgba(242,106,74,0.06);
}

/* ── Tier-specific ── */
.db-snap-section.tier-hero {
  border-left: 3px solid #F26A4A;
  background: linear-gradient(135deg, rgba(242,106,74,0.08), rgba(242,106,74,0.02));
}

.db-snap-section.tier-hot {
  border-left: 3px solid #F39C12;
  background: linear-gradient(135deg, rgba(243,156,18,0.06), rgba(243,156,18,0.01));
}

.db-snap-section.tier-premium {
  border-left: 3px solid #8B5CF6;
  background: linear-gradient(135deg, rgba(139,92,246,0.06), rgba(139,92,246,0.01));
}

.db-snap-section.tier-standard {
  border-left: 2px solid rgba(255,255,255,0.1);
}

/* ── Compact mode (stats, actions, ad) ── */
.db-snap-section.mode-compact {
  min-height: auto;
  padding: 12px 14px;
}

.db-snap-section.mode-hscroll {
  min-height: auto;
  padding: 12px 14px;
}

/* ── Block Header ── */
.db-block-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.db-block-icon {
  font-size: 22px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(242,106,74,0.1);
  border-radius: 10px;
  flex-shrink: 0;
}

.db-block-title {
  font-size: 1rem;
  font-weight: 700;
  color: #f0f0f0;
  line-height: 1.2;
}

/* ── Content Area (main vacancy) ── */
.db-content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.db-skeleton {
  height: 120px;
  background: linear-gradient(90deg, #1e1e30 25%, #2a2a3e 50%, #1e1e30 75%);
  background-size: 200% 100%;
  animation: db-shimmer 1.5s ease-in-out infinite;
  border-radius: 12px;
}

@keyframes db-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ── Preview Area (second job) ── */
.db-preview-area {
  display: none;
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  border: 1px dashed rgba(255,255,255,0.08);
  font-size: 0.78rem;
  color: #a0a0b0;
}

.db-preview-area .db-job-item {
  padding: 6px 8px;
  background: transparent;
}

.db-preview-area .db-job-title {
  font-size: 0.78rem;
}

.db-preview-area .db-job-salary {
  font-size: 0.72rem;
}

/* ── View All link ── */
.db-view-all-link {
  display: block;
  text-align: center;
  padding: 10px 0 2px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #F26A4A;
  text-decoration: none;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.db-view-all-link:hover {
  text-decoration: underline;
}

/* ── Progress Bar ── */
.db-snap-progress {
  position: fixed;
  bottom: 60px;
  left: 12px;
  right: 12px;
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  z-index: 100;
  pointer-events: none;
}

.db-snap-progress-bar {
  height: 100%;
  background: #F26A4A;
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0%;
}

/* ── Counter ── */
.db-snap-counter {
  position: fixed;
  bottom: 68px;
  right: 14px;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  z-index: 100;
  pointer-events: none;
  background: rgba(0,0,0,0.5);
  padding: 2px 8px;
  border-radius: 10px;
}

/* ── Job items (inside content area) ── */
.db-block-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.db-job-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.04);
  border-radius: 12px;
  text-decoration: none;
  color: #f0f0f0;
  min-height: 44px;
  justify-content: center;
  transition: background 0.15s;
}

.db-job-item:hover {
  background: rgba(255,255,255,0.08);
}

.db-job-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: #f0f0f0;
  line-height: 1.3;
}

.db-job-salary {
  font-size: 0.85rem;
  color: #F26A4A;
  font-weight: 700;
  margin-top: 2px;
}

.db-job-loc {
  font-size: 0.75rem;
  color: #a0a0b0;
}

.db-job-company {
  font-size: 0.75rem;
  color: #a0a0b0;
}

/* ── Stats items ── */
.db-stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  font-size: 0.85rem;
}

.db-stat-title {
  color: #f0f0f0;
}

.db-stat-salary {
  color: #F26A4A;
  font-weight: 600;
}

/* ── Company items ── */
.db-company-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  text-decoration: none;
  color: #f0f0f0;
  font-size: 0.85rem;
  font-weight: 500;
  min-height: 44px;
}

.db-company-item:hover {
  background: rgba(255,255,255,0.08);
}

/* ── Quick actions ── */
.db-quick-actions {
  display: flex;
  gap: 8px;
}

.db-action-btn {
  flex: 1;
  display: block;
  text-align: center;
  padding: 12px 10px;
  background: #F26A4A;
  color: #fff;
  border-radius: 10px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.15s;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.db-action-btn:hover {
  background: #d44a39;
}

/* ── Empty state ── */
.db-empty {
  font-size: 0.82rem;
  color: #8a8a9e;
  text-align: center;
  padding: 12px 0;
}

/* ══════════════════════════════════════════════
   LIGHT THEME
   ══════════════════════════════════════════════ */
.light-theme .db-snap-section,
body:not(.dark-theme):not([data-theme="dark"]) .db-snap-section {
  background: #ffffff;
  border: 1px solid #e8eaed;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.light-theme .db-block-title,
body:not(.dark-theme):not([data-theme="dark"]) .db-block-title {
  color: #1a1a2e;
}

.light-theme .db-job-title,
body:not(.dark-theme):not([data-theme="dark"]) .db-job-title {
  color: #1a1a2e;
}

.light-theme .db-job-loc,
.light-theme .db-job-company,
body:not(.dark-theme):not([data-theme="dark"]) .db-job-loc,
body:not(.dark-theme):not([data-theme="dark"]) .db-job-company {
  color: #6b7280;
}

.light-theme .db-job-item,
body:not(.dark-theme):not([data-theme="dark"]) .db-job-item {
  background: #f3f4f6;
}

.light-theme .db-job-item:hover,
body:not(.dark-theme):not([data-theme="dark"]) .db-job-item:hover {
  background: #e5e7eb;
}

.light-theme .db-stat-item,
.light-theme .db-company-item,
body:not(.dark-theme):not([data-theme="dark"]) .db-stat-item,
body:not(.dark-theme):not([data-theme="dark"]) .db-company-item {
  background: #f3f4f6;
}

.light-theme .db-stat-title,
body:not(.dark-theme):not([data-theme="dark"]) .db-stat-title {
  color: #1a1a2e;
}

.light-theme .db-skeleton,
body:not(.dark-theme):not([data-theme="dark"]) .db-skeleton {
  background: linear-gradient(90deg, #f0f0f3 25%, #e0e0e5 50%, #f0f0f3 75%);
  background-size: 200% 100%;
}

.light-theme .db-preview-area,
body:not(.dark-theme):not([data-theme="dark"]) .db-preview-area {
  background: #f9fafb;
  border-color: #e5e7eb;
  color: #6b7280;
}

.light-theme .db-block-icon,
body:not(.dark-theme):not([data-theme="dark"]) .db-block-icon {
  background: rgba(242,106,74,0.08);
}

/* ══════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════ */

/* Desktop: wider sections, centered */
@media (min-width: 768px) {
  .db-snap-section {
    max-width: 600px;
    margin: 2px auto;
    min-height: 40vh;
    padding: 20px 24px 14px;
  }

  .db-snap-progress {
    left: calc(50% - 290px);
    right: calc(50% - 290px);
  }

  .db-snap-counter {
    right: calc(50% - 270px);
  }
}

/* Tablet */
@media (min-width: 481px) and (max-width: 767px) {
  .db-snap-section {
    min-height: 35vh;
  }
}

/* Mobile 720p */
@media (max-width: 480px) {
  .db-snap-section {
    min-height: 35vh;
    margin: 2px 4px;
    padding: 12px 10px 8px;
    border-radius: 14px;
  }

  .db-block-icon {
    font-size: 20px;
    width: 34px;
    height: 34px;
  }

  .db-block-title {
    font-size: 0.92rem;
  }

  .db-job-title {
    font-size: 0.85rem;
  }

  .db-job-salary {
    font-size: 0.8rem;
  }

  .db-snap-progress {
    bottom: 56px;
  }

  .db-snap-counter {
    bottom: 64px;
  }
}

/* Very small screens */
@media (max-width: 360px) {
  .db-snap-section {
    min-height: 30vh;
    padding: 10px 8px 6px;
  }
}
