/* ==========================================================================
   Garancy SCIM Schema Checker – Design aligned with garancy.com
   Color palette: Gorse (primary/yellow), Shark (gray), Hawkes Blue (secondary)
   ========================================================================== */

body {
  font-family:
    'TT Hoves Pro',
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    Arial,
    'Noto Sans',
    sans-serif;
  background: #111517;
  color: #cdd1d4;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

/* Layout and container styles */
.main-container {
  background: #1e2428;
  border-radius: 1.8rem;
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.18),
    0 4px 6px -4px rgba(0, 0, 0, 0.18);
  outline: 1px solid rgba(255, 255, 255, 0.04);
  padding: 40px 32px 32px 32px;
  max-width: 1600px;
  margin: 64px auto 32px auto;
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.logo {
  position: absolute;
  top: 32px;
  right: 32px;
  width: 320px;
  z-index: 10;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: #ffe94e;
  margin-top: 0;
  font-family: inherit;
  font-weight: 400;
}

label {
  font-size: 1.1em;
  color: #ffe94e;
  margin-top: 32px;
  display: block;
}

textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 220px;
  margin: 6px 0 18px 0;
  padding: 16px;
  border-radius: 0.25rem;
  border: 2px solid #414a50;
  background: #111517;
  color: #cdd1d4;
  font-size: 1.1em;
  box-sizing: border-box;
  resize: vertical;
  display: block;
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',
    monospace;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
textarea#schemaInput:focus {
  border-color: #ffe94e;
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 233, 78, 0.18);
}
textarea.dragover {
  border-color: #ffe94e;
  background: #1e2428;
  box-shadow: 0 0 0 4px rgba(255, 233, 78, 0.14);
}

button#checkBtn {
  background: #ffe94e;
  color: #111517;
  border: none;
  border-radius: 9999px;
  padding: 12px 32px;
  font-size: 1.1em;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 12px;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.12),
    0 2px 4px -2px rgba(0, 0, 0, 0.08);
  transition: background 0.2s;
  vertical-align: middle;
}
button#checkBtn:hover {
  background: #ecca06;
}

button#openFileBtn {
  background: #ffe94e;
  color: #111517;
  border: none;
  border-radius: 9999px;
  padding: 6px 16px;
  font-size: 0.9em;
  font-weight: 500;
  cursor: pointer;
  align-self: flex-end;
  margin-bottom: -6px;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.12),
    0 2px 4px -2px rgba(0, 0, 0, 0.08);
  transition: background 0.2s;
}
button#openFileBtn:hover {
  background: #ecca06;
}

button#openResourceTypesFileBtn {
  background: #ffe94e;
  color: #111517;
  border: none;
  border-radius: 9999px;
  padding: 6px 16px;
  font-size: 0.9em;
  font-weight: 500;
  cursor: pointer;
  align-self: flex-end;
  margin-bottom: -6px;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.12),
    0 2px 4px -2px rgba(0, 0, 0, 0.08);
  transition: background 0.2s;
}
button#openResourceTypesFileBtn:hover {
  background: #ecca06;
}

#error,
.error-message {
  color: #ff725c;
  margin: 12px 0 0 0;
  font-weight: bold;
  font-size: 1.1em;
}

#results {
  margin: 32px auto 32px auto;
  width: 100%;
  max-width: 1536px;
}

/* Table styles for results */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 24px;
  background: #111517;
  border-radius: 0.25rem;
  overflow: hidden;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.15),
    0 1px 2px -1px rgba(0, 0, 0, 0.15);
  table-layout: fixed;
}
th,
td {
  padding: 12px 16px;
  text-align: left;
  word-break: break-word;
}
th {
  background: #1e2428;
  color: #ffe94e;
  font-weight: 600;
  border-bottom: 2px solid #ffe94e;
}
th.message-col,
td.message-col {
  width: 40%;
  min-width: 320px;
  max-width: 700px;
}
td {
  border-bottom: 1px solid #2c3338;
}
tr:last-child td {
  border-bottom: none;
}
code {
  background: #111517;
  color: #7eb8e0;
  padding: 0px 10px;
  border-radius: 0.25rem;
  font-size: 1.05em;
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',
    monospace;
  border: 1px solid #2c3338;
  box-shadow: none;
  margin: 0 2px;
  vertical-align: middle;
  word-break: break-all;
}
.level-ERROR {
  color: #ff725c;
  font-weight: bold;
}
.level-WARNING {
  color: #ecca06;
  font-weight: bold;
}
.level-INFO {
  color: #7eb8e0;
  font-weight: bold;
}
#results p {
  color: #ffe94e;
  font-size: 1.1em;
  margin: 32px 0 0 0;
  text-align: center;
}

.result-list {
  max-width: 900px;
  margin: 32px auto;
  padding: 0 16px;
}

.result-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  border-radius: 0.25rem;
  margin-bottom: 18px;
  padding: 18px 22px;
  background: #111517;
  border-left: none;
  box-shadow:
    0 1px 3px 0 rgba(0, 0, 0, 0.12),
    0 1px 2px -1px rgba(0, 0, 0, 0.08);
  transition: background 0.2s;
}

.result-badge {
  position: static;
  min-width: 54px;
  padding: 3px 14px;
  border-radius: 9999px;
  font-size: 0.98em;
  font-weight: bold;
  color: #111517;
  background: #7eb8e0;
  text-align: center;
  box-shadow: none;
  letter-spacing: 0.5px;
  margin-right: 24px;
  margin-top: 0;
  margin-bottom: 0;
  align-self: flex-start;
}

.result-content {
  display: flex;
  flex-direction: column;
  flex: 1 1 0%;
}

.result-row.info .result-badge {
  background: #7eb8e0;
  color: #111517;
}
.result-row.warning .result-badge {
  background: #ecca06;
  color: #111517;
}
.result-row.error .result-badge {
  background: #ff725c;
  color: #111517;
}

.result-row.info {
  background: linear-gradient(90deg, rgba(126, 184, 224, 0.08) 0%, #111517 100%);
}
.result-row.warning {
  background: linear-gradient(90deg, rgba(236, 202, 6, 0.08) 0%, #111517 100%);
}
.result-row.error {
  background: linear-gradient(90deg, rgba(255, 114, 92, 0.08) 0%, #111517 100%);
}

.result-message {
  font-size: 1.08em;
  font-weight: 500;
  color: #dfe2e4;
  margin-bottom: 6px;
  word-break: break-word;
}

.result-details {
  font-size: 0.98em;
  color: #9ca4aa;
  margin-top: 2px;
  word-break: break-word;
}

.result-row:hover {
  background: #1e2428;
}

button,
.button {
  font-family: inherit;
  background: #ffe94e;
  color: #111517;
  border: none;
  border-radius: 9999px;
  padding: 10px 22px;
  font-size: 1em;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s;
  margin-top: 10px;
}

button:hover,
.button:hover {
  background: #ecca06;
}

a {
  color: #7eb8e0;
  text-decoration: underline;
  text-decoration-style: dashed;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
  text-decoration-color: #414a50;
  transition:
    color 0.15s,
    text-decoration-color 0.15s;
}

a:hover,
a:focus {
  color: #5a9cd0;
  text-decoration-color: #7eb8e0;
}

.result-toggles {
  display: flex;
  gap: 24px;
  margin: 24px 0 8px 0;
  align-items: center;
  font-size: 1.08em;
  user-select: none;
}
.result-toggles label {
  color: #dfe2e4;
  font-weight: 500;
  cursor: pointer;
}
.result-toggles input[type='checkbox'] {
  accent-color: #ffe94e;
  margin-right: 6px;
  vertical-align: middle;
}
.toggle-count {
  color: #ffe94e;
  font-weight: bold;
  margin-left: 4px;
  font-size: 0.98em;
}

.schema-toggles-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 0 0 18px 0;
  align-items: center;
  font-size: 1.06em;
  user-select: none;
}

.schema-toggle-label {
  color: #dfe2e4;
  font-weight: 500;
  cursor: pointer;
  margin-right: 12px;
  margin-bottom: 4px;
  white-space: nowrap;
}

.schema-toggle-label input[type='checkbox'] {
  accent-color: #ffe94e;
  margin-right: 6px;
  vertical-align: middle;
}

.supported-highlight {
  display: inline-block;
  background: #7eb8e0;
  color: #111517;
  font-weight: bold;
  border-radius: 9999px;
  padding: 4px 16px;
  margin-bottom: 12px;
  margin-top: 8px;
  font-size: 1.12em;
  box-shadow: none;
}

/* Feedback button styles for inverted look */
.feedback-btn {
  background: transparent;
  color: #ffe94e;
  border: 2px solid #ffe94e;
  border-radius: 9999px;
  padding: 10px 30px;
  font-size: 1.1em;
  font-weight: 500;
  cursor: pointer;
  box-shadow: none;
  transition:
    background 0.2s,
    color 0.2s,
    border-color 0.2s;
  display: inline-block;
  box-sizing: border-box;
  margin: 0 0 2px 0; /* 2px for border */
  vertical-align: middle;
  text-decoration: none;
}
.feedback-btn:hover {
  background: #ffe94e;
  color: #111517;
  border-color: #ffe94e;
  text-decoration: none;
}

.intro-text {
  color: #b8bfc4;
}

.intro-text a {
  color: #7eb8e0;
  text-decoration: underline;
  text-decoration-style: dashed;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
  text-decoration-color: #414a50;
}

.intro-text a:hover {
  color: #5a9cd0;
  text-decoration-color: #7eb8e0;
}

.intro-note {
  color: #b8bfc4;
}

@media (max-width: 600px) {
  .result-list {
    padding: 0 4px;
  }
  .result-row {
    padding: 12px 8px;
  }
}

@media (max-width: 700px) {
  .logo {
    width: 320px;
    top: 12px;
    right: 12px;
  }
  .main-container {
    padding: 16px 4vw;
    margin: 24px 0 0 0;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    border-radius: 1rem;
  }
  table,
  th,
  td {
    font-size: 0.95em;
  }
  #results {
    width: 100%;
    min-width: 0;
  }
}

/* No issues detected styling */
.no-issues {
  color: #4ade80;
  font-weight: normal;
  font-style: italic;
}

/* Expandable/collapsible schema blocks */
.schema-block .schema-title {
  cursor: pointer;
  user-select: none;
  padding: 8px 0;
}

.schema-block .schema-title:hover {
  opacity: 0.8;
}

.schema-block .toggle-icon {
  display: inline-block;
  width: 1em;
  text-align: center;
  margin-right: 4px;
}

.schema-block.collapsed .schema-messages {
  display: none;
}

.schema-block.expanded .schema-messages {
  display: block;
}

/* Collapsible input sections */
.collapsible-section .section-title {
  cursor: pointer;
  user-select: none;
  padding: 8px 0;
  display: flex;
  align-items: center;
}

.collapsible-section .section-title:hover {
  opacity: 0.8;
}

.collapsible-section .section-title .toggle-icon {
  display: inline-block;
  width: 1em;
  text-align: center;
  margin-right: 8px;
  flex-shrink: 0;
}

.collapsible-section .section-title .input-label {
  cursor: pointer;
  margin: 0;
}

.collapsible-section.collapsed .section-content {
  display: none !important;
}

.collapsible-section.expanded .section-content {
  display: flex !important;
}

/* Attributes section inside schema blocks */
.attributes-section {
  margin: 8px 0 16px 0;
  padding: 8px 12px;
  background: rgba(30, 36, 40, 0.6);
  border-radius: 0.25rem;
  border: 1px solid #2c3338;
}

.attributes-section .attributes-title {
  cursor: pointer;
  user-select: none;
  font-weight: 500;
  color: #ffe94e;
  padding: 4px 0;
}

.attributes-section .attributes-title:hover {
  opacity: 0.8;
}

.attributes-section .attr-section-icon {
  display: inline-block;
  width: 1em;
  text-align: center;
  margin-right: 4px;
}

.attributes-section.collapsed .attributes-content {
  display: none;
}

.attributes-section.expanded .attributes-content {
  display: block;
  margin-top: 8px;
}

/* Messages section inside schema blocks */
.messages-section {
  margin: 8px 0 16px 0;
  padding: 8px 12px;
  background: rgba(30, 36, 40, 0.6);
  border-radius: 0.25rem;
  border: 1px solid #2c3338;
}

.messages-section .messages-title {
  cursor: pointer;
  user-select: none;
  font-weight: 500;
  color: #ffe94e;
  padding: 4px 0;
}

.messages-section .messages-title:hover {
  opacity: 0.8;
}

.messages-section .msg-section-icon {
  display: inline-block;
  width: 1em;
  text-align: center;
  margin-right: 4px;
}

.messages-section.collapsed .messages-content {
  display: none;
}

.messages-section.expanded .messages-content {
  display: block;
  margin-top: 8px;
}

/* Attribute list styling */
.attr-list {
  list-style: none;
  margin: 0;
  padding: 0 0 0 8px;
}

.attr-list-empty {
  color: #888;
  font-style: italic;
  padding: 4px 0;
}

.attr-item {
  padding: 2px 0;
  color: #f4f6f7;
}

.attr-item.has-subattrs {
  margin-bottom: 2px;
}

.attr-item .attr-toggle {
  cursor: pointer;
  user-select: none;
}

.attr-item .attr-toggle:hover {
  color: #ffe94e;
}

.attr-item .attr-toggle-icon {
  display: inline-block;
  width: 1em;
  text-align: center;
  font-size: 0.8em;
  margin-right: 2px;
}

.attr-item.collapsed .subattr-list {
  display: none;
}

.attr-item.expanded .subattr-list {
  display: block;
}

.subattr-list {
  list-style: none;
  margin: 2px 0 4px 16px;
  padding: 0;
  border-left: 2px solid #444;
  padding-left: 12px;
}

.subattr-item {
  padding: 1px 0;
  color: #b0b8bf;
  font-size: 0.95em;
}

/* Bullet color classes for issuesText */
.error-bullet {
  color: #ffa18f;
  font-weight: bold;
}
.warning-bullet {
  color: #fde047;
  font-weight: bold;
}
.info-bullet {
  color: #7eb8e0;
  font-weight: bold;
}

/* Tooltip for attributes with errors/warnings */
.has-tooltip {
  cursor: help;
}

#attr-tooltip {
  position: fixed;
  display: none;
  background: #1e2428;
  color: #f4f6f7;
  border: 1px solid #ffe94e;
  border-radius: 0.25rem;
  padding: 10px 14px;
  font-size: 0.92em;
  max-width: 400px;
  white-space: pre-wrap;
  word-wrap: break-word;
  z-index: 1000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  line-height: 1.4;
}

/* Attribute info icon */
.attr-info-icon {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.85em;
  color: #6b7280;
  cursor: help;
  vertical-align: middle;
  opacity: 0.7;
  transition:
    opacity 0.15s,
    color 0.15s;
}

.attr-info-icon:hover {
  opacity: 1;
  color: #7eb8e0;
}

/* Code elements with attribute tooltip (preserves original code color) */
code.has-attr-tooltip {
  cursor: help;
}

code.has-attr-tooltip:hover {
  opacity: 0.8;
}

/* Info tooltip for attribute JSON definition */
#attr-info-tooltip {
  position: fixed;
  display: none;
  background: #1a1d21;
  color: #d1d5db;
  border: 1px solid #3b82f6;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 0.88em;
  font-family: 'Consolas', 'Monaco', monospace;
  max-width: 500px;
  white-space: pre-wrap;
  word-wrap: break-word;
  z-index: 1001;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  line-height: 1.5;
}
