/* Import Google font - Poppins */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');
/* Import Google font - Cabin */
@import url('https://fonts.googleapis.com/css2?family=Cabin:wght@400;500;600;700&display=swap');
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}
body {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  background: #dedede;
  padding: 20px;
}

.header {
  width: 100%;
  max-width: 100%;
  margin-bottom: 20px;
  position: relative;
}

.site-title {
  font-family: 'Cabin', sans-serif;
  font-size: 36px;
  font-weight: 600;
  color: #333333;
  margin: 0;
  padding: 0;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-title-icon {
  font-size: 40px;
  color: #333333;
}

body.dark-mode .site-title {
  color: #e0e0e0;
}

body.dark-mode .site-title-icon {
  color: #e0e0e0;
}

.header table {
  width: 100%;
}

.header table td:first-child {
  width: auto;
}

.header table td:last-child {
  text-align: right;
  width: 100%;
  vertical-align: top;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 15px;
  justify-content: flex-end;
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
}

.homepage-link,
.reset-sorting-link {
  font-size: 12px;
  font-weight: 500;
  color: #333333;
  cursor: pointer;
  transition: color 0.3s ease;
  padding: 5px 10px;
  text-decoration: none;
  user-select: none;
  letter-spacing: 0.5px;
}

.homepage-link:hover,
.reset-sorting-link:hover {
  color: #192d54;
  text-decoration: underline;
}

body.dark-mode .homepage-link,
body.dark-mode .reset-sorting-link {
  color: #999;
}

body.dark-mode .homepage-link:hover,
body.dark-mode .reset-sorting-link:hover {
  color: #e0e0e0;
}

/* Homepage Modal */
.homepage-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s;
}

.homepage-modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.homepage-modal-content {
  background-color: #F8F8F8;
  margin: auto;
  padding: 30px;
  border-radius: 10px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

body.dark-mode .homepage-modal-content {
  background-color: #2d2d2d;
  color: #e0e0e0;
}

.homepage-modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  color: #999;
  cursor: pointer;
  transition: color 0.3s ease;
}

.homepage-modal-close:hover {
  color: #333;
}

body.dark-mode .homepage-modal-close:hover {
  color: #e0e0e0;
}

.homepage-modal-content h3 {
  margin-top: 0;
  margin-bottom: 20px;
  color: #192d54;
  text-align: left;
}

body.dark-mode .homepage-modal-content h3 {
  color: #e0e0e0;
}

.homepage-instructions {
  line-height: 1.6;
  text-align: left;
}

.homepage-instructions p {
  margin-top: 15px;
  margin-bottom: 10px;
  font-weight: 600;
}

.homepage-instructions ol {
  margin-left: 20px;
  margin-bottom: 15px;
}

.homepage-instructions li {
  margin-bottom: 8px;
}

.url-with-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.homepage-instructions code {
  background-color: #e0e0e0;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: monospace;
  font-size: 0.9em;
  color: #192d54;
  word-break: break-all;
}

body.dark-mode .homepage-instructions code {
  background-color: #3d3d3d;
  color: #e0e0e0;
}

.copy-icon {
  font-size: 16px;
  color: #666;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
  padding: 2px;
  flex-shrink: 0;
}

.copy-icon:hover {
  color: #192d54;
  transform: scale(1.1);
}

.copy-icon.copied {
  color: #4caf50;
}

body.dark-mode .copy-icon {
  color: #999;
}

body.dark-mode .copy-icon:hover {
  color: #e0e0e0;
}

body.dark-mode .copy-icon.copied {
  color: #66bb6a;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.containers-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 20px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.container {
  flex: 1 1 300px;
  min-width: 250px;
  max-width: 100%;
  background: #F8F8F8;
  border-radius: 7px;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  padding: 20px;
  margin-bottom: 20px;
  box-sizing: border-box;
}

.container-ghost {
  opacity: 0.4;
  background: #e0e0e0;
}

.container.sortable-drag {
  opacity: 0.5;
}

.container h2 {
  margin-bottom: 15px;
  color: #373737;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: move;
}

.container h2 .drag-handle-icon {
  cursor: move;
  color: #999;
  font-size: 18px;
  margin-left: auto;
  padding: 5px;
  transition: color 0.2s ease;
}

.container h2 .drag-handle-icon:hover {
  color: #192d54;
}



.category-container {
  padding: 10px;
  margin: 10px 0;
  background: #f5f5f5;
  border-radius: 8px;
  cursor: move;
}

.category-container.dragging {
  opacity: 0.5;
  background: #e0e0e0;
}

.category-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.category-header h2 {
  margin: 0;
  flex-grow: 1;
}

.drag-handle {
  cursor: move;
  padding: 5px;
  margin-right: 10px;
}


.sortable-list {
  list-style: none;
}

.sortable-list .item {
  display: flex;
  align-items: center;
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 10px;
  margin-bottom: 10px;
  background: #fff;
  cursor: move;
}

.sortable-list .item .details {
  display: flex;
  align-items: center; /* This centers the favicon and form vertically */
  flex: 1;
}

.sortable-list .item img {
  width: 24px;
  height: 24px;
  margin-right: 10px;
  border-radius: 50%;
  margin-top: 6px;
  object-fit: contain; /* This ensures the favicon maintains its aspect ratio */
}

.sortable-list .item form {
  flex: 1;
  display: flex; /* Add this to align the input field */
  align-items: center; /* This centers the input field vertically */
}

.sortable-list .item input[type="text"] {
  width: 100%;
  padding: 5px;
  border: 1px solid #ddd;
  border-radius: 3px;
}

.sortable-list .item .uil-draggabledots {
  margin-left: 10px;
  color: #555555;
}

.sortable-list .item.dragging {
  opacity: 0.5;
  position: absolute;
  pointer-events: none;
  z-index: 100;
}

.sortable-ghost {
    opacity: 0.5;
    background: #c8ebfb;
}

.sortable-list .item {
    cursor: move;
}

/* ... rest of your existing styles ... */

@media (max-width: 1200px) {
  .container {
    max-width: calc(50% - 10px); /* 2 columns for medium-sized screens */
    flex-basis: calc(50% - 10px);
  }
}

@media (max-width: 768px) {
  .container {
    flex-basis: 100%;
    max-width: 100%;
    min-width: 0;
  }
  
  body {
    padding: 20px 10px;
  }
  
  .containers-wrapper {
    gap: 15px;
  }
  
  .site-title {
    font-size: 32px;
  }
  
  .site-title-icon {
    font-size: 36px;
  }
}

@media (min-width: 769px) and (max-width: 1200px) {
  .container {
    flex-basis: calc(50% - 10px);
    max-width: calc(50% - 10px);
  }
}

@media (min-width: 1201px) and (max-width: 1600px) {
  .container {
    flex-basis: calc(33.33% - 14px);
    max-width: calc(33.33% - 14px);
  }
}

@media (min-width: 1601px) and (max-width: 2000px) {
  .container {
    flex-basis: calc(25% - 15px);
    max-width: calc(25% - 15px);
  }
}

@media (min-width: 2001px) {
  .container {
    flex-basis: calc(20% - 16px);
    max-width: calc(20% - 16px);
  }
}

.more-link {
    display: block;
    text-align: center;
    margin-top: 10px;
    color: #6e93f7;
    text-decoration: none;
    cursor: pointer;
}

.more-link:hover {
    text-decoration: underline;
}

/* Theme Toggle - already defined above */

.theme-icon {
  font-size: 18px;
  user-select: none;
  transition: color 0.3s ease;
  cursor: pointer;
}

#theme-light {
  color: #333333;
}

#theme-dark {
  color: #999;
}

.theme-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #333333;
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* Dark mode active state */
body.dark-mode #theme-light {
  color: #666;
}

body.dark-mode #theme-dark {
  color: #e0e0e0;
}

body:not(.dark-mode) #theme-light {
  color: #333333;
}

body:not(.dark-mode) #theme-dark {
  color: #999;
}

/* Dark Mode Styles */
body.dark-mode {
  background: #1a1a1a;
}

body.dark-mode .container {
  background: #484848;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
}

body.dark-mode .container h2 {
  color: #e0e0e0;
}

body.dark-mode .container h2 .drag-handle-icon {
  color: #999;
}

body.dark-mode .container h2 .drag-handle-icon:hover {
  color: #e0e0e0;
}

body.dark-mode .container-ghost {
  background: #3d3d3d;
}

body.dark-mode .sortable-list .item {
  background: #3d3d3d;
  border-color: #222222;
  color: #e0e0e0;
}

body.dark-mode .sortable-list .item input[type="text"] {
  background: #2d2d2d;
  border-color: #222222;
  color: #e0e0e0;
}

body.dark-mode .sortable-list .item input[type="text"]::placeholder {
  color: #999;
}

body.dark-mode .sortable-ghost {
  background: #4a5568;
}

body.dark-mode .sortable-list .item .uil-draggabledots {
  color: #999;
}

body.dark-mode .more-link {
  color: #6e93f7;
}

body.dark-mode .more-link:hover {
  color: #8aabff;
}