/**
 * VietAZ Core - Shared Components
 * Buttons, badges, cards, forms, and reusable UI elements
 * 
 * @package VietAZ_Core
 * @version 1.0.0
 */

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.vz-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 16px;
  border-radius: var(--vz-radius);
  font-size: var(--vz-font-size-sm);
  font-weight: 500;
  border: none;
  cursor: pointer;
  background: var(--vz-bg-muted);
  color: var(--vz-text-primary);
  transition: all 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
}

.vz-btn:hover {
  background: var(--vz-border);
}

/* Sizes */
.vz-btn--xs {
  padding: 4px 8px;
  font-size: 11px;
}

.vz-btn--sm {
  padding: 6px 12px;
  font-size: var(--vz-font-size-sm);
}

.vz-btn--lg {
  padding: 12px 20px;
  font-size: var(--vz-font-size-base);
}

/* Variants */
.vz-btn--primary {
  background: var(--vz-primary);
  color: #fff;
}

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

.vz-btn--secondary {
  background: #f97316;
  color: #fff;
  border-color: #f97316;
}

.vz-btn--secondary:hover {
  background: #ea580c;
  border-color: #ea580c;
}

.vz-btn--success {
  background: var(--vz-success);
  color: #fff;
}

.vz-btn--danger {
  background: var(--vz-danger);
  color: #fff;
}

.vz-btn--danger:hover {
  background: #dc2626;
}

.vz-btn--ghost {
  background: transparent;
  color: var(--vz-text-secondary);
}

.vz-btn--ghost:hover {
  background: var(--vz-primary-soft);
  color: var(--vz-primary);
}

.vz-btn--outline {
  background: transparent;
  border-color: var(--vz-border);
}

.vz-btn--outline:hover {
  border-color: var(--vz-primary);
  color: var(--vz-primary);
}

/* States */
.vz-btn--block {
  width: 100%;
}

.vz-btn:disabled,
.vz-btn--disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* ==========================================================================
   BADGES
   ========================================================================== */

.vz-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  font-size: 0.6875rem;
  font-weight: 500;
  border-radius: var(--vz-radius);
  background: var(--vz-bg-panel);
  color: var(--vz-text-secondary);
  white-space: nowrap;
}

.vz-badge--sm {
  padding: 2px 6px;
  font-size: 10px;
}

.vz-badge--lg {
  padding: 6px 14px;
  font-size: var(--vz-font-size-sm);
}

/* Badge Colors */
.vz-badge--primary {
  background: var(--vz-primary-soft);
  color: var(--vz-primary);
  border-color: transparent;
}

.vz-badge--success {
  background: #f0fdf4;
  color: var(--vz-success);
  border-color: transparent;
}

.vz-badge--warning {
  background: #fffbeb;
  color: var(--vz-warning);
  border-color: transparent;
}

.vz-badge--danger {
  background: #fef2f2;
  color: var(--vz-danger);
  border-color: transparent;
}

.vz-badge--muted {
  background: var(--vz-bg-muted);
  color: var(--vz-text-muted);
}

.vz-badge--secondary {
  background: #ffedd5;
  color: #c2410c;
  border-color: #fdba74;
}

.vz-badge--outline {
  background: transparent;
  color: var(--vz-primary);
  border: 1px solid var(--vz-primary);
}

.vz-badge--accent {
  background: #dbeafe;
  color: var(--vz-primary);
  border-color: #bfdbfe;
}

/* Status Badges */
.vz-status {
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.vz-status--pending {
  background: #fef3c7;
  color: #92400e;
}
.vz-status--active {
  background: #d1fae5;
  color: #065f46;
}
.vz-status--expired {
  background: #fee2e2;
  color: #991b1b;
}
.vz-status--draft {
  background: #e5e7eb;
  color: #4b5563;
}

/* ==========================================================================
   CARDS
   ========================================================================== */

.vz-card {
  background: var(--vz-bg-card);
  border-radius: var(--vz-radius-lg);
  border: 1px solid var(--vz-border-light);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.vz-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.vz-card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #f1f5f9;
  overflow: hidden;
}

.vz-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vz-card__img--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 2rem;
}

.vz-card__img--empty::before {
  content: "📷";
}

.vz-card__body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.vz-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.vz-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.vz-card__title {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vz-card__title a {
  color: var(--vz-text-primary);
  text-decoration: none;
}

.vz-card__title a:hover {
  color: var(--vz-primary);
}

.vz-card__company {
  font-size: 0.8125rem;
  color: var(--vz-text-secondary);
  font-weight: 500;
  margin: 0;
}

.vz-card__verified {
  margin: 4px 0;
}

.vz-card__job-type {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--vz-primary);
  background: var(--vz-primary-soft);
  padding: 4px 10px;
  border-radius: var(--vz-radius-full);
  margin-top: 6px;
}

.vz-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--vz-text-muted);
}

.vz-card__meta span {
  display: inline-flex;
  align-items: center;
}

.vz-card__meta span:not(:last-child)::after {
  content: "•";
  margin-left: 8px;
  opacity: 0.5;
}

.vz-card__excerpt {
  font-size: 0.8125rem;
  color: var(--vz-text-muted);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vz-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding: 12px 14px;
  border-top: 1px solid var(--vz-border-light);
  background: #fafafa;
}

.vz-card__price,
.vz-card__salary {
  color: var(--vz-success);
}

.vz-card__meta {
  font-size: 0.6875rem;
  color: var(--vz-text-muted);
}

/* ==========================================================================
   FORM ELEMENTS
   ========================================================================== */

.vz-form-group {
  margin-bottom: var(--vz-space-lg);
}

.vz-label {
  display: block;
  font-size: var(--vz-font-size-base);
  font-weight: 500;
  color: var(--vz-text-primary);
  margin-bottom: var(--vz-space-sm);
}

.vz-label--required::after {
  content: " *";
  color: var(--vz-danger);
}

.vz-input,
.vz-select,
.vz-textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--vz-radius-lg);
  border: 1px solid var(--vz-border);
  background: var(--vz-bg-card);
  font-size: var(--vz-font-size-base);
  color: var(--vz-text-primary);
  transition: all 0.2s ease;
  outline: none;
}

.vz-input::placeholder,
.vz-textarea::placeholder {
  color: var(--vz-text-muted);
}

.vz-input:hover,
.vz-select:hover,
.vz-textarea:hover {
  border-color: var(--vz-border-dark);
}

.vz-input:focus,
.vz-select:focus,
.vz-textarea:focus {
  border-color: var(--vz-primary);
  box-shadow: 0 0 0 3px var(--vz-primary-soft);
}

.vz-input--error,
.vz-select--error,
.vz-textarea--error {
  border-color: var(--vz-danger);
}

.vz-input--error:focus {
  box-shadow: 0 0 0 3px #fef2f2;
}

.vz-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

.vz-textarea {
  min-height: 120px;
  resize: vertical;
}

.vz-help-text {
  font-size: var(--vz-font-size-sm);
  color: var(--vz-text-muted);
  margin-top: var(--vz-space-xs);
}

.vz-error-text {
  font-size: var(--vz-font-size-sm);
  color: var(--vz-danger);
  margin-top: var(--vz-space-xs);
}

/* ==========================================================================
   ALERTS
   ========================================================================== */

.vz-alert {
  padding: var(--vz-space-md) var(--vz-space-lg);
  border-radius: var(--vz-radius);
  font-size: var(--vz-font-size-base);
  line-height: 1.5;
  border-left: 4px solid;
}

.vz-alert--success {
  background: #f0fdf4;
  border-color: var(--vz-success);
  color: #166534;
}

.vz-alert--error {
  background: #fef2f2;
  border-color: var(--vz-danger);
  color: #991b1b;
}

.vz-alert--warning {
  background: #fffbeb;
  border-color: var(--vz-warning);
  color: #92400e;
}

.vz-alert--info {
  background: #f0f9ff;
  border-color: var(--vz-info);
  color: #075985;
}

.vz-alert p {
  margin: var(--vz-space-xs) 0;
}

.vz-alert p:first-child {
  margin-top: 0;
}

.vz-alert p:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   PANELS / SECTIONS
   ========================================================================== */

.vz-panel {
  background: var(--vz-bg-card);
  border: 1px solid var(--vz-border-light);
  border-radius: var(--vz-radius-lg);
  padding: var(--vz-space-lg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.vz-panel--compact {
  padding: var(--vz-space-md);
}

.vz-panel--filters {
  margin-bottom: var(--vz-space-lg);
}

.vz-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--vz-space-sm);
  margin-bottom: var(--vz-space-md);
}

.vz-panel__title {
  font-size: var(--vz-font-size-base);
  font-weight: 600;
  margin: 0;
  color: var(--vz-text-primary);
}

/* ==========================================================================
   LIST
   ========================================================================== */

.vz-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.vz-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--vz-border-light);
  font-size: var(--vz-font-size-sm);
}

.vz-list li:first-child {
  padding-top: 0;
}

.vz-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.vz-list a {
  color: var(--vz-text-secondary);
  text-decoration: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
  padding: 6px 10px;
  margin: -6px -10px;
  border-radius: var(--vz-radius);
}

.vz-list a:hover {
  color: var(--vz-primary);
  background: var(--vz-primary-soft);
}

.vz-list span {
  font-size: var(--vz-font-size-sm);
  color: var(--vz-text-muted);
  background: var(--vz-bg-muted);
  padding: 2px 8px;
  border-radius: var(--vz-radius-full);
}

/* ==========================================================================
   EMPTY STATE
   ========================================================================== */

.vz-empty {
  text-align: center;
  padding: var(--vz-space-2xl);
  background: var(--vz-bg-card);
  border: 2px dashed var(--vz-border);
  border-radius: var(--vz-radius-lg);
}

.vz-empty__icon {
  font-size: 48px;
  margin-bottom: var(--vz-space-lg);
  opacity: 0.5;
}

.vz-empty__title {
  font-size: var(--vz-font-size-xl);
  font-weight: 600;
  color: var(--vz-text-primary);
  margin: 0 0 var(--vz-space-sm);
}

.vz-empty__desc {
  color: var(--vz-text-secondary);
  margin: 0 0 var(--vz-space-lg);
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */

.vz-pagination {
  display: flex;
  justify-content: center;
  gap: var(--vz-space-xs);
  margin: var(--vz-space-xl) 0;
}

.vz-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 var(--vz-space-md);
  border-radius: var(--vz-radius-full);
  border: 1px solid transparent;
  color: var(--vz-text-muted);
  font-weight: 500;
  transition: all var(--vz-transition);
}

.vz-pagination .page-numbers:hover:not(.current) {
  border-color: var(--vz-border);
  background: var(--vz-primary-soft);
  color: var(--vz-primary);
}

.vz-pagination .page-numbers.current {
  background: linear-gradient(
    135deg,
    var(--vz-primary),
    var(--vz-primary-hover)
  );
  color: #fff;
}

/* ==========================================================================
   PRICE DISPLAY
   ========================================================================== */

.vz-price {
  font-size: var(--vz-font-size-base);
  font-weight: 600;
  color: var(--vz-danger);
}

.vz-price--lg {
  font-size: var(--vz-font-size-lg);
}

.vz-price--muted {
  color: var(--vz-text-muted);
  font-weight: 600;
}

/* ==========================================================================
   GRID LAYOUT
   ========================================================================== */

.vz-grid {
  display: grid;
  gap: var(--vz-space-md);
  grid-template-columns: repeat(1, 1fr);
}

@media (min-width: 640px) {
  .vz-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .vz-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.vz-grid--2 {
  grid-template-columns: repeat(2, 1fr);
}
.vz-grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

/* ==========================================================================
   CONTAINER
   ========================================================================== */

.vz-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--vz-space-lg);
}

.vz-container--sm {
  max-width: 720px;
}
.vz-container--md {
  max-width: 960px;
}
.vz-container--lg {
  max-width: 1400px;
}

/* ==========================================================================
   PAGE LAYOUT
   ========================================================================== */

.vz-page {
  background: var(--vz-bg-page);
  min-height: 100vh;
  padding-bottom: var(--vz-space-2xl);
}

/* ==========================================================================
   PAGE HEADER - Modern Compact Style
   ========================================================================== */

.vz-page-header {
  padding: var(--vz-space-lg) 0 var(--vz-space-md);
}

.vz-page-header__main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.vz-page-header__badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.vz-page-header__badge--jobs {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.vz-page-header__badge--adverts {
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #fff;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

.vz-page-header__title {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 800;
  margin: 0;
  color: var(--vz-text-primary);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.vz-page-header__tagline {
  margin: 8px 0 0;
  font-size: 15px;
  color: var(--vz-text-muted);
  font-weight: 400;
}

/* Jobs color accent */
.vz-page-header--jobs .vz-page-header__title {
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Adverts color accent */
.vz-page-header--adverts .vz-page-header__title {
  background: linear-gradient(135deg, #c2410c, #f97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ==========================================================================
   FILTERS
   ========================================================================== */

.vz-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--vz-space-md);
  align-items: flex-end;
}

.vz-field {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 140px;
}

.vz-field--actions {
  flex-direction: row;
  gap: var(--vz-space-sm);
  flex: 0 0 auto;
}

.vz-label {
  font-size: var(--vz-font-size-sm);
  font-weight: 500;
  color: var(--vz-text-secondary);
  margin-bottom: var(--vz-space-sm);
}

.vz-input,
.vz-select {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--vz-radius);
  border: 1px solid var(--vz-border);
  background: var(--vz-bg-card);
  font-size: var(--vz-font-size-sm);
  color: var(--vz-text-primary);
  transition: all 0.15s ease;
  outline: none;
}

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

.vz-input:hover,
.vz-select:hover {
  border-color: var(--vz-primary);
}

.vz-input:focus,
.vz-select:focus {
  border-color: var(--vz-primary);
  box-shadow: 0 0 0 3px var(--vz-primary-soft);
}

.vz-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

/* ==========================================================================
   TWO-COLUMN LAYOUT
   ========================================================================== */

.vz-layout {
  display: grid;
  gap: var(--vz-space-lg);
  grid-template-columns: 1fr;
}

@media (min-width: 1024px) {
  .vz-layout {
    grid-template-columns: 1fr 280px;
  }
}

.vz-layout__main,
.vz-layout__side {
  min-width: 0;
}

/* ==========================================================================
   META INFO
   ========================================================================== */

.vz-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--vz-space-md);
  font-size: var(--vz-font-size-sm);
  color: var(--vz-text-secondary);
}

.vz-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
