/* RESET */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  color: #e6edf3;

  background-image: url(opeyemi-adisa.jpg);
  background-position: center;
  background-size: cover;
  background-attachment: fixed;

  min-height: 100vh;
}

/* HEADER */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;

  position: sticky;
  top: 0;
  z-index: 100;

  background: rgba(0, 0, 0, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);

  clip-path: ellipse(100% 70% at 50% 30%);
}

.header h1 {
  font-weight: 600;
  letter-spacing: -0.5px;
}

/* LAYOUT */
.container {
  padding: 40px;
  display: grid;
  gap: 30px;
}

/* CARDS */
.card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

/* TEXT */
h2 {
  font-weight: 600;
  margin-bottom: 6px;
}

.active-items {
  display: flex;
  flex-direction: row; /* side by side on large screens */
  gap: 12px;
  flex-wrap: wrap;
}

.active-item-block {
  flex: 1;
  min-width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  border-radius: 12px;
  background: var(--color-background-info);
  border: 0.5px solid var(--color-border-info);
}

/* items listing styling */
.item-label {
  font-size: 0.9rem;
  color: #f8f8ff;
  text-transform: capitalize;
}
.item-count {
  font-size: 0.9rem;
  font-weight: 600;
}
.item-name-tag {
  font-size: 0.8rem;
  color: #f8f8ff;
  opacity: 0.85;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

@media (max-width: 480px) {
  .active-items {
    flex-direction: column; /* stacks vertically on small screens */
  }
  .active-item-block {
    flex-direction: row;
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .item-name-tag {
    flex-basis: 100%;
    text-align: right;
  }

  .header {
    padding: 16px 20px;
  }

  .modal {
    width: 92vw;
    padding: 20px;
  }
}

.icon-box {
  height: 80px;
  border-radius: 12px;
  background: linear-gradient(145deg, #1b2a3a, #101a28);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* LIBRARY */
.library {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-direction: column;
  max-height: 400px;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.library-item {
  position: relative;
  padding: 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.library-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pattern-title {
  flex: 1;
  min-width: 0; /* required for ellipsis to work in a flex child */
  font-size: 13px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.active-badge {
  flex-shrink: 0;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(45, 108, 223, 0.2);
  color: #7fa8f0;
  border: 0.5px solid rgba(45, 108, 223, 0.4);
  white-space: nowrap;
}

.pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.actions a,
.actions button {
  text-decoration: none;
  opacity: 0.6;
  background: none;
  border: none;
}

.actions a:hover,
.actions button:hover {
  opacity: 1;
}

/* BUTTONS */
.btn {
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: 0.2s ease;
  text-align: center;
  display: inline-block;
}

button {
  cursor: pointer;
}

.btn.primary {
  background: linear-gradient(135deg, #2d6cdf, #1f4db8);
  color: white;
}

.btn.secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #a8b3c7;
}

.btn.danger {
  background: linear-gradient(135deg, #c75c4a, #a94438);
  color: white;
}

.btn:hover {
  transform: translateY(-1px);
}

.button-row {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
}

.full {
  width: 100%;
  margin-top: 10px;
}

/* MODALS */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);

  display: flex;
  visibility: hidden;
  align-items: center;
  justify-content: center;

  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
  z-index: 9999;
}

.modal-overlay:target {
  opacity: 1;
  display: flex;
  pointer-events: auto;
  visibility: visible;
}

.modal-overlay.active {
  opacity: 1;
  display: flex;
  pointer-events: auto;
  visibility: visible;
}

.modal {
  position: relative;
  width: 400px;
  padding: 24px;
  border-radius: 18px;

  background: rgba(20, 30, 45, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.06);

  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);

  animation: scaleIn 0.2s ease;

  max-height: 85vh;
  overflow-y: auto;
}

.modal-overlay.small .modal {
  width: 320px;
}

@keyframes scaleIn {
  from {
    transform: scale(0.96);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* CLOSE */
.close {
  position: absolute;
  top: 12px;
  right: 16px;
  text-decoration: none;
  font-size: 20px;
  color: #a8b3c7;
}

/* FORM */
input {
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  margin-bottom: 12px;
  border-radius: 10px;

  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #e6edf3;
}

input:focus {
  outline: none;
  border-color: #2d6cdf;
  box-shadow: 0 0 0 2px rgba(45, 108, 223, 0.2);
}

label {
  font-size: 0.9rem;
  color: #a8b3c7;
}

/* RADIO */
.radio {
  display: block;
  margin: 10px 0;
  color: #a8b3c7;
}

.radio input {
  margin-right: 8px;
}

/* DANGER */
.modal.danger h3 {
  color: #ff6b6b;
}
