/* =========================================
1. Main Layout & Navigation
========================================= */
.main-layout {
  margin-top: 0.5rem;
}

@media (max-width: 992px) {
  .main-layout {
    display: flex;
    flex-wrap: wrap;
  }

  .main-layout .main-content,
  .main-layout .side-menu {
    width: 100%;
    float: none;
  }

  .main-layout .main-content {
    order: 1;
  }

  .main-layout .side-menu {
    order: 2;
    margin-top: 1rem;
  }
}

.nav ul li {
  list-style: none;
}

.nav ul {
  float: right;
  font-style: normal;
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* Apprise Library text – tight to the top-right */
.nav ul li .apprise-lib-ver {
  line-height: 1.1;
  margin-top: 0.1rem;
}

.nav ul li.api-status-nav,
.nav ul li .apprise-lib-ver {
  font-size: 0.75rem;
}

.theme {
  text-align: right;
  display: block;
  float: none;
  margin-top: 0.4rem;
}

.nav ul i {
  font-size: 2.0rem;
}

.error-page {
  font-weight: bold;
}

.error-page h1 {
  font-size: 5em;
  font-weight: inherit;
}

.error-page i {
  color: inherit !important;
}

.error-page i.spotlight {
  font-size: 10em;
}

.error-page pre code i {
  /* Better alignment */
  margin: -0.3em .5em 0 0;
}

img.apprise-logo,
img.apprise-mini-logo {
  max-width: 100%;
  display: block;
}

img.apprise-logo {
  height: 6em;
}

img.apprise-mini-logo {
  height: 2em;
  padding: 0 0.25rem;
}

.theme {
  text-align: right;
  display: block;
  float: right;
}

a.apprise-api-ver,
a.apprise-lib-ver {
  color: inherit;
  text-decoration: none;
}

.page-footer-legal {
  margin-top: 2rem;
  padding: 0.75rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
  font-size: 0.95rem;
  opacity: 0.8;
}

.page-footer-legal a {
  text-decoration: none;
}

.page-footer-legal a:hover {
  text-decoration: underline;
}

/* =========================================
2. Global Typography & Elements
========================================= */
input {
  display: block;
}

code {
  font-family: monospace;
  white-space: normal;
  padding: 0.2rem;
  border-radius: 4px;
}

h1,
h2,
h3,
h4,
h5 {
  margin-top: 0;
}

h4 {
  margin-bottom: 0.75rem;
}

h6 {
  font-weight: bold;
}

/* Specific H4 fix for welcome/details pages */
h4 em {
  font-size: 2.0rem;
  display: inline-block;
  margin: 0;
  padding: 0;
  word-break: break-all;
  line-height: 1.0em;
  font-style: normal;
  font-weight: bold;
}

td,
th {
  vertical-align: top;
  padding-top: 0;
}

textarea {
  height: 16rem;
  font-family: monospace;
}

.material-icons {
  display: inline-flex;
  vertical-align: middle;
}

/* =========================================
3. Page Specific: Welcome & Details
========================================= */
.api-welcome {
  margin-top: 0.5rem;
}

.api-welcome .section {
  max-width: 80rem;
}

.api-welcome .table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.api-welcome pre {
  white-space: pre-wrap;
  word-break: break-word;
}

.api-details {
  margin-top: 0.5rem;
}

.api-details .details-header p,
.api-details .details-summary {
  max-width: 70rem;
}

.api-details .collapsible-header {
  display: flex;
  align-items: center;
  padding: 0.6rem 1rem;
}

.api-details .plugin-index {
  font-family: monospace;
  font-size: 0.9rem;
  width: 3rem;
  text-align: right;
  margin-right: 0.5rem;
}

.api-details .plugin-chevron,
.api-details .plugin-status {
  margin-right: 0.4rem;
}

/* Apprise API status indicator */
.api-status-icon {
  vertical-align: middle;
  margin-left: 0.25rem;
  font-size: 1.1rem;
}

/* Loading spinner */
.api-status-icon.status-loading {
  animation: api-spin 1s linear infinite;
}

/* Error details text under the line */
.api-status-details {
  margin-left: 1.8rem;
  margin-top: 0.2rem;
  font-size: 0.85rem;
}

.nav ul li.api-status-nav {
  margin-top: 0.15rem;
}

.nav ul li.api-status-nav i {
  font-size: 1.4em;
}

.api-status-icon {
  vertical-align: middle;
  margin-left: 0.25rem;
  font-size: 1.1rem;
}

.api-status-icon.status-loading {
  animation: api-spin 1s linear infinite;
}

@keyframes api-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.api-details .service_name {
  width: auto;
  flex: 1 1 auto;
  margin: 0;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.api-details .plugin-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: 0.5rem;
}

.api-details .plugin-actions .material-icons {
  font-size: 1.2rem;
}

.getting-started li {
  padding: 0.3em 0;
}

.getting-started p {
  padding: 0.2em 0;
  margin: 0;
}

.detail-buttons--width {
  width: 90%;
  min-width: 60%;
  padding-left: 0;
}

/* =========================================
4. Config Page, Tabs & Cards
========================================= */
.collapsible-body {
  padding: 1rem 2rem;
}

.no-config .info {
  font-size: 3.3rem;
}

#overview strong {
  display: inline-block;
}

#overview pre {
  margin-left: 2.0rem;
}

/* Base Tab Structure */
.tabs .tab a {
  border-radius: 25px 25px 0 0;
}

body .tabs .tab a:hover,
body .tabs .tab a.active {
  font-weight: bold;
}

body .tabs .tab.disabled a,
body .tabs .tab.disabled a:hover,
body .tabs .tab.disabled a i,
body .tabs .tab.disabled a:hover i {
  font-weight: inherit;
  cursor: default;
}

.tabs.config-overview {
  margin-top: 0;
}

@media (max-width: 900px) {
  .tabs.config-overview {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
  }

  .tabs.config-overview .tab {
    flex: 0 0 auto;
  }
}

/* URL List Grid */
#url-list {
  display: block;
  /* Removes the Grid restriction */
  column-count: 1;
  /* Default to 1 column (Mobile) */
  column-gap: 1rem;
  /* Space between the two columns */
  padding: 0;
  margin: 0;
}

#url-list ul {
  margin: 0;
}

/* Force 2 columns on screens wider than tablets (768px) */
@media (min-width: 768px) {
  #url-list {
    column-count: 2;
  }
}

#url-list .card-panel {
  break-inside: avoid;
  page-break-inside: avoid;
  display: inline-block;
  width: 100%;
  margin-bottom: 0.8rem;
  border-radius: 12px;
  min-height: 4em;
  position: relative;
  padding: 0.5rem 0.75rem 1.8rem 0.75rem;
  box-sizing: border-box;
  float: none;
}

#url-list .url-header {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}

#url-list .url-header code.url-text {
  flex: 1 1 auto;
  margin-top: 0.2rem;
  display: block;
  overflow-x: hidden;
  overflow-y: hidden;
  white-space: normal;
  text-wrap: wrap;
  overflow-wrap: break-word;
  word-break: break-all;
}

#url-list code {
  overflow-x: hidden;
  overflow-y: hidden;
  white-space: wrap;
  text-wrap: wrap;
  overflow-wrap: break-word;
  border-radius: 5px;
  margin-top: 0.8rem;
  display: block;
}

#url-list .service_name {
  width: 40rem;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#url-list .card-panel .url-id {
  width: auto;
  margin: 0;
  background-color: inherit;
  padding: 0.15em 0.35em;
  font-size: 0.65em;
  border: 0;
  position: absolute;
  bottom: 0.45rem;
  right: 0.75rem;
  opacity: 0.9;
}

/* =========================================
5. Buttons, Chips & Inputs
========================================= */
.chip {
  margin: 0.3rem;
  cursor: pointer;
}

.chip.selected {
  font-weight: 600;
}

#url-list .card-panel .url-selected-icon {
  position: absolute;
  bottom: 0.45rem;
  left: 0.75rem;
  opacity: 0.9;
  line-height: 1;
  pointer-events: none;
}

#url-list .card-panel:not(.selected) .url-selected-icon {
  opacity: 0.55;
}

#url-list .card-panel .url-selected-icon .material-icons {
  font-size: 1.0rem;
}

#url-list .card-panel .chip {
  margin: 0.3rem 0.35rem 0.9rem 0;
}

#url-list .copy-url-btn,
.config-id-copy.btn-flat,
.snippet-copy-btn {
  border-radius: 999px !important;
  flex: 0 0 auto;
  padding: 0 0.35rem;
  min-width: 0;
  background-color: transparent;
}

#url-list .copy-url-btn {
  margin-top: 0.15rem;
}

#url-list .copy-url-btn .material-icons,
.config-id-copy.btn-flat .material-icons,
.snippet-copy-btn .material-icons {
  font-size: 1.1rem;
}

.config-id-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.25rem;
}

.config-id-copy.btn-flat {
  margin-left: 0.2rem;
}

code.config-id {
  font-size: 1em;
  font-weight: 700;
}

.code-snippet {
  position: relative;
  margin-bottom: 1rem;
}

.code-snippet pre {
  margin: 0;
}

.snippet-copy-btn {
  position: absolute;
  top: 0.35rem;
  right: 0.5rem;
}

.snippet-copy-btn i {
  /* Better alignment */
  margin: -0.3em 0 0 0;
}

/* File Input Hack */
.btn-file {
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
}

.btn-file input[type=file] {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 100%;
  min-height: 100%;
  font-size: 100px;
  text-align: right;
  filter: alpha(opacity=0);
  opacity: 0;
  outline: none;
  background: white;
  cursor: inherit;
  display: block;
}

.file-selected {
  line-height: 2.0em;
  font-size: 1.2rem;
  border-radius: 5px;
  padding: 0 1em;
  overflow: hidden;
}

/* Health Check */
#health-check {
  border-radius: 25px;
  padding: 2em;
  margin-bottom: 2em;
}

#health-check h4 {
  font-size: 30px;
}

#health-check h4 .material-icons,
#health-check li .material-icons {
  margin-top: -0.2em;
}

#health-check li .material-icons {
  font-size: 30px;
}

#health-check ul {
  list-style-type: disc;
  padding-left: 2em;
}

#health-check ul strong {
  font-weight: 600;
  font-size: 1.2rem;
  display: block;
}

.notify-top-row .input-field>label {
  position: static;
  transform: none;
  display: block;
  margin: 0 0 0.2rem 0;
  font-size: 0.9rem;
}

.notify-attachments-field input[type=file] {
  /* Hidden, we trigger it from our Browse button */
  display: none;
}

.notify-attachments-field .btn-file {
  display: inline-flex;
  margin-top: 0.25rem;
}

.notify-attachments-list {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.notify-attachments-list .attachment-chip {
  border-radius: 16px;
  padding: 0 0.75rem;
  line-height: 1.8;
  cursor: pointer;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
}

.notify-attachments-list .attachment-chip i.material-icons {
  font-size: 1.1rem;
  margin-left: 0.25rem;
}

#notify .row,
#notify .row .input-field {
  margin-top: 0.2em;
  margin-bottom: 0;
  padding-bottom: 0;
  padding-top: 0.3rem;
}

.notify-top-row .input-field label[for="id_tag"] {
  position: static;
  transform: none;
  display: block;
  margin-top: -0.1rem;
  margin-bottom: 0;
  font-size: 0.9rem;
}

.btn-clear-form {
  min-height: 4rem;
  height: auto;
  width: 100%;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.9rem;
  line-height: 1;
}

.btn-clear-form label {
  display: block;
  text-align: left;
  font-size: 0.95rem;
  color: inherit;
  max-width: 10.5ch;
  white-space: normal;
  word-break: keep-all;
  line-height: 1.15;
}

.btn-clear-form i {
  margin: 0;
  flex: 0 0 auto;
  font-size: 2.6rem;
  line-height: 1;
  opacity: 0.95;
}

/* SweetAlert2 – notification summary and logs */
.swal2-popup .notify-summary {
  text-align: center;
  margin: 0 auto 1rem;
  font-size: 1rem;
  font-weight: 500;
}

.swal2-popup .notify-log-panel {
  margin: 0 auto 0.5rem;
  padding: 0.75rem 1rem;
  max-height: 28rem;
  overflow-y: auto;
  overflow-x: auto;
  border-radius: 4px;
  text-align: left;
}

.swal2-popup .notify-log-panel ul.logs {
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

/* log lines */
.swal2-popup .notify-log-panel ul.logs li {
  display: flex;
  flex-direction: row;
  gap: 0.8rem;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.95rem;
  line-height: 1.4;
  padding: 0.05rem 0;
  white-space: pre-wrap;
}

.swal2-popup .notify-log-panel ul.logs li .log_time,
.swal2-popup .notify-log-panel ul.logs li .log_level {
  flex-shrink: 0;
}

/* =========================================
Apprise Configuration Editor (Grid Overlay)
========================================= */
.apprise-config-editor {
  display: grid;
  position: relative;
  margin-top: 0.5rem;
}

/* Shared styles for perfect alignment */
.apprise-config-editor textarea,
.apprise-config-highlight {
  grid-area: 1 / 1;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
  font-size: 14px !important;
  line-height: 22px !important;
  letter-spacing: 0px !important;
  padding: 15px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  border-radius: 4px;
  white-space: pre-wrap !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  overflow-y: hidden !important;
  margin: 0 !important;
  min-height: 250px;
}

.apprise-config-editor textarea {
  height: initial !important;
  background: transparent !important;
  color: transparent !important;
  z-index: 2;
  resize: vertical;
  border: 1px solid #444 !important;
}

.apprise-config-editor .apprise-config-highlight {
  z-index: 1;
  pointer-events: none;
  height: 100% !important;
  border: 1px solid transparent !important;
}

.apprise-config-highlight code {
  font-family: inherit !important;
  font-size: inherit !important;
  background: transparent !important;
  padding: 0 !important;
  color: inherit;
}

.apprise-config-highlight code,
.apprise-config-highlight .hljs {
  white-space: pre-wrap !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  font-family: inherit !important;
  font-size: inherit !important;
  line-height: inherit !important;
}

.apprise-config-editor textarea,
.apprise-config-highlight {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
  font-size: 14px !important;
  line-height: 22px !important;
  letter-spacing: 0px !important;
  padding: 15px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.apprise-config-editor textarea {
  border: 1px solid #444 !important;
  border-radius: 4px;
}

.apprise-config-highlight {
  border: 1px solid transparent !important;
  border-radius: 4px;
}

.config-format-field {
  margin-bottom: 0.75rem;
}

.config-format-field .select-wrapper {
  max-width: 10rem;
  width: 100%;
}

.config-format-field label[for="id_format"] {
  font-size: 0.9rem;
}