
/* CSS Reset and Base Styles from 360WebApp */
* {
  outline: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  box-sizing: border-box;
}

html {
  --gold: #eab300;
  --darkblue: #46546a;
  --lightblue: #5ca4e5;
  --purple: #222062;
  --boringgray: color(srgb 0.9019 0.902 0.9021);
  --offwhite: #fafafa;
  --light-gray: #f6f6f6;
  --darkgray: #ccc;
  --text-color: #484848;
  --metatext-color: #737577;
  --lightgreen: #bceac7;
  --darkgreen: #4f967a;

  --phone-only: @media (max-width: 600px); /* firefox doesn't support @media queries in variables */
  --tablet: @media (min-width: 768px); /* firefox doesn't support @media queries in variables */
  --default-app-width: 70rem;
  --default-assessment-width: 700px;
  --default-app-shadow: 0 4px 8px rgba(0, 0, 0, 0.07);

  font-size: 100%;
  height: 100%;
}

body {
  height: 100%;
  font-family: "Open Sans", Arial, Verdana, sans-serif;
  line-height: 1.8;
  background: #e9e9e9;
  color: #484848;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  font-size: 14px;
  margin: 0;
  padding: 0;
}

#logo {
  width: 97px;
  height: 97px;
  display: inline-block;
  zoom: 1;
  transition-property: all;
  transition-duration: .18s;
  transition-timing-function: ease-in-out;
  transition-delay: .18s;
  vertical-align: top;
}

#logo span {
  width: 97px;
  height: 97px;
  overflow: hidden;
  display: block;
  text-indent: -9000px;
  backface-visibility: hidden;
  perspective: 1000;
  background-position: left -97px;
}

.no-gyro #logo span {
  animation: rotate 1s normal ease-in-out 1s;
}

.no-logo #logo {
  margin-top: -97px;
}

#logo,
#logo span {
  background-image: url("/assets/sprite-d7c2bd0e.svg");
  width: 97px;
  height: 97px;
  background-repeat: no-repeat;
}

#container {
  width: 100%;
  height: 100%;
  position: relative;
}

/* Layout from 360WebApp */
#wrapper {
  width: 100%;
  float: left;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.holder {
  padding: 20px 10px;
  margin: 0 auto;
  clear: both;
  float: none;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 60vh;
}

.holder-small {
  padding: 20px 10px;
  margin: 0 auto;
  clear: both;
  float: none;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hidden {
  display: none;
}

/* Flex shortcuts */
.flex-center {
  display: flex;
  align-items: center;
}

.flex-center-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.gap-1 {
  gap: .5rem;
}

.gap-2 {
  gap: 1rem;
}

.gap-3 {
  gap: 2rem;
}

.justify-between {
  justify-content: space-between;
}

.justify-end {
  margin-left: auto;
}

/* Breadcrumbs */
.breadcrumbs-container {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  font-size: 0.875rem;
  margin: 0rem 0 1.5rem;

  a {
    color: #737577;
  }

  .chevron {
    color: #b3b5b7;
    height: 0.8rem;
    margin: 0 0.25rem;
    width: 1rem;
  }
}

/* General Options Styling from 360WebApp */
.centered-wrapper {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  position: fixed;
}

.general-options {
  background: var(--light-gray);
  border-radius: 8px;
  box-shadow: var(--default-app-shadow);
  padding: 2rem;
  max-width: var(--default-app-width);
  margin: 0 auto;
  width: 100%;

  &.assessment {
    max-width: var(--default-assessment-width);
  }
}

.general-options h1 {
  color: var(--text-color);
  text-shadow: #edfff2 0 1px 1px;
  margin-bottom: 1rem;
  margin-top: 0;
  font-size: 28px;
  font-weight: 700;
}

.general-options h2 {
  color: var(--text-color);
  margin-bottom: 20px;
  font-size: 1.5rem;
  font-weight: 400;
}

/* Form Styling from 360WebApp */
fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

fieldset div {
  margin-bottom: 20px;
}

fieldset label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-color);
  font-size: 14px;
}

fieldset input[type="text"],
fieldset input[type="email"],
fieldset input[type="password"] {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e9e9e9;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  background: #fff;
  transition: border-color 0.3s ease;
}

fieldset input[type="text"]:focus,
fieldset input[type="email"]:focus,
fieldset input[type="password"]:focus {
  outline: none;
  border-color: var(--lightblue);
  box-shadow: 0 0 0 3px rgba(74, 127, 185, 0.1);
}

/* Additional form styling */
fieldset textarea {
  font-size: 16px;
  line-height: 1.4;
}

/* Angular form states */
fieldset input.ng-invalid {
  background: var(--light-gray);
  border-color: #f37466;
}

fieldset input.ng-pristine {
  background: #fff;
  border-color: #e9e9e9;
}

/* Button Styling from 360WebApp */
.submit,
.button,
button {
  background: var(--lightblue);
  color: white;
  padding: 12px 30px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1em;
  font-weight: 600;
  font-family: inherit;
  text-align: center;
  transition: background-color 0.3s ease;
  letter-spacing: 0.5px;
}

.button-small {
  padding: 6px 15px;
}

.submit:hover {
  background: #3a6a9e;
}

.submit:disabled {
  background: #cccccc;
  cursor: not-allowed;
  color: #888;
}

button.button-link {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 1em;
  font-weight: 600;
  font-family: inherit;
  text-decoration: underline;
  padding: 0;

  &:hover {
    text-decoration: none;
  }
}

/* Form Controls */
.login-controls ul,
.form-controls ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.form-controls {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.login-controls li,
.form-controls li {
  margin: 15px 0;
}

.sso-organization-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 2rem;
}

.organization-login-link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  width: 12rem;
  height: 9rem;
  background: #fafafa;
  border: 1px solid #ddd;
  border-radius: 0.75rem;
  text-decoration: none;
  color: #1a1a1a;
  font-size: 1.1rem;
  font-weight: 600;
  transition: all 0.2s ease-in-out;
  padding: 1rem;
}

.organization-login-link:hover {
  background: #f5f5f5;
  border-color: #ccc;
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.sso-organization-grid .organization-logo {
  max-width: 6rem;
  max-height: 3.5rem;
  object-fit: contain;
  margin-bottom: 0.75rem;
}

/* Links from 360WebApp */
a {
  color: #222260;
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
}

.login-links,
.register-links {
  text-align: center;
  margin-top: 25px;
}

.login-links p,
.register-links p {
  margin: 12px 0;
  color: #666;
}

.login-links a,
.register-links a {
  color: #222260;
  text-decoration: none;
  font-weight: 500;
}

.login-links a:hover,
.register-links a:hover {
  text-decoration: underline;
}

/* Header from 360WebApp */
#header {
  background: var(--darkblue);
  color: white;
  padding: 1rem 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-content {
  max-width: var(--default-app-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

.logo h1 {
  color: #eab300;
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

.logo a {
  color: #eab300;
  text-decoration: none;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 15px;
  margin: 0;
  padding: 0;
}

.main-nav li a {
  color: white;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background-color 0.3s ease;
  font-weight: 500;
}

.main-nav li a:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

/* Main Content */
main {
  flex: 1;
  padding: 20px 0;
}

.container {
  max-width: var(--default-app-width);
  margin: 0 auto;
  padding: 0 20px;

  &.assessment {
    max-width: var(--default-assessment-width);
  }
}

/* Flash Messages - Rails specific */
.flash {
  align-items: center;
  border-radius: 8px;
  bottom: 1rem;
  display: flex;
  font-weight: 500;
  gap: 1rem;
  justify-content: space-between;
  left: 1rem;
  padding: 15px 20px;
  position: fixed;
  transition: opacity 0.5s ease-in-out;
  z-index: 1000;
}

.flash.fade-out {
  opacity: 0;
}

.flash-notice {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

.flash-alert,
.flash-error {
  background: #ffecea;
  border: 1px solid #f37466;
  color: #721c24;
}

.close-flash {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  font-size: 20px;
  opacity: 0.7;
  padding: 0;
}

.close-flash:hover {
  opacity: 1;
}

/* dashboard header */

.dashboard-header {
  h1 {
    margin-bottom: 0;
  }
}

.dashboard-header-info {
  font-size: 0.875rem;
  color: var(--metatext-color);
}

/* Options List */
.options-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.options-list li {
  margin-bottom: 15px;
}

.options-list a {
  display: block;
  padding: 15px 20px;
  background: #f6f6f6;
  border-radius: 8px;
  text-decoration: none;
  color: #484848;
  transition: all 0.3s ease;
  border: 1px solid #e0e0e0;

  &.admin-link {
    background: var(--lightblue);
    color: white;
  }
}

.options-list a:hover {
  background: #f0f0f0;
  border-color: #4a7fb9;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);

  &.admin-link {
    background: #3a6a9e;
  }
}

/* Back Button */
.back-button {
  text-align: center;
  margin-top: 30px;
}

.back-button a {
  display: inline-block;
  padding: 10px 20px;
  background: #666;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  transition: background-color 0.3s ease;
  font-weight: 500;
}

.back-button a:hover {
  background: #555;
}

/* Footer */
#footer {
  background: var(--darkblue);
  backdrop-filter: blur(10px);
  color: white;
  text-align: center;
  padding: 0;
  margin-top: auto;
  position: relative;
  overflow: hidden;
  z-index: 9;

  &:after {
    content: "";
    position: absolute;
    inset: -1rem;
    background-image: url("/assets/outside-032acff2.jpg");
    background-size: cover;
    background-position: center;
    filter: blur(10px) brightness(0.9);
    z-index: -1;
  }
}

.footer-content {
  max-width: 50rem;
  margin: 0 auto;
  padding: 0 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 15px;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .holder {
    padding: 15px 10px;
  }

  .general-options {
    padding: 25px 20px;
    margin: 0 10px;
  }

  .general-options h1 {
    font-size: 1.5rem;
  }
}

/* Description styling from 360WebApp */
.description {
  font-style: italic;
  color: #a9a9a9;
  white-space: pre-wrap;
}

/* Clickable elements */
[ng-click],
[data-ng-click],
[x-ng-click] {
  cursor: pointer;
}

/* Questionnaire specific styles */
.questionnaire-summary {
  background: #f9f9f9;
  padding: 20px;
  border-radius: 8px;
  margin: 20px 0;
}

.questionnaire-summary dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 20px;
  margin: 0;
}

.questionnaire-summary dt {
  font-weight: 600;
  color: #484848;
}

.questionnaire-summary dd {
  margin: 0;
  color: #666;
}

.question-item {
  background: #f9f9f9;
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 15px;
  border: 1px solid #e0e0e0;
}

.question-item h3 {
  margin: 0 0 10px 0;
  color: #1b1b61;
  font-size: 1.1rem;
}

.question-item p {
  margin: 0 0 10px 0;
  color: #666;
}

.question-item ul {
  margin: 0;
  padding-left: 20px;
}

.question-item li {
  margin: 5px 0;
  color: #484848;
}

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

.assessors-list li {
  padding: 10px 15px;
  margin-bottom: 8px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.assessors-list li.completed {
  background: #d4edda;
  border: 1px solid #c3e6cb;
}

.assessors-list li.pending {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
}

.status {
  font-weight: 500;
  font-size: 0.9rem;
}

.no-assessors {
  text-align: center;
  padding: 30px;
  color: #666;
}

.form-controls ul {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
}

.form-controls li {
  display: flex;
}

textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #e9e9e9;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  min-height: 2rem;
}

textarea:focus {
  outline: none;
  border-color: #4a7fb9;
  box-shadow: 0 0 0 3px rgba(74, 127, 185, 0.1);
}

.anonymous-option input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--lightblue);
  border-radius: 3px;
  display: inline-block;
  position: relative;
  cursor: pointer;
}

.anonymous-option input[type="checkbox"]:checked {
  background-color: var(--lightblue);
}

.anonymous-option input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 0px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.anonymous-option label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

fieldset.email-template-inputs {
  background: white;
  border-radius: 0.5rem;
  box-shadow: var(--default-app-shadow);
  padding: 1rem 2rem;
  margin-bottom: 1rem;

  legend {
    font-weight: 600;
  }

  textarea {
    background: var(--offwhite);
  }
}

.email-preview-container summary {
  user-select: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.5rem 0;
  display: inline-block;
  transition: color 0.2s ease;

  svg {
    fill:black;
    transition: fill 0.2s ease;
  }

  &:hover {
    color: var(--lightblue);

    svg {
      fill: var(--lightblue);
    }
  }
}

.email-preview {
  padding: 1rem;
  border: 1px solid var(--darkgray);
  border-radius: 0.5rem;
  background-color: var(--boringgray);
  font-style: italic;
  user-select: none;
}

.email-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .5rem;

  .tag {
    align-items: center;
    background-color:var(--lightblue);
    border-radius: 3px;
    border: none;
    color: white;
    display: inline-flex;
    font-size: .9rem;
    gap: .5rem;
    padding: .2rem .4rem;

    button {
      background: none;
      border: none;
      color: white;
      cursor: pointer;
      margin: 0;
      padding: 0;

      .icon {
        display: inline-block;
        transition: transform 0.3s ease;

        &:hover {
          transform: rotate(90deg);
        }
      }
    }
  }
}

/* Admin / Organizations */

.organization-details {
  .details-pill {
    border: 1px solid var(--lightblue);
    background: white;
    color: var(--lightblue);
    padding: 0.2rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: bold;
  }
}

.organization-logo {
  object-fit: cover;
  max-height: 100px;
  max-width: 300px;
}

/* Template cards */
.radio-card-group {
  display: grid;
}

.radio-card {
  background: white;
  box-shadow: 0 0 0 1px #e9e9e9;
  border-radius: 0.5em;
  line-height: 1.4;
  padding: 1em 2.5em 1em 1.25em;
  margin: 0;
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.radio-card:hover,
.radio-card:has(.radio-card-radio-button:checked) {
  box-shadow: 0 0 0 2px var(--lightblue);
  background: hsl(from var(--lightblue) 210 76% 96%)
}

.radio-card-radio-button {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-card-checkmark {
  position: absolute;
  top: 1em;
  right: 1em;
  background: var(--lightblue);
  color: white;
  border-radius: 50%;
  width: 1.5em;
  height: 1.5em;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;

  svg {
    height: 1em;
    width: 1em;
    fill: white;
  }
}

.radio-card strong {
  display: block;
  margin: 0 0 0.5em 0;
  font-size: 1.1em;
  font-weight: 600;
  padding-right: 2em; /* Make room for checkmark */
}

.radio-card p {
  margin: 0;
  line-height: 1.4;
  font-weight: 400;
}

.radio-card-selected .radio-card-checkmark {
  display: flex;
}

.radio-card:not(:has(.radio-card-radio-button:checked)) .radio-card-checkmark {
  display: none;
}

/* Helper classes */
.line-clamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-2 {
  -webkit-line-clamp: 2;
}
