@keyframes create-note-in {
  0%   { display: flex; margin-right: calc(-378px); }
  100% { display: flex; margin-right: 0; }
}

@keyframes create-note-out {
  0% { display: flex; margin-right: 0; }
  100%   { display: none; margin-right: calc(-378px); }
}

body.lazarus.candidates.show {
  main {
    padding: 0;
  }
}

body.lazarus.candidates {
  #candidate_search {
    input {
      width: 400px;
      border-radius: 4px 0 0 4px;
    }

    button {
      border-color: transparent;
    }
  }

  .table-contianer table {
    border-collapse: collapse;
    width: 100%;
    table-layout: fixed; /* Ensure table layout is fixed */
  }

  .red-600 { color: var(--color-red-600); }
  .gold-600 { color: var(--gold-600); }
  .blue-600 { color: var(--color-blue-600); }
  .green-600 { color: var(--green-600); }

  .circle {
    pointer-events: none;
    text-align: center;
    border-bottom: 3px solid rgba(0, 0, 0, 0.1);
    &:before { 
      font-size: 1rem;
      color: rgba(0, 0, 0, 0.15);
      content: "+";
    }
  }

  .message-mock-hidden {
    transition: transform 0.15s ease-out;
    transform: translateY(90%) translateX(-85%);
    opacity: 0.8;
  }

  .thread-header {
    &:before {
      content: "";
      display: block;
      border: none;
      border-top: 2px solid #eee;
      width: 15px;
      margin: 0 auto; /* Center the line horizontally */
      position: absolute;
      left: 94px;
    }
  }

  .chat-message {
    text-align: left;
    position: relative;

    &:hover,
    &:focus {
      .feedback {
        opacity: 1;
      }
    }

    .feedback {
      display: flex;
      position: absolute;
      opacity: 0;
      bottom: 5px;
      left: calc(var(--base-spacing)/2);
      padding: 8px 12px;
      transition: opacity 0.12s ease-out;
      background-color: white;
      border: 1px solid var(--neutral-150);
      border-radius: 2px;
      z-index: 1;
      max-height: 42px;

      .emoji {
        cursor: pointer;
        transition: transform 0.05s ease-out;
      }

      .emoji:hover,
      .emoji:focus {
        transform: scale(1.1);
      }
    }

    .message-footer {
      display: flex;
      justify-content: end;
      position: absolute;
      bottom: 7px;
      left: 0;
      width: 100%;
      white-space: nowrap;
    }

    .message-details {
      display: flex;
      padding: calc(var(--base-spacing)/2);
      color: var(--neutral-300);
      justify-content: space-between;
      flex-direction: row-reverse;
      align-items: center;
      transition: opacity 0.12s ease-out;
      width: 100%;
    }

    .message-sent-by {
      color: var(--neutral-400);
      font-weight: 500;
      margin-right: calc(var(--base-spacing)/2);
    }

    .message-body {
      padding: 16px;
      font-weight: 500;
      border-radius: 12px 12px 0px 12px;
      display: inline-block;
      max-width: 450px;
      margin-bottom: 32px;

      background-color: var(--gold-100);
      border-radius: 12px 12px 12px 0px;
      color: var(--neutral-800);
      text-align: left;
    }

    .avatar {
      min-width: 18px;
      min-height: 18px;
      max-width: 18px;
      max-height: 18px;
      height: 18px;
      width: 18px;
      margin-left: calc(var(--base-spacing)/4);
      margin-right: 0;
    }

    &.is-system {
      text-align: right;

      .feedback {
        display: none;
      }

      .message-footer {
        justify-content: start;
      }

      .message-sent-by {
        margin-right: 0;
        margin-left: calc(var(--base-spacing)/2);
      }

      .message-details {
        flex-direction: row-reverse;
      }

      .message-body {
        border-radius: 12px 12px 12px 0px;
        color: var(--neutral-50);
        background-color: var(--gold-900);
        text-align: left;
      }
    }

    &.is-member-author {
      .message-body {
        background-color: var(--gold-200);
      }
    }
  }

  .job-suggestions-grid {
    display: grid;
    grid-auto-flow: row;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    padding-top: 32px;
    padding-left: 16px;
    padding-right: 16px;

    .job-card {
      padding: 32px 16px 24px 16px;
      border: 1px solid var(--neutral-100);
      border-radius: 4px;
    }

    .job-reasoning {
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 4;
      overflow: hidden;
    }

    .job-invited {
      border-radius: 8px;
      padding: 8px 12px;
      color: var(--green-900);
      background-color: var(--green-100);
    }
  }

  .send-section {
    background-color: var(--neutral-50);
    border-top: 1px solid var(--neutral-100);
    padding: var(--base-spacing);
    input[type='text'] {
      border-radius: var(--button-radius) 0 0 var(--button-radius);
    }
  }

  .send-button {
    border-radius: 0 var(--button-radius) var(--button-radius) 0;
    border-width: 0px;
  }

  .activity-feed-step {
    margin: 12px 20px 12px 20px;
    min-height: 20px;
    border-left: 1px solid var(--neutral-150);
    flex-grow: 1;
  }

  .activity-feed:last-child {
    .activity-feed-step {
      display: none;
    }
  }

  .activity-feed-icon {
    width: 25px;
    height: 25px;
    padding: 7.5px;
    background-color: var(--neutral-50);
  }

  .note-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    width: 378px;
    border-left: 1px solid var(--neutral-150);
    transition: margin 1s;
    animation: create-note-in 0.7s;
  }

  .note-sidebar {
    .candidate-source-radio {
      display: flex;
      gap: 12px;
      margin-top: 12px;
      margin-bottom: 12px;

      input {
        display: none;
      }

      label {
        cursor: pointer;
        font-size: 14px;
        color: var(--neutral-600);
        padding: 4px 8px;
        border-radius: 4px;
        border: 1px solid var(--neutral-150);
      }

      input:checked ~ label {
        background-color: var(--gold-200);
        border: 1px solid var(--gold-200);
      }

      i {
        margin-left: 8px;
        vertical-align: middle;
      }
    }
  }

  .note-sidebar.note-hidden {
    display: none;
    animation: create-note-out 0.7s;
  }

  .note-sidebar {
    textarea {
      resize: none;
      border: none;
    }

    form {
      display: flex;
      flex-direction: column;
      flex-grow: 1;
    }
  }

  .note-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    word-spacing: 0.75rem;
    border-top: 1px solid var(--neutral-150);
    padding: 16px 12px 24px 12px;
  }

  .feed-candidate-note-source {
    font-size: 13px;
    
    i {
      margin-left: 4px;
      vertical-align: middle;
    }
  }

  /* Simulate iPhone view */
  .candidate-message-simulation {
    bottom: 10px;
    left: 10px;
    position: fixed;
    background: black;
    border-radius: 30px;
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px;
    padding: 12px;
    width: 320px;
    height: 550px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 5px 15px rgba(0, 0, 0, 0.2);

    .status-bar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 5px 20px;
      font-size: 12px;
      height: 44px;

      .time { font-weight: 600; }
      .icons {
        display: flex;
        gap: 5px;
        i { font-size: 14px; }
      }
    }

    .message-container {
      height: calc(100% - 44px - 100px);
      overflow-y: auto;
      padding: 10px;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      color: rgba(255, 255, 255, 0.6);
      
      &:before {
        content: 'Preview Mode';
        font-size: 20px;
        font-weight: 500;
        margin-bottom: 8px;
      }
      
      &:after {
        content: attr(data-simulation-text);
        font-size: 14px;
        opacity: 0.7;
      }
    }

    .message-input-container {
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      padding: 10px 16px;
      background: #000;
    }

    textarea {
      border-radius: 15px;
      border: 1px solid rgba(255, 255, 255, 0.1);
      padding: 12px 45px 12px 16px;
      width: 100%;
      min-height: 40px;
      max-height: 120px;
      resize: none;
      background: black;
      color: #e5e5e5;
      font-size: 16px;
      line-height: 1.2;
      
      &:focus {
        border-color: rgba(255, 255, 255, 0.3);
        background: #0c0c0c;
        outline: none;
      }
    }

    .message-submit-button {
      position: absolute;
      bottom: 24px;
      right: 25px;
      border-radius: 50%;
      width: 24px;
      height: 24px;
      background-color: #007AFF;
      color: white;
      border: none;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 0;
      font-size: 14px;
    }
  }

  .candidate-document-filename {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
  }

  #candidate-lead-quality-feedback-banner {
    .emoji {
      display: inline-block;
      cursor: pointer;
      transition: transform 0.05s ease-out;
    }

    .emoji:hover, .emoji:focus {
      transform: scale(1.3);
    }
  }

  #candidate-lead-quality-feedback-modal {
    i {
      font-size: 20px;
      cursor: pointer;
    }

    input[type=radio] {
      display: none;
    }

    textarea {
      resize: none;
      margin-top: 16px;
    }

    label:has(input:checked) {  
      i {
        color: rgb(45, 45, 124);
        font-family: "Phosphor-Fill" !important;
        font-size: 25px;
      }
    }
  }
}
