body, html {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100%;
    /* height: 100vh; */
    /* height: calc(var(--vh, 1vh) * 100); */

    /* overflow: hidden; */
    font-family: 'Open Sans', sans-serif;
}

#app{
position: relative;
  border-radius: 0px 0px 0px 0px;
  overflow: hidden;
  display: grid;
  align-items: start;
  align-content: start;
  justify-items: start;
  justify-content: stretch;
  z-index: 0;
  flex-grow: 1;
  /* height: 100vh; */
  height: 100%;
  width: 100vw;
  grid-template-rows: 1fr 10fr 1fr;
  grid-template-columns: 1fr 8fr 8fr 1fr;
  grid-auto-flow: column;

}


#header {
  display: grid;
  grid-template-columns: 1fr 8fr 8fr 1fr;
  grid-template-rows: 1fr;
  grid-column: 1 / 5;
  grid-row: 1;
  background-color: #f4e2c3;
  width: 100%;
  height: 100%;
}





#controls {
  grid-column: 3;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5em;
  height: 100%;
  width: 100%;
}




#title {
  grid-column: 2 / 3;
  grid-row: 1;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: left;
  font-size: 2em;
  height: 100%;
  width: 100%;
}



#container {
    width: 100%;
    /* height: calc(100% - 80px); */
    height: 100%;
    position: relative;
    background-color: #fbefdb;
    /* border: 1px solid black; */
    overflow: hidden;
    grid-column: 1 / 5;
    grid-row: 2;
}


#footer{
  display: grid;
  background-color: #f4e2c3;
  grid-template-columns: 1fr 8fr 8fr 1fr;
  grid-template-rows: 1fr;
  grid-column: 1 / 5;
  grid-row: 3;
  width: 100%;
  height: 100%;
}

/* Buttons */

#drawerBtn{
grid-column: 4;
grid-row: 1;
z-index: 1001;
display: flex;
width: 100%;
height: 100%;
align-items: baseline;
/* align-items: end;     */
cursor: pointer;
}

#drawerBtn img{
max-width: 100%;
max-height: 100%;
object-fit: contain;
}

#info{
grid-column: 1;
grid-row: 1;
display: flex;
width: 100%;
height: 100%;
 align-items: baseline;
 justify-content: center;
 cursor: pointer;
 transition: box-shadow 0.3s ease;
}
#info img {
 max-width: 100%;
 max-height: 100%;
 object-fit: contain;
}

#saveImg{
grid-column: 1;
grid-row: 1;
display: flex;
width: 100%;
height: 100%;
 align-items: end;
 justify-content: center;
 cursor: pointer;
 transition: box-shadow 0.3s ease;
}
#saveImg img {
 max-width: 100%;
 max-height: 100%;
 object-fit: contain;
}

#Trashbin {
grid-column: 4;
 grid-row: 1;
display: flex;
align-items: end;
justify-content: center;
width: 100%;
height: 100%;
cursor: pointer;
transition: box-shadow 0.3s ease;
/* box-sizing: border-box; */
}

#Trashbin img {
 max-width: 100%;
 max-height: 100%;
 object-fit: contain;
}


#Trashbin.highlight-trash {
box-shadow: 0 0 15px 5px rgba(255, 0, 0, 0.6);
border-radius: 8px;
}

/* Buttons End */


/* Text Input */

#textInput{
  position: absolute;
  top: 70%;
  left: 50%;
  transform: translate(-50%);
  padding: 10px 15px;
  width: 50%;
  height: 5%;
  font-size: 16px;
  border: 2px solid #ccc;
  border-radius: 8px;
  background-color: #fff;
  z-index: 10;
  touch-action: manipulation;
  grid-column: 2/4;
  grid-row: 2;

}

/* Text Input END */
.glide__slide .card {
  width: 100%;
  height: 100%;
  aspect-ratio: 105 / 148;
  background-size: cover;
  background-position: center;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}


#cardDrawer {
  flex: 1;
  width: 100%;
  height: 100%;
}







#drawer-container {
  display: grid;
  grid-template-columns: 1fr 11fr 1fr;
  grid-template-rows: 1fr 1fr 5fr 1fr 1fr;
  height: 100%;
  width:100%;
}

/* Card deck spans columns 2–5 and rows 2–4 */
#card-deck {
  grid-column: 2 / 3;
  grid-row: 2 / 5;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  grid-auto-rows: 1fr;
  background-color: #fbefdb;

  gap: 6px;
   overflow-y: auto;
    overflow-x: hidden;
    max-height: 100%;
}




/* Individual cards */
#card-deck .cardDeck {
  aspect-ratio: 105 / 148;
  background-size:contain;
  background-position: center;
  border-radius: 4px;
  cursor: pointer;
}

#btn-drawer {
  grid-column: 3;
  grid-row: 1/3;
  width: 100%;
  height: 100%;
  display: flex;
  
align-items: end;         /* vertical alignment: bottom */
  justify-content: flex-end; /* horizontal alignment: right */

  cursor: pointer;
}



#btn-drawer img{
 max-width: 100%;
 max-height: 100%;
 object-fit: contain;
}



#btn-add-card {
  grid-column: 3;
  grid-row: 4 / 6;
  width: 100%;
  height: 100%;
  display: flex;
  
align-items: end;         /* vertical alignment: bottom */
  justify-content: flex-end; /* horizontal alignment: right */

  cursor: pointer;
}

#btn-add-card img{
 max-width: 100%;
 max-height: 100%;
 object-fit: contain;
}













/* Maintain A6 aspect ratio */
.slot, .card {
    aspect-ratio: 105 / 148;
    position: absolute;
}

.slot {
    border: 1px dashed gray;
    pointer-events: none;
}

.card {
    cursor: move;
    z-index: 1000;
    background-repeat: no-repeat;
}


.pure-toggle-label {
position: relative !important;
top: auto !important;
display: block !important;
left:37px !important;
z-index: 9999 !important;
pointer-events: auto !important;
}

.pure-drawer[data-position="top"] {
  z-index: 1000 !important;

}




.pure-drawer {
    display: flex;
    overflow-x: hidden !important;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    /* padding: 10px; */
    background-color: #eee;
    height: 180px; 
    align-items: center;
    scroll-behavior: smooth;
    z-index: 1000 !important;
    background-color: #f4e2c3 !important;
}

.pure-drawer .card {
    flex: 0 0 auto;
    /* margin-right: 10px; */
    aspect-ratio: 105 / 148;
    background-size: cover;
    background-position: center;
    width: calc(100% / 5);
    position: relative;
}



