:root {
  --bg-body: #f8fafc;
  --text-body: #1e293b;
  --text-heading: #0f172a;
  --text-muted: #64748b;
  --text-tag: #475569;
  --text-modal: #334155;
  --border-default: #cbd5e1;
  --border-light: #e2e8f0;
  --bg-element: #fff;
  --bg-tag: #f1f5f9;
  --bg-hover: #e2e8f0;
  --primary-color: #0073b1;
  --primary-focus: rgba(0, 115, 177, 0.15);
  --backdrop-color: rgba(15, 23, 42, 0.6);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-header: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --bg-warning: #fef2f2;
  --border-warning: #fee2e2;
  --text-warning: #991b1b;
  --color-placeholder: #94a3b8;
}

[data-theme="dark"] {
  --bg-body: #0f172a;
  --text-body: #cbd5e1;
  --text-heading: #f8fafc;
  --text-muted: #94a3b8;
  --text-tag: #e2e8f0;
  --text-modal: #cbd5e1;
  --border-default: #334155;
  --border-light: #1e293b;
  --bg-element: #1e293b;
  --bg-tag: #334155;
  --bg-hover: #334155;
  --backdrop-color: rgba(0, 0, 0, 0.8);
  --bg-warning: #451a1a;
  --border-warning: #7f1d1d;
  --text-warning: #fca5a5;
  --color-placeholder: #64748b;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  max-width: 800px;
  margin: 40px auto;
  padding: 0 20px;
  background-color: var(--bg-body);
  color: var(--text-body);
}

.top-bar {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  margin-bottom: 20px;
}

.top-bar select, .top-bar button {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-default);
  background: var(--bg-element);
  color: var(--text-body);
  font-size: 14px;
  cursor: pointer;
}

.top-bar select:focus, .top-bar button:focus {
  outline: none;
  border-color: var(--primary-color);
}

h1 {
  margin-bottom: 4px;
  color: var(--text-heading);
  font-size: 2.5em;
  font-weight: 800;
}

h2 {
  font-size: 1.15em;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 0;
  margin-bottom: 35px;
}

h3 {
  font-size: 1.4em;
  color: var(--text-heading);
  margin-bottom: 15px;
  font-weight: 700;
}

.search-container {
  margin-bottom: 30px;
}

.search-input {
  width: 100%;
  padding: 14px 18px;
  font-size: 1em;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  box-sizing: border-box;
  background-color: var(--bg-element);
  box-shadow: var(--shadow-sm);
  color: var(--text-body);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-focus);
}

.job-card {
  background: var(--bg-element);
  border: 1px solid var(--border-light);
  padding: 20px;
  margin-bottom: 16px;
  border-radius: 12px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  box-shadow: var(--shadow-xs);
  transition: transform 0.2s, box-shadow 0.2s;
}

.logo {
  width: 55px;
  height: 55px;
  object-fit: contain;
  border-radius: 8px;
  flex-shrink: 0;
  background-color: #fff;
}

.job-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.job-title {
  margin-top: 0;
  margin-bottom: 6px;
  color: var(--text-heading);
  font-size: 1.2em;
  font-weight: 600;
}

.company {
  font-weight: 600;
  color: var(--primary-color);
  margin: 0 0 6px 0;
}

.meta {
  font-size: 0.88em;
  color: var(--text-muted);
  margin: 0 0 12px 0;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 8px;
}

.tag {
  background: var(--bg-tag);
  color: var(--text-tag);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.78em;
  font-weight: 500;
  text-wrap: nowrap;
}

.actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.btn-view {
  color: var(--primary-color);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  font-size: 0.95em;
}

.btn-view:hover {
  text-decoration: underline;
}

dialog[open] {
  display: block;
  overscroll-behavior: contain;
  border: none;
  background-color: var(--bg-element);
  padding: 30px;
  border-radius: 16px;
  max-width: 700px;
  width: 85%;
  max-height: 80%;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

dialog::backdrop {
  background-color: var(--backdrop-color);
  backdrop-filter: blur(4px);
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 36px;
  height: 36px;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: var(--bg-tag);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-modal:hover {
  background: var(--bg-hover);
  color: var(--text-heading);
}

.modal-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 25px;
  margin-top: 10px;
}

.modal-header .logo {
  width: 90px;
  height: 90px;
  margin-bottom: 12px;
}

.modal-title-text {
  text-align: center;
  margin-top: 10px;
  margin-bottom: 5px;
  font-size: 1.6em;
  font-weight: 700;
}

.modal-body {
  margin-top: 20px;
  line-height: 1.7;
  color: var(--text-modal);
  font-size: 1.05em;
}

.modal-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.skeleton-card {
  background: var(--bg-element);
  border: 1px solid var(--border-light);
  padding: 20px;
  margin-bottom: 16px;
  border-radius: 12px;
  display: flex;
  gap: 20px;
}

.skeleton-logo {
  width: 55px;
  height: 55px;
  background: var(--border-light);
  border-radius: 8px;
  flex-shrink: 0;
}

.skeleton-text {
  flex-grow: 1;
}

.skeleton-line {
  height: 12px;
  background: var(--border-light);
  margin-bottom: 10px;
  border-radius: 4px;
  animation: pulse 1.5s infinite ease-in-out;
}

.skeleton-line.title {
  width: 50%;
  height: 18px;
}

.skeleton-line.company {
  width: 30%;
}

.skeleton-line.meta {
  width: 70%;
}

.job-card.hidden {
  display: none;
}

footer {
  margin-top: 60px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  text-align: center;
  font-size: 0.85em;
  color: var(--text-muted);
}

.footer-link {
  color: var(--text-muted);
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  font-size: 1em;
  padding: 0;
}

.footer-link:hover {
  color: var(--primary-color);
}

.terms-title {
  margin-top: 10px;
  font-weight: 700;
}

.terms-content {
  text-align: left;
  margin-top: 20px;
}

.terms-content h3 {
  font-size: 1.2em;
  margin-top: 20px;
  margin-bottom: 8px;
}

.terms-content p {
  line-height: 1.6;
  margin-bottom: 12px;
}

.warning-box {
  background-color: var(--bg-warning);
  border: 1px solid var(--border-warning);
  color: var(--text-warning);
  padding: 15px;
  border-radius: 8px;
  margin-top: 20px;
}

.warning-title {
  display: block;
  margin-bottom: 5px;
}

.no-jobs-message {
  color: var(--text-muted);
  text-align: center;
  margin-top: 30px;
}

.error-message {
  color: red;
}

.logo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--color-placeholder);
  font-weight: 600;
}

.modal-header .logo-placeholder {
  font-size: 12px;
  color: #aaa;
}

.modal-actions {
  margin-top: 25px;
}

.btn-primary {
  color: var(--bg-element);
  background: var(--primary-color);
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95em;
  display: inline-block;
  border: none;
  cursor: pointer;
}

@keyframes pulse {
  0% {
    opacity: 0.6;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.6;
  }
}