  body {
      font-family: sans-serif;
      padding: 10px;
      margin: 0;
      	cursor:url('https://aglioeollieo.neocities.org/cursor/nouploadToImgur()rmal.gif'), auto;
	    background-color:#E7E6E9;
      background-attachment: fixed;
      padding:10px;
      background-image: linear-gradient(#7053d0 1px, transparent 1px), linear-gradient(to right, #7053d0 1px, #c3bcfa 1px);
      background-size: 20px 20px;
    }
    
    a:link,
a:visited,
a:active {
	color: #7053d0;
	text-decoration: none;
	font-weight: bold;
	cursor:url('https://aglioeollieo.neocities.org/cursor/pointer.gif'), pointer;
}

a:hover {
	color: #C3BCFA;
	cursor:url('https://aglioeollieo.neocities.org/cursor/pointer.gif'), pointer;
}

::selection {
    background-color: #7053d0; 
    color: white;
}

::-moz-selection {
    background-color: #7053d0;
    color: white;
}
    
h2 {
  text-align: center;
  font-size: 16px;
  margin: 3px;
  color: #fff;        
  background-color: #7053d0;
  padding: 5px;           
  border-radius: 4px;
}

hr {
  color: #7053d0;
  border-radius: 4px;
    margin: 5px 0;
}

.color-filters-row {
  display: flex;
  flex-wrap: wrap; 
  gap: 5px;       
  justify-content: center;
}

.color-filters-row label {
  white-space: nowrap;
  cursor: pointer;
}

#main-container {
  display: flex;
  gap: 5px;
  max-width: 1200px;
  margin: 0 auto 0 auto;
  flex-wrap: wrap;
  
  justify-content: center; 
}

    #left-side {
      flex: 1 1 550px;
      background: white;
      border-radius: 8px;
      padding: 10px 10px;
  box-shadow: 6px 6px 0px rgba(112, 83, 208, 0.6); 
    z-index: 9999;
      max-width: 550px;
      display: flex;
      flex-direction: column;
      align-items: center;
      outline: 2px #7053d0;
      font-size: 0.75rem;
    }
#selected-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  aspect-ratio: 1 / 1;
  gap: 0;
  width: 100%;
  max-width: 500px;
  background: #eee;
}

/* Hide 3x3 grid overlays when toggled */
#selected-grid.icons-hidden .grid-icon { display: none !important; }

#selected-grid img {
      width: 100%;
      aspect-ratio: 1 / 1;
      object-fit: cover;
      cursor: pointer;
      border: none;
      box-shadow: none;
      margin: 0;
      padding: 0;
    }
#selected-grid img.selected {
      outline: 2px #7053d0;
    }
#left-buttons {
      display: flex;
      gap: 5px;
      width: 100%;
      justify-content: center;
      margin-top: 3px;
    }
#left-buttons button {
      padding: 6px 8px;
      font-size: 1rem;
      cursor: pointer;
    }
  
#right-side {
      flex: 1 1 300px;
      max-width: 550px;
      background: white;
      border-radius: 8px;
      padding: 10px;
  box-shadow: 6px 6px 0px rgba(112, 83, 208, 0.6); 
    z-index: 9999;
      max-height: 650px;
      overflow-y: auto;
      outline: 2px #7053d0;
    }
#right-side label {
      display: flex;
      font-weight: 500;
      cursor: pointer;
    }

#right-side input[type="checkbox"] {
      margin-right: 5px;
      vertical-align: middle;
    }
#right-side select,
#right-side input[type="range"] {
      margin-left: 8px;
      vertical-align: middle;
    }
#right-side button {
  padding: 5px 8px 5px 8px;
      font-size: 1rem;
      cursor: pointer;
      width: 60%;
      box-sizing: border-box;
    }
#right-side button:nth-child(2n) {
      margin-right: 0;
    }

#preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 5px;
  width: 94%;
  margin: 0 auto 5px auto;
  background: white;
  border-radius: 8px;
  padding: 10px 10px;
  box-shadow: 6px 6px 0px rgba(112, 83, 208, 0.6); 
    z-index: 9999;
}

    @media (min-width: 600px) {
      #preview {
        column-count: 2;
      }
    }
    @media (min-width: 900px) {
      #preview {
        column-count: 3;
      }
    }
    @media (min-width: 1100px) {
      #preview {
        column-count: 4;
      }
    }
    @media (min-width: 1300px) {
      #preview {
        column-count: 6;
      }
    }
    @media (min-width: 1500px) {
      #preview {
        column-count: 8;
      }
    }
    
#preview img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  display: block;
  cursor: pointer;
  position: relative;
}

#preview .preview-item {
  position: relative;
  display: inline-block;
  border-radius: 10px;
  overflow: hidden;
}

#preview .preview-item.selected::after {
  content: "";
  position: absolute;
  top: 0px;
  left: 0px;
  width: 100%;
  height: 100%;
  background-color: rgba(112, 83, 208, 0.5);
  pointer-events: none;
  z-index: 1;
}

button {
  background-color: #7053d0;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 5px 8px 5px 8px;
  margin-bottom: 3px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}

button:hover {
  background-color: #C3BCFA;
  color: #7053d0;
}

/*
/*input[type="checkbox"] {
/*  appearance: none;
/*  -webkit-appearance: none;
/*  width: 16px;
/*  height: 16px;
/*  border: 2px solid #7053d0;
/*  border-radius: 3px;
/*  cursor: pointer;
/*  position: relative;
/*  vertical-align: middle;
/*  background-color: white;
/*  transition: background-color 0.3s ease, border-color 0.3s ease;
/*}

input[type="checkbox"]:checked {
  background-color: #C3BCFA;
  border-color: #7053d0;
}

input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 1px;
  top: -3px;
  width: 5px;
  height: 9px;
  border: solid #7053d0;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
*/
.loading-icon {
  width: 14px !important;
  height: 14px !important;
  vertical-align: middle;
}

#backToTopBtn {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  background-color: #333;
  color: white;
  border: none;
  padding: 10px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

#backToTopBtn:hover {
  opacity: 1;
}

#box {
  max-width: 90%;
  margin: 0 auto 5px auto;
  background: white;
  border-radius: 8px;
  padding: 10px 10px;
  box-shadow: 6px 6px 0px rgba(112, 83, 208, 0.6); 
    z-index: 9999;
  font-size: 0.75rem;
}

#box2 {
  max-width: 90%;
  margin: 0 auto 5px auto;
  background: white;
  border-radius: 8px;
  box-shadow: 6px 6px 0px rgba(112, 83, 208, 0.6); 
    z-index: 9999;
  font-size: 0.75rem;
}

#selected-grid img.dragging {
  opacity: 0.5;
  border: 2px dashed #7053d0;
}

.popup {
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #ffffff;
  border: 2px solid #7053d0;
  border-radius: 8px;
  width: 400px;
  box-shadow: 6px 6px 0px rgba(112, 83, 208, 0.6); 
    z-index: 9999;
  display: flex;
  flex-direction: column;
}

.popup-header {
  background-color: #7053d0;
  color: white;
  padding: 6px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  cursor: url('https://aglioeollieo.neocities.org/images/move.cur'), move;
  user-select: none;
}

.popup-title {
  font-weight: bold;
  font-size: 14px;
}

.popup-close {
  background-color: #C3BCFA;
  border: none;
  font-size: 14px;
  color: #7053d0;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.popup-close:hover {
  background-color: #7053d0;
  color: white;
}

.popup-content {
  padding: 10px;
  color: #333;
  font-size: 14px;
  background-color: #f8f6ff;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  max-height: 500px;
  overflow-y: auto;
}

.hidden {
  display: none;
}



/* WebKit-based browsers (Chrome, Edge, Safari) */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #f0ecff;
  border-radius: 6px;
}

::-webkit-scrollbar-thumb {
  background-color: #7053d0; 
  border-radius: 6px;
  border: 2px solid #f0ecff; 
}

::-webkit-scrollbar-thumb:hover {
  background-color: #C3BCFA; 
}

/* Firefox */
* {
  scrollbar-width: auto;
  scrollbar-color: #7053d0 #f0ecff;
}

body.noscroll {
  overflow: hidden;
  height: 100vh;
  touch-action: none;
}

.popup-content ul.custom-list {
  list-style: none;
  padding-left: 1.5em;
  margin: 0;
}

.popup-content ul.custom-list li {
  position: relative;
  padding-left: 1.2em;
  margin-bottom: 0.4em;
}

.popup-content ul.custom-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.2em;
  width: 14px;
  height: 14px;
  background-image: url('https://aglioeollieo.neocities.org/images/dbf3hs0-4125aa37-452d-4128-be4f-97558fff6ead.gif');
  background-size: contain;
  background-repeat: no-repeat;
}

#header-container {
  background:#7053d0;
  border-radius: 8px 8px 0 0;
  font-weight:600;
  font-size:16px;
  padding:5px;
  color:#fff;
}

#tray-container {
  display: flex;
  gap: 3px;
  width: 95%;
  min-height: 50px;
  margin: 5px auto;
}

#recently-used-box,
#favourites-box {
  flex: 1 1 50%;
  min-height: 50px;
  max-width: 50%;        /* ⬅ cap width */
  background: white;
  border-radius: 8px;
  box-shadow: 6px 6px 0px rgba(112, 83, 208, 0.6); 
    z-index: 9999;
  overflow-x: auto;      /* ⬅ enable horizontal scroll */
}

#uploaded-box {
  width: 95%;
  min-height: 50px;
  margin-bottom: 5px;
  background: white;
  border-radius: 8px;
  box-shadow: 6px 6px 0px rgba(112, 83, 208, 0.6);
  z-index: 9999;
  overflow-x: auto;
}

#uploadedGallery {
    display: flex;
    flex-wrap: wrap;
    max-width: 100%;
    padding: 5px;
    gap: 3px;
    min-height: 100px;
    max-height: 100px;
    justify-content: flex-start;  /* align images to the left */
    overflow-x: hidden;  
    overflow-y: auto;  
    background: white;              /* match tray containers */
    border-radius: 8px;             /* rounded corners */
    z-index: 9999;
    display: block; /* ✅ remove inline spacing */
  margin: 0;      /* ✅ ensure no margin */
}

#uploadedGallery img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border: 0px solid #7053d0;
  border-radius: 4px;
}
#uploadedGallery img.selected {
    outline: 2px solid #7053d0;
    box-shadow: 6px 6px 0px rgba(112, 83, 208, 0.6); 
}

#tray-title {
 background:#7053d0;
 border-radius:8px 8px 0 0;
 font-weight:600;
 font-size:12px;
 padding: 5px 5px 0px 5px;
 color:#fff;   
}

#cropPopup {
  width: 450;
  max-width: 450px;
  height: 80vh;       /* scale with viewport height */
  max-height: 550px;  /* cap at 550px so it doesn’t get too tall */
}

#cropImage {
    max-width: 400px;
    max-height: 400px;
    display: block;
    margin: auto;
    max-width: 380px;
    max-height: 380px;
}

#cropContainer {
    position: relative;
    flex: 1;
}

#cropOverlay {
    position: absolute;
    border: 2px dashed #7053d0;
    width: 100px;
    height: 100px;
    top: 50px;
    left: 50px;
    background-color: rgba(0,0,0,0.2);
    cursor: move;
    box-sizing: border-box;
}


#lightness-check {
display: flex;
gap: 5px;
flex-wrap: wrap;
justify-content: center;
}

#btsMemberFilterBox {
display: none;
margin-top: 3px;
}

#italic-text1 {
    font-size: 0.75rem;
    max-width: 90%;
    font-style: italic;
    text-align: left;
}

#italic-text {
    font-size: 0.75rem;
    font-style: italic;
}

/* === TOGGLE BUTTON FILTER STYLING === */

/* Hide the native checkboxes */
input[type="checkbox"] {
  display: none;
}

/* Style all filter labels as toggle buttons */
.color-filters-row label,
#lightness-check label,
.show-filters-row label,
#bts-member-filters label {
  display: inline-block;         /* make them behave like buttons */
  background-color: #7053d0;     /* dark purple */
  color: #fff;
  border-radius: 4px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.3s ease, color 0.3s ease;
  user-select: none;
}

/* Hover effect */
.color-filters-row label:hover,
#lightness-check label:hover,
.show-filters-row label:hover,
#bts-member-filters label:hover {
  background-color: #C3BCFA;  /* light purple */
  color: #7053d0;
}

/* Active (checked) state */
input[type="checkbox"]:checked + label {
  background-color: #C3BCFA;  /* stay light when selected */
  color: #7053d0;
}

/* Force checked state styles for filter buttons */
#lightness-check input[type="checkbox"]:checked + label,
.color-filters-row input[type="checkbox"]:checked + label,
.show-filters-row input[type="checkbox"]:checked + label,
#bts-member-filters input[type="checkbox"]:checked + label {
  background-color: #C3BCFA !important;
  color: #7053d0 !important;
}

/* Layout for the two upload sections */
#imgUploadBox {
display: flex;
  flex-direction: column; /* stack vertically instead of side-by-side */
  gap: 10px;
  margin-top: 3px;
  align-items: stretch; /* make them align full width */
}

/* Style each section */
#imgUploadBox .upload-section {
  text-align: center;
  padding: 0px;
}


/* Status messages smaller + subtle */
#urlAddStatus,
#imgurUploadStatus {
  font-size: 0.8rem;
  color: #555;
}

#spacer {
    height: 5px;
}

#filters-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 3px;
  flex-wrap: wrap; /* allows stacking on smaller screens */
}

/* Left column slightly narrower */
#filters-container .filters-column:first-child {
  flex: 0.9; /* slightly narrower */
  min-width: 200px;
  text-align: center;
  padding: 5px;
  /*border-right: 2px solid #7053d0;*/
}

/* Right column slightly wider */
#filters-container .filters-column:last-child {
  flex: 1.1; /* slightly wider */
  min-width: 200px;
  text-align: center;
  padding: 5px;
}

#favourites {
    display:flex;
    gap:3px;
    overflow-x:auto;
    padding:5px;
    max-height:90px;
    min-height: 50px;
}

#recently-used  {
    display:flex;
    gap:3px;
    overflow-x:auto;
    padding:5px;
    max-height:90px;
    min-height: 50px;
}

.upload-item {
  position: relative;
  display: inline-block;
}

.upload-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}

.upload-item .upload-checkbox {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  cursor: pointer;
  z-index: 10;               /* ensure it's above the image */
  accent-color: #7053d0;     /* optional: purple checkbox */
  background: white;         /* make sure it's visible on dark images */
}

#uploadedGallery .upload-checkbox {
  display: inline-block !important;
  position: absolute;
 top: 2px;        /* ⬅ move to top */
  right: 2px;      /* ⬅ move to right */
  width: 16px;
  height: 16px;
  z-index: 5;
  background: white;
  border: 1px solid #7053d0;
  border-radius: 3px;
  cursor: pointer;
}