/* -------------------------------------------------
   GLOBAL PAGE BACKGROUND THEME
--------------------------------------------------*/
body {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Inter, Arial, sans-serif;
    background: linear-gradient(to bottom, #0a0b0e, #14161d);
    color: #e6eef8;
    margin: 0;
}

/* old topbar kept for safety but unused */
.topbar {
    display: none !important;
}

/* PANELS */
.panel {
    background: #10141b;
    border: 1px solid #1e2633;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

/* FORMS + TEXT */
h2 {
    margin: 0 0 12px 0;
    font-weight: 700;
}

.row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

label {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

input, select, textarea {
    background: #0c0f14;
    border: 1px solid #1e2633;
    color: #dfe7f2;
    border-radius: 8px;
    padding: 10px;
}

textarea {
    min-height: 130px;
}

/* BUTTONS */
.btn {
    background: #1f6feb;
    color: #fff;
    border: 0;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
}

.btn.secondary {
    background: #2d3748;
}

.muted {
    opacity: .7;
}

/* TABLES */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    border-bottom: 1px solid #1e2633;
    padding: 10px;
    text-align: left;
}

/* DESKTOP FONT BOOST */
@media (min-width: 900px) {
    html {
        font-size: 20px !important;
    }
    h2 {
        font-size: 1.6rem;
    }
    label,
    input,
    select,
    button,
    .muted,
    textarea {
        font-size: 1.1rem;
    }
    .btn {
        font-size: 1.1rem;
        padding: 10px 16px;
    }
}

/* Library delete button */
.btn.secondary[data-delete-id] {
  background: #b91c1c;
  border-color: #b91c1c;
}
.btn.secondary[data-delete-id]:hover {
  background: #dc2626;
}


/* ============================================
   LIBRARY – MOBILE CARD LAYOUT
   ============================================ */

/* Desktop: keep original table, hide cards */
@media (min-width: 769px) {
  .lib-cards {
    display: none;
  }
}

/* Mobile: show cards, hide table */
@media (max-width: 768px) {
  /* Make sure the table really disappears on phones */
  .table#tbl {
    display: none !important;
  }

  /* Card container */
  .lib-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 10px;
    margin-bottom: 10px;
  }

  /* Individual card */
  .lib-card {
    background: radial-gradient(circle at top left,
      #1f2432 0,
      #11151f 50%,
      #090b10 100%);
    border-radius: 14px;
    border: 1px solid #262e3f;
    padding: 14px 16px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
  }

  .lib-card-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
  }

  .lib-card-title {
    font-weight: 600;
    font-size: 1rem;
  }

  .lib-card-meta {
    font-size: 0.8rem;
    opacity: 0.7;
  }

  .lib-card-body {
    margin-top: 4px;
    font-size: 0.9rem;
  }

  .lib-card-line {
    display: flex;
    justify-content: space-between;
    margin: 3px 0;
  }

  .lib-card-label {
    opacity: 0.7;
    margin-right: 6px;
  }

  .lib-card-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
  }

  .lib-card-actions .btn {
    flex: 1;
    text-align: center;
  }
}

@media (max-width: 768px) {
  /* Make delete in cards bright red */
  .lib-card-actions .btn.delete-btn {
    background: #d93636 !important;
    border: 1px solid #a32727 !important;
    color: #fff !important;
  }

  .lib-card-actions .btn.delete-btn:hover {
    background: #c22f2f !important;
  }
}

/* ============================================================
   MAKE DELETE BUTTON RED (TABLE + MOBILE CARDS)
   ============================================================ */

/* Table version */
.actions .btn.secondary {
    background: #d93636 !important;
    border: 1px solid #a32727 !important;
    color: #fff !important;
}

.actions .btn.secondary:hover {
    background: #c22f2f !important;
}

/* Mobile card version */
.lib-card-actions .btn.secondary {
    background: #d93636 !important;
    border: 1px solid #a32727 !important;
    color: #fff !important;
}

.lib-card-actions .btn.secondary:hover {
    background: #c22f2f !important;
}


/* REAL FIX — style the mobile card Delete button */
@media (max-width: 768px) {
  .lib-card-actions .btn.danger,
  .lib-card-actions button[data-delete-id] {
      background: #d93636 !important;
      border: 1px solid #a32727 !important;
      color: #fff !important;
  }
  .lib-card-actions .btn.danger:hover,
  .lib-card-actions button[data-delete-id]:hover {
      background: #c22f2f !important;
  }
}

@media (max-width: 768px) {
  .lib-card-actions .btn.danger,
  .lib-card-actions button[data-delete-id] {
      background: #d93636 !important;
      border: 1px solid #a32727 !important;
      color: #fff !important;
      box-shadow: 0 0 10px rgba(217, 54, 54, 0.35) !important;
  }
}