#admin-nav #pageTitle {
  font-size: 1.5rem;
}

#admin-links {
  min-height: calc(100vh - 86px);
  position: relative;

  .admin-link {
    display: flex;
    font-weight: bold;
    height: 100%;
    width: 100%;
    padding: 8px;

    &:hover {
      background-color: rgba(0, 0, 0, 0.05);
    }
  }

  .cirs-login {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 25px;

    > a {
      color: var(--darkgray);
      font-weight: bold;
    }
  }

  a {
    color: var(--secondary-color);
  }

  h6 {
    color: var(--darkgray);
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 0.75rem;
  }

  .accordion {
    --bs-accordion-bg: transparent;
    --bs-accordion-border-width: 0;
    --bs-accordion-active-bg: var(--main-color);
    --bs-accordion-active-color: var(--white);
    --bs-accordion-btn-active-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewbox='0 0 16 16' fill='%23FFFFFF'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");

    a {
      text-decoration: none;
      --bs-accordion-btn-icon: none;
    }
  }
}

// .dropzone {
//   border: 2px dashed #ccc;
//   border-radius: 5px;
//   background: white;
//   padding: 20px;
//   margin: 20px auto;
//   text-align: center;
//   font-size: 16px;
//   font-weight: bold;
//   color: #999;
// }

.dz-message i {
  display: block;
  font-size: 48px;
  margin-bottom: 20px;
}

@media screen and (max-width: 1024px) {
  .mobile-hide {
    display: none !important;
  }

  #admin-links {
    min-width: 33% !important;
    width: 33%;
  }
}

#intra-nav {
  background-color: #0f1828;
  opacity: 1;
  background-size: 13px 13px;
  background-image: repeating-linear-gradient(
    45deg,
    #1a2332 0,
    #1a2332 1.3px,
    #0f1828 0,
    #0f1828 50%
  );
  border-bottom: 2px solid #192231;

  .dropdown-menu {
    --bs-dropdown-link-active-bg: var(--main-color);
  }
}

#intra-nav .nav-link {
  border-bottom-color: transparent;

  &.active {
    background-color: var(--main-color);
    border-bottom: 3px solid var(--main-color-dimmed);
    color: var(--white);

    i {
      color: var(--white);
    }

    &:hover {
      background-color: var(--main-color);
    }
  }

  &:hover {
    background-color: rgba(0, 0, 0, 0.15);
    border-bottom: 3px solid rgba(0, 0, 0, 0.15);
  }
}

#intra-usermenu {
  .nav-link i {
    color: #d3d4d5;
  }

  @media (min-width: 992px) {
    .nav-link {
      border-left: 1px solid #d3d4d5;
    }
  }
}

#adminnav-new .nav-link {
  position: relative;
  padding: 0.5rem 1rem;
  border-top: 4px solid transparent;
  transition: border 0.3s ease-in-out, background-color 0.3s ease-in-out,
    color 0.3s ease-in-out;

  &.active {
    font-weight: bold;
    color: var(--white) !important;
    background-color: var(--main-color);
    border-top: 4px solid var(--main-color-dimmed);
    border-radius: 5px;
  }
}

@media (min-width: 1400px) {
  #adminnav-new .navbar-nav {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 1399px) {
  #adminnav-new .navbar-nav {
    flex-wrap: wrap;
  }

  #adminnav-new .navbar-nav .nav-link {
    margin-bottom: 10px;
  }
}

#darkmode-switch {
  position: absolute;
  right: 2%;
  bottom: 3%;
  z-index: 9999;
}

#topLogo {
  background-color: var(--gray);
}

[data-bs-theme="dark"] {
  #topLogo {
    background-color: var(--bs-secondary-bg);
    border-bottom-color: var(--bs-secondary-color) !important;
  }

  svg g#fh > path,
  svg g#sb > path {
    fill: var(--white) !important;
  }

  // #mainpageContainer {
  //   background-color: var(--bs-tertiary-bg) !important;
  // }

  hr.text-light {
    color: var(--bs-tertiary-bg) !important;
  }

  .ma-basedata,
  .ma-comments,
  .ma-documents,
  .intra__tile {
    background-color: #0f1828 !important;
    border: 2px solid #192231 !important;
    border-radius: 8px;
  }

  .comment p {
    color: var(--black);
  }

  // .dropzone {
  //   background: var(--bs-tertiary-bg) !important;
  //   border-color: var(--main-color);
  // }

  #startpage .col.bg-gray-color,
  #startpage .col-6.bg-gray-color {
    background-color: #212529 !important;
  }
}

/* CSS for the floating button */
.floating-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
}

.btn {
  border-radius: 8px !important;
}

.badge {
  border-radius: 0 !important;
}

.dienstnr-container {
  position: relative;
  min-height: 38px;
}

.dienstnr-status {
  position: absolute;
  right: 5px;
  top: 10px;
  font-size: 18px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.dienstnr-status.loading {
  color: #6c757d;
}

.dienstnr-status.available {
  color: #28a745;
}

.dienstnr-status.unavailable {
  color: #dc3545;
}

.dienstnr-status .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #6c757d;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.form-control.invalid {
  border-color: #dc3545;
  padding-right: 25px;
}

.form-control.valid {
  border-color: #28a745;
  padding-right: 25px;
}

#dienstnr {
  padding-right: 25px;
}

.chat-container {
  max-height: 500px;
  overflow-y: auto;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 15px;
  background-color: #f8f9fa;

  [data-bs-theme="dark"] & {
    background-color: var(--bs-tertiary-bg);
    border-color: #192231;
  }
}

.message {
  margin-bottom: 15px;
  padding: 10px 15px;
  border-radius: 12px;
  max-width: 75%;
  word-wrap: break-word;
  position: relative;

  .message-content {
    line-height: 1.4;
  }

  .message-meta {
    font-size: 0.75em;
    opacity: 0.8;
    margin-top: 8px;
    font-style: italic;
  }
}

.message-own {
  margin-left: auto;
  background: linear-gradient(
    135deg,
    var(--main-color) 0%,
    var(--main-color-dimmed) 100%
  );
  color: white;
  text-align: right;

  &::before {
    content: "";
    position: absolute;
    bottom: 0;
    right: -8px;
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-left-color: var(--main-color-dimmed);
    border-bottom: 0;
  }
}

.message-admin {
  margin-right: auto;
  background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
  color: white;

  &::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: -8px;
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-right-color: #5a6268;
    border-bottom: 0;
  }
}

.message-user {
  margin-right: auto;
  background: linear-gradient(135deg, #5e5e5e 0%, #505050 100%);
  color: white;
}

.message-status {
  margin: 20px auto;
  text-align: center;
  //background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
  color: var(--white);
  max-width: 60%;
  font-weight: 400;
  border-radius: 0;

  .message-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }
}

.message-system {
  margin: 20px auto;
  text-align: center;
  //background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
  border-left: 2px solid #17a2b8;
  border-right: 2px solid #17a2b8;
  color: #17a2b8;
  max-width: 60%;
  border-radius: 20px;

  .message-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }
}

/* Header-Bereiche einheitlich gestalten */
.bewerbung-header {
  background: linear-gradient(
    135deg,
    var(--main-color) 0%,
    var(--main-color-dimmed) 100%
  );
  color: white;
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 25px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);

  h1,
  h2,
  h3,
  h4 {
    color: white;
    margin-bottom: 10px;
  }

  .badge {
    font-size: 0.9em;
    padding: 8px 15px;
    border-radius: 20px;
  }
}

/* Bewerbungsdetails-Container */
.bewerbung-details {
  background: transparent;
  border-radius: 8px;
  padding: 0;
  margin-bottom: 20px;
  box-shadow: none;
}

/* Formular-Bereiche einheitlich */
.form-section {
  background: transparent;
  border-radius: 8px;
  padding: 25px 0;
  margin-bottom: 20px;
  box-shadow: none;

  h5 {
    border-bottom: 2px solid var(--white);
    padding-left: 8px;
    padding-bottom: 12px;
    margin-bottom: 25px;
    color: var(--white);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;

    i {
      color: var(--white);
    }
  }
}

/* Action Buttons Sidebar */
#application-actions {
  position: sticky;
  top: 20px;
  background: transparent;
  padding: 0;
  border-radius: 8px;
  box-shadow: none;

  h5 {
    color: var(--main-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;

    i {
      color: var(--main-color);
    }
  }
}

/* Admin-Nachrichtenform */
.admin-message-form {
  background: rgba(var(--main-color-rgb), 0.1);
  border: 2px solid rgba(var(--main-color-rgb), 0.2);
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;

  h6 {
    color: var(--main-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
  }
}

/* Chat-Input-Bereich */
.chat-input {
  margin-top: 20px;

  .progress {
    border-radius: 10px;
    overflow: hidden;

    .progress-bar {
      transition: width 0.3s ease, background-color 0.3s ease;
      border-radius: 10px;

      &#applicationProgress {
        font-weight: 600;
        font-size: 0.85em;
      }
    }
  }

  .input-group {
    border-radius: 12px;
    overflow: hidden;

    textarea {
      border-radius: 12px 0 0 12px;
      border-right: none;
      resize: vertical;
      min-height: 80px;
    }

    .btn {
      border-radius: 0 12px 12px 0;
      padding: 0 20px;
      font-weight: 600;
    }
  }
}

/* Warning/Info-Boxen */
.warning-box {
  background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
  border: 2px solid #ffc107;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;

  h6 {
    color: #856404;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
  }
}

/* Tabellen in Bewerbungsdetails */
.table-borderless {
  tr td:first-child {
    color: var(--main-color);
    font-weight: 600;
  }

  code {
    background-color: rgba(var(--main-color-rgb), 0.1);
    color: var(--main-color);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.9em;
  }

  .badge {
    border-radius: 15px;
    padding: 6px 12px;
  }
}

/* Required Field Indicator */
.required-field::after {
  content: " *";
  color: #dc3545;
  font-weight: bold;
}

/* Form Validation Styling */
.form-control {
  border-radius: 8px;
  border: 2px solid #e9ecef;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;

  &:focus {
    border-color: var(--main-color);
    box-shadow: 0 0 0 0.2rem rgba(var(--main-color-rgb), 0.25);
  }

  &.is-valid {
    border-color: #28a745;

    &:focus {
      box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
    }
  }

  &.is-invalid {
    border-color: #dc3545;

    &:focus {
      box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
    }
  }
}

.form-select {
  border-radius: 8px;
  border: 2px solid #e9ecef;

  &:focus {
    border-color: var(--main-color);
    box-shadow: 0 0 0 0.2rem rgba(var(--main-color-rgb), 0.25);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Dark Mode Anpassungen */
[data-bs-theme="dark"] {
  .bewerbung-header {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  }

  .chat-container {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: #192231;
  }

  .admin-message-form {
    background: rgba(var(--main-color-rgb), 0.15);
    border-color: rgba(var(--main-color-rgb), 0.3);
  }

  .warning-box {
    background: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.3);
    color: #fff3cd;

    h6 {
      color: #ffc107;
    }
  }

  .form-control,
  .form-select {
    background-color: var(--bs-tertiary-bg);
    border-color: #192231;
    color: var(--bs-body-color);

    &:focus {
      background-color: var(--bs-tertiary-bg);
      border-color: var(--main-color);
    }
  }

  .table-borderless code {
    background-color: rgba(var(--main-color-rgb), 0.2);
    color: var(--main-color);
  }
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
  .bewerbung-header {
    padding: 20px;
    text-align: center;

    .d-flex {
      flex-direction: column;
      gap: 15px;
    }
  }

  .message {
    max-width: 90%;
  }

  .action-buttons {
    position: static;
    margin-top: 30px;
  }

  .chat-container {
    max-height: 400px;
  }
}

/* Animation für neue Nachrichten */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message.new-message {
  animation: slideInUp 0.3s ease-out;
}

/* Scrollbar-Styling für Chat */
.chat-container {
  scrollbar-width: thin;
  scrollbar-color: var(--main-color) transparent;

  &::-webkit-scrollbar {
    width: 6px;
  }

  &::-webkit-scrollbar-track {
    background: transparent;
  }

  &::-webkit-scrollbar-thumb {
    background-color: var(--main-color);
    border-radius: 3px;

    &:hover {
      background-color: var(--main-color-dimmed);
    }
  }
}

/* Admin-Übersichtsseite spezifische Styles - Sichere Selektoren */
[data-page="bewerbungen"] {
  /* Statistiken */
  .stats-item {
    text-align: center;
    padding: 10px;
  }

  .stats-number {
    font-size: 2.5rem;
    font-weight: bold;
    display: block;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  }

  .stats-label {
    font-size: 1rem;
    opacity: 0.9;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
  }

  /* Tabellen-spezifische Styles */
  .table-actions {
    white-space: nowrap;
    width: 1%;
  }

  .bewerbung-row {
    transition: background-color 0.3s ease;

    &:hover {
      background-color: rgba(var(--main-color-rgb), 0.05);
    }
  }

  .message-indicator {
    display: inline-block;
    background: var(--main-color);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
    text-align: center;
    line-height: 24px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(var(--main-color-rgb), 0.3);

    &:hover {
      animation: bewerbung-pulse 0.6s ease-in-out;
    }
  }

  /* Filter-Tabs nur für Bewerbungsseiten */
  .filter-tabs {
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 25px;
    padding-bottom: 0;

    [data-bs-theme="dark"] & {
      border-bottom-color: #192231;
    }
  }

  .filter-tab {
    display: inline-block;
    padding: 12px 20px;
    margin-right: 15px;
    background: none;
    border: none;
    color: #6c757d;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
    border-radius: 8px 8px 0 0;

    &:hover {
      color: var(--main-color);
      text-decoration: none;
      background-color: rgba(var(--main-color-rgb), 0.05);
    }

    &.active {
      color: var(--main-color);
      border-bottom-color: var(--main-color);
      font-weight: 600;
      background-color: rgba(var(--main-color-rgb), 0.1);
    }

    i {
      margin-right: 5px;
    }

    &:focus {
      outline: 2px solid var(--main-color);
      outline-offset: 2px;
    }
  }

  /* Tabellen-Verbesserungen nur für Bewerbungsseiten */
  .table {
    th {
      background-color: var(--main-color) !important;
      border: none;
      color: white;
      font-weight: 600;
      padding: 15px 12px;

      i {
        margin-right: 5px;
        opacity: 0.8;
      }
    }

    td {
      vertical-align: middle;
      padding: 12px;
      border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    &.table-dark th {
      background-color: var(--main-color) !important;
    }
  }

  /* Button-Gruppe nur für Bewerbungstabellen */
  .table .btn-group-sm .btn {
    margin: 0 1px;
    border-radius: 6px !important;

    &:first-child {
      margin-left: 0;
    }

    &:last-child {
      margin-right: 0;
    }
  }

  /* Pagination nur für Bewerbungsseiten */
  .pagination {
    .page-link {
      border-radius: 6px;
      margin: 0 2px;
      border: 1px solid #e9ecef;
      color: var(--main-color);

      &:hover {
        background-color: var(--main-color);
        border-color: var(--main-color);
        color: white;
      }

      &:focus {
        outline: 2px solid var(--main-color);
        outline-offset: 2px;
      }
    }

    .page-item.active .page-link {
      background-color: var(--main-color);
      border-color: var(--main-color);
    }
  }

  /* Empty State für Bewerbungsseiten */
  .intra__tile .text-center.py-5 {
    padding: 4rem 2rem !important;

    i {
      opacity: 0.5;
      margin-bottom: 1rem;
    }

    h4 {
      margin-bottom: 0.5rem;
    }
  }
}

/* Dark Mode nur für Bewerbungsseiten */
[data-bs-theme="dark"][data-page="bewerbungen"] {
  .bewerbung-row:hover {
    background-color: rgba(var(--main-color-rgb), 0.1);
  }

  .table td {
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }

  .filter-tab {
    color: #adb5bd;

    &:hover {
      color: var(--main-color);
      background-color: rgba(var(--main-color-rgb), 0.1);
    }

    &.active {
      color: var(--main-color);
      background-color: rgba(var(--main-color-rgb), 0.15);
    }
  }

  .pagination .page-link {
    background-color: var(--bs-tertiary-bg);
    border-color: #192231;
    color: var(--bs-body-color);

    &:hover {
      background-color: var(--main-color);
      border-color: var(--main-color);
      color: white;
    }
  }

  .pagination .page-item.active .page-link {
    background-color: var(--main-color);
    border-color: var(--main-color);
  }
}

/* Responsive nur für Bewerbungsseiten */
@media (max-width: 768px) {
  [data-page="bewerbungen"] {
    .stats-number {
      font-size: 2rem;
    }

    .stats-label {
      font-size: 0.9rem;
    }

    .filter-tabs {
      overflow-x: auto;
      white-space: nowrap;
      padding-bottom: 5px;
      margin-bottom: 20px;

      &::-webkit-scrollbar {
        height: 4px;
      }

      &::-webkit-scrollbar-track {
        background: transparent;
      }

      &::-webkit-scrollbar-thumb {
        background-color: var(--main-color);
        border-radius: 2px;
      }
    }

    .filter-tab {
      margin-right: 10px;
      padding: 10px 15px;
      font-size: 0.9rem;
    }

    .table-responsive {
      font-size: 0.9rem;
    }

    .table .btn-group-sm .btn {
      padding: 0.25rem 0.4rem;
      font-size: 0.8rem;
    }

    .message-indicator {
      width: 20px;
      height: 20px;
      line-height: 20px;
      font-size: 0.7rem;
    }
  }
}

@media (max-width: 576px) {
  [data-page="bewerbungen"] {
    .bewerbung-header .row {
      text-align: center;
    }

    .stats-item {
      margin-bottom: 15px;
    }

    .table {
      th,
      td {
        padding: 8px 6px;
        font-size: 0.85rem;
      }
    }

    .pagination {
      font-size: 0.9rem;
    }
  }
}

/* Animationen nur für Bewerbungsseiten */
@keyframes bewerbung-pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}
