/* Custom styles for Vacancies Searcher */

.sticky-top {
    top: 20px;
}

.card {
    background: var(--color-surface);
    border: 1px solid rgba(0, 0, 0, 0.125);
}

.card-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

.prompt-editor-container {
    min-height: 80vh;
}

.test-panel {
    background-color: var(--color-surface-2);
    border-left: 3px solid var(--brand-primary);
}

.placeholder-reference {
    font-size: 0.875rem;
}

.placeholder-reference code {
    background-color: var(--color-surface-2);
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
}

.test-result {
    background-color: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: 0.375rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.navbar-brand {
    font-weight: bold;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 0.375rem;
}

.btn {
    border-radius: 0.375rem;
}

.form-control, .form-select {
    border-radius: 0.375rem;
}

.alert {
    border-radius: 0.375rem;
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Prompt cards */
.prompt-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.prompt-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Code highlighting */
pre {
    background-color: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: 0.375rem;
    padding: 1rem;
    overflow-x: auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sticky-top {
        position: relative !important;
        top: auto !important;
    }
    
    .prompt-editor-container {
        min-height: auto;
    }
}

/* Custom button variants */
.btn-outline-primary:hover {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.btn-outline-success:hover {
    background-color: var(--color-success);
    border-color: var(--color-success);
}

.btn-outline-info:hover {
    background-color: var(--color-info);
    border-color: var(--color-info);
}

/* Form improvements */
.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-text {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* Table improvements */
.table {
    border-radius: 0.375rem;
    overflow: hidden;
}

.table thead th {
    border-bottom: 2px solid var(--color-border);
    font-weight: 600;
}

/* Footer */
footer {
    margin-top: auto;
}

/* Utility classes */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* Suggestions list Material 3 styling */
.suggestions-list.m3 { border-color: var(--color-text); border-width: 2px; border-radius: 14px; box-shadow: 0 8px 20px rgba(0,0,0,0.08); }
.suggestions-list.m3 li { font-size: 0.95rem; }

/* Suggestions list base (match landing) */
.suggestions-list.hidden { display: none; }
.suggestions-list { position: absolute; top: 100%; left: 0; right: 0; width: 100%; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); margin-top: 4px; list-style: none; padding: 4px 0; z-index: 1000; max-height: 260px; overflow-y: auto; overflow-x: hidden; box-sizing: border-box; }
.suggestions-list li { padding: 8px 12px; cursor: pointer; color: var(--color-text); }
.suggestions-list li:hover { background: var(--color-surface-hover); }
.suggestions-list li.active { background: var(--color-surface-hover); }
.suggestions-list li.loading { cursor: default; color: var(--color-text-muted-2); display: flex; align-items: center; gap: 8px; }
.mini-spinner { width: 14px; height: 14px; border: 2px solid var(--color-border-strong); border-top-color: var(--brand-primary); border-radius: 50%; display: inline-block; animation: mini-spin 0.8s linear infinite; }
@keyframes mini-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Ensure pill inputs span container width so suggestions match field width */
.form-control-pill { width: 100%; }
.pill-input { display: inline-flex; align-items: center; position: relative; }
.form-control-pill { border-radius: 9999px !important; border: 2px solid var(--color-text); padding: 6px 12px; line-height: 1; box-shadow: none; padding-right: 34px; min-height: 48px;}
.form-control-pill:focus { outline: none; border-color: var(--color-text); box-shadow: 0 0 0 3px rgba(17,24,39,0.08); }
.form-control-pill input {min-height: 28px;}

/* Dual range slider (salary) */
.dual-range { position: relative; padding: 28px 0 8px; }
.dual-range .range-track { position: relative; height: 6px; background: var(--color-border); border-radius: 9999px; }
.dual-range .range-progress { position: absolute; height: 6px; top: 0; left: 0; width: 0; background: var(--brand-primary); border-radius: 9999px; opacity: 0.25; }
.dual-range input[type=range] { position: absolute; left: 0; right: 0; top: -6px; width: 100%; height: 18px; pointer-events: none; background: none; margin: 0; -webkit-appearance: none; }
.dual-range input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 18px; height: 18px; background: var(--brand-primary); border: 2px solid #fff; border-radius: 50%; box-shadow: 0 2px 6px rgba(0,0,0,0.2); }
.dual-range input[type=range]::-moz-range-thumb { pointer-events: auto; width: 18px; height: 18px; background: var(--brand-primary); border: 2px solid #fff; border-radius: 50%; box-shadow: 0 2px 6px rgba(0,0,0,0.2); }
.dual-range input[type=range]::-ms-thumb { pointer-events: auto; width: 18px; height: 18px; background: var(--brand-primary); border: 2px solid #fff; border-radius: 50%; box-shadow: 0 2px 6px rgba(0,0,0,0.2); }
.dual-range input[type=range]::-webkit-slider-runnable-track { height: 6px; background: transparent; }
.dual-range input[type=range]::-moz-range-track { height: 6px; background: transparent; }
.dual-range input[type=range]::-ms-track { height: 6px; background: transparent; border-color: transparent; color: transparent; }
.dual-range .range-flag { position: absolute; top: -8px; transform: translate(-50%, -100%); background: var(--color-surface); border: 1px solid var(--color-border); padding: 2px 8px; border-radius: 9999px; font-size: 0.8rem; color: var(--color-text-strong); white-space: nowrap; box-shadow: var(--shadow-sm); }
.dual-range .range-flag::after { content: ''; position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); width: 8px; height: 8px; background: var(--color-surface); border-left: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); transform: translateX(-50%) rotate(45deg); }
.dual-range .range-values { margin-top: 8px; font-size: 0.9rem; color: var(--color-text-muted); display: flex; align-items: center; gap: 8px; }

/* Selectable chip groups */
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }

/* Vacancy preview card */
.vacancy-card .card-body { padding: 1rem 1.25rem; }
.vacancy-title { font-size: 1.05rem; font-weight: 600; color: var(--color-text-strong); text-decoration: none; }
.vacancy-title:hover { text-decoration: underline; }
.status-badge { font-size: 0.7rem; vertical-align: middle; }
.vacancy-meta { color: var(--color-text-muted); font-size: 0.9rem; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.vacancy-meta .dot { opacity: .5; }
.scorebar { position: relative; height: 8px; background: var(--color-border); border-radius: 9999px; overflow: hidden; }
.scorebar-fill { position: absolute; left: 0; top: 0; height: 100%; background: var(--gradient-success); }
.vacancy-actions .btn { border-radius: 9999px; }
.vacancy-actions .btn i { opacity: .9; }

/* Mobile responsive vacancy cards */
@media (max-width: 1023px) {
  .vacancy-card {
    max-width: 100%;
    width: 100%;
    overflow: hidden;
  }
}

.vacancy-preview summary::-webkit-details-marker { display: none; }
.vacancy-preview summary { cursor: pointer; user-select: none; }
.vacancy-preview .spinner-border { vertical-align: text-bottom; }

.chip { appearance: none; -webkit-appearance: none; border: 2px solid var(--color-text); background: var(--color-surface); color: var(--color-text); border-radius: 9999px; padding: 6px 12px; font-size: 0.9rem; line-height: 1; cursor: pointer; transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease; }
.chip:hover { background: var(--color-surface-hover); }
.chip.selected { background: var(--color-text); color: var(--color-surface); }

/* Overrides for vacancy chips */
.chip.chip-source { background: var(--color-surface-3) !important; border-color: var(--color-border) !important; color: var(--color-text) !important; }
.chip.chip-skill { background: var(--color-surface-2) !important; border-color: var(--color-border) !important; color: var(--color-text) !important; }
.chip.chip-workmode { background: var(--color-surface-2) !important; border-color: var(--color-border) !important; color: var(--color-text) !important; }
.chip:focus { outline: none; box-shadow: 0 0 0 3px rgba(17,24,39,0.08); }
.chip.selected:hover { opacity: 0.95; }

/* Company chip remove button (fallback if not already styled) */
.jqf-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--color-surface-hover); color: var(--color-text); border: 1px solid var(--color-border); border-radius: 9999px; padding: 4px 8px; margin: 4px; }
.jqf-chip .chip-remove { border: none; background: transparent; color: inherit; cursor: pointer; padding: 0 4px; line-height: 1; }
.jqf-chip .chip-remove:hover { opacity: 0.8; }

/* Query form responsive field sizing */
#jqf-form .form-control,
#jqf-form .form-select,
#jqf-form .form-control-pill,
#jqf-form .chip-group,
#jqf-form .jqf-chips { width: 100%; }

/* On small screens, make every field column full width */
@media (max-width: 767.98px) {
  #jqf-form .row.g-3 > [class^="col-"],
  #jqf-form .row.g-3 > [class*=" col-"] {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* On medium and up, avoid squishing: enforce a reasonable min-width so columns wrap */
@media (min-width: 768px) {
  #jqf-form .row.g-3 > [class^="col-"],
  #jqf-form .row.g-3 > [class*=" col-"] {
    min-width: 280px;
  }
}

/* Step slider (Schedule) */
.step-slider { position: relative; padding: 18px 0 10px; }
.step-slider .step-track { position: relative; height: 6px; background: var(--color-border); border-radius: 9999px; }
.step-slider .step-progress { position: absolute; left: 0; top: 0; height: 6px; width: 0; background: var(--brand-primary); border-radius: 9999px; opacity: 0.4; }
.step-slider input[type=range] { position: absolute; left: 0; right: 0; top: -6px; width: 100%; height: 18px; background: transparent; margin: 0; -webkit-appearance: none; appearance: none; }
.step-slider input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; background: var(--brand-primary); border: 2px solid #fff; border-radius: 50%; box-shadow: 0 2px 6px rgba(0,0,0,0.2); }
.step-slider input[type=range]::-moz-range-thumb { width: 12px; height: 12px; background: var(--brand-primary); border: 2px solid #fff; border-radius: 50%; box-shadow: 0 2px 6px rgba(0,0,0,0.2); }
.step-slider input[type=range]::-ms-thumb { width: 12px; height: 12px; background: var(--brand-primary); border: 2px solid #fff; border-radius: 50%; box-shadow: 0 2px 6px rgba(0,0,0,0.2); }
.step-slider input[type=range]::-webkit-slider-runnable-track { height: 6px; background: transparent; }
.step-slider input[type=range]::-moz-range-track { height: 6px; background: transparent; }
.step-slider input[type=range]::-ms-track { height: 6px; background: transparent; border-color: transparent; color: transparent; }
.step-slider .step-labels { list-style: none; padding: 0; margin: 10px 0 0; display: flex; justify-content: space-between; }
.step-slider .step-labels li { position: relative; text-align: center; font-size: 0.9rem; color: var(--color-text-muted); cursor: pointer; user-select: none; }
.step-slider .step-labels li.active { color: var(--color-text); font-weight: 600; }
.step-slider .step-labels { position: relative; }
.step-slider .step-labels li { padding-top: 18px; }
.step-slider .step-labels li::before { content: ''; position: absolute; left: 50%; top: -10px; transform: translateX(-50%); width: 12px; height: 12px; border-radius: 50%; background: var(--color-border); box-shadow: 0 0 0 2px var(--color-surface) inset; }
.step-slider .step-labels li.completed::before { background: var(--brand-primary); opacity: .5; }
.step-slider .step-labels li.active::before { opacity: 0; }



/* Global */
body { font-family: var(--font-sans); line-height: 1.6; transition: var(--transition); }

/* Buttons (shared) */
.btn { border-radius: var(--radius-lg); font-weight: var(--fw-semibold); transition: var(--transition); border: none; position: relative; overflow: hidden; }
.btn::before { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent); transition: left 0.5s; }
.btn:hover::before { left: 100%; }
.btn-primary { background-color: var(--brand-primary); border-color: 1px var(--brand-primary) solid !important; color: var(--brand-on-primary); }
.btn-primary:hover, .btn-primary:focus { background-color: var(--color-surface); border: 1px var(--brand-primary) solid !important; color: var(--brand-primary); }
.btn-outline-primary { color: var(--brand-primary); border: 2px solid var(--brand-primary); }
.btn-outline-primary:hover, .btn-outline-primary:focus { background-color: var(--brand-primary); color: var(--brand-on-primary); border-color: var(--brand-primary); }

/* Cards (shared default; pages can override) */
.card { border: none; border-radius: var(--radius-lg); box-shadow: var(--shadow); transition: var(--transition); overflow: hidden; }
.card-header { background: var(--gradient-primary); color: #fff; border: none; font-weight: var(--fw-semibold); }

/* Forms */
.form-control, .form-select { border-radius: var(--radius-lg); border: 2px solid var(--bs-border-color); transition: var(--transition); }
.form-control:focus, .form-select:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25); transform: translateY(-1px); }
.form-label { font-weight: var(--fw-semibold); color: var(--color-text-strong); margin-bottom: 0.75rem; }

/* Alerts */
.alert { border: none; border-radius: var(--radius-lg); border-left: 4px solid; font-weight: var(--fw-medium); }
.alert-success { border-left-color: var(--color-success); background: linear-gradient(135deg, rgba(25, 135, 84, 0.1), rgba(25, 135, 84, 0.05)); }
.alert-danger { border-left-color: var(--color-error); background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(220, 53, 69, 0.05)); }
.alert-info { border-left-color: var(--color-info); background: linear-gradient(135deg, rgba(13, 202, 240, 0.1), rgba(13, 202, 240, 0.05)); }
.alert-warning { border-left-color: var(--color-warning); background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 193, 7, 0.05)); }

/* Utilities */
.text-gradient { background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.text-primary {
  --bs-text-opacity: 1;
  color: rgba(var(--color-text), var(--bs-text-opacity)) !important;
}
.bg-gradient-primary { background: var(--gradient-primary) !important; }
.bg-gradient-success { background: var(--gradient-success) !important; }
.bg-gradient-warning { background: var(--gradient-warning) !important; }
.bg-gradient-info { background: var(--gradient-info) !important; }
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-brand { box-shadow: var(--shadow) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }

/* Scrollbar (optional) */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--color-surface-2); }
::-webkit-scrollbar-thumb { background: var(--color-text-muted); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-primary); }

/* Navbar polish (light) */
.navbar { backdrop-filter: blur(10px); border-bottom: 1px solid rgba(0, 0, 0, 0.06); position: relative; z-index: 3000; }
.navbar .container { position: relative; z-index: 3001; }
.nav-link { font-weight: var(--fw-medium); transition: var(--transition); border-radius: var(--radius-sm); margin: 0 0.25rem; }
.nav-link:hover { background-color: rgba(0, 0, 0, 0.04); transform: translateY(-1px); }
.nav-link.active { background-color: rgba(0, 0, 0, 0.06); font-weight: var(--fw-semibold); }

/* Notifications dropdown should stack above other UI and remain clickable */
#notifications-nav-item { position: relative; z-index: 3000; }
#notifications-nav-item .dropdown-menu,
#notifications-menu { z-index: 3001; pointer-events: auto; }
#notifications-menu, #notifications-menu * { pointer-events: auto; }
#notifications-menu .dropdown-header { pointer-events: auto; }
#notifications-menu .dropdown-header a { pointer-events: auto; position: relative; z-index: 1; }

/* Alert Container for Client-side Alerts: don't block clicks underneath when empty */
#alert-container { pointer-events: none; }
#alert-container .alert { pointer-events: auto; }

/* Loading overlay (shared) */
.loading-overlay { position: fixed; inset: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); z-index: 9999; display: flex; align-items: center; justify-content: center; }
.loading-spinner { text-align: center; color: #fff; }
.loading-spinner .spinner-border { width: 3rem; height: 3rem; }
body {
  background: var(--color-surface-2);
}
.card {
  background: var(--color-surface);

}
.text-muted {
  --bs-text-opacity: 1;
  color: unset !important;
}

/* Masonry layout for AI Analysis blocks */
.masonry-grid {
  column-count: 2;
  column-gap: 1.25rem; /* matches typical g-4 spacing */
}

.masonry-item {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  -moz-column-break-inside: avoid;
  margin-bottom: 1.25rem; /* vertical gutter between items */
  width: 100%;
  display: inline-block; /* required for column masonry */
}

/* Reduce extra spacing inside analysis blocks to compact layout */
.analysis-block > .mb-3 { margin-bottom: 0.75rem !important; }
.analysis-block > .mb-2 { margin-bottom: 0.5rem !important; }

@media (max-width: 991.98px) {
  .masonry-grid { column-count: 1; }
}
.card .btn-outline-primary{
	color: var(--brand-on-primary);
	border: 2px solid var(--brand-on-primary);
}
.card-body .btn-outline-primary{
	color: var(--brand-primary);
}

/* Template preview cards - A4 portrait-focused */
.template-card { cursor: pointer; }
.template-card.selected { outline: 2px solid var(--brand-primary); box-shadow: var(--shadow); }
.template-card .template-preview.a4 {
  position: relative; /* Enable absolute positioning for language chips */
  width: 100%;
  aspect-ratio: 1 / 1.414; /* A4 portrait ratio */
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
}
.template-card .template-preview.a4 img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.template-card .template-title {
  text-align: center;
}

/* Language chips on template previews */
.template-card .template-preview .language-chip {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 500;
  color: #374151;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

/* Template info tooltips */
.template-info-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.template-info-btn:hover {
  color: #4b5563;
}

.tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  width: 200px;
  max-width: 250px;
  padding: 8px 12px;
  background-color: #1f2937;
  color: white;
  font-size: 11px;
  line-height: 1.4;
  border-radius: 6px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  z-index: 1000;
  word-wrap: break-word;
}

.tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #1f2937;
}

.container-fluid {
    position: relative;
   /* z-index: -1;*/
}

/* Custom Tooltip Styles */
.tooltip-wrapper {
    position: relative;
    display: inline-block;
}

.tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    z-index: 9999;
    background-color: #1f2937;
    color: #fff;
    text-align: left;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    line-height: 1.4;
    white-space: normal;
    max-width: 250px;
    width: max-content;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    transition: opacity 0.3s, visibility 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1f2937 transparent transparent transparent;
}

.tooltip-wrapper:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}
