@import url('https://fonts.googleapis.com/css?family=Roboto:300');

body { font-family: 'Roboto', 'Tahoma'; margin: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
	}
	
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 5px; padding: 20px; }

.card {
    display: flex;
    flex-direction: column;
    width: 300px; 
	max-width: 100%;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px;
    box-sizing: border-box;
  overflow: hidden;
  transition: background-color 0.4s ease;
}

.card-image {
  width: 100%;
  height: 300px; 
  object-fit: cover;
  transition: height 0.5s ease;
  margin: 0;
  padding: 0;
  display: block;
}

.lightbox img {
  transition: opacity 0.3s ease, transform 0.3s ease;
}


/* Expanded image – no scale, only height change */
.card-image.expanded-img {
  height: 100%;
}


.card * {
  box-sizing: border-box;
  max-width: 100%;
  word-wrap: break-word;
  white-space: normal;
}

.card h3, .card p {
    margin: 4px 0;
}
.card img { width:100%; border-radius: 6px; margin-bottom:5px; 
    object-fit: cover; }

.versionthing,
.slotrarthing,
.card-content h3 {
  display: block;
  width: 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: clip; 
}

/* Filters inside panel */
.filters { display: flex; flex-direction: column; gap: 10px; }
.filter-wrapper { position: relative; }
.filter-wrapper input, .filter-wrapper select { width: 100%; padding-right: 25px; box-sizing: border-box; }

/* Clear button for filters */
.clear-filter {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #888;
  font-weight: bold;
  user-select: none;
  display: none;
}
.filter-wrapper input:not(:placeholder-shown) ~ .clear-filter{
  display: inline;
}
.filter-wrapper select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: white;
  padding-right: 20px;
}

.filterthing {width:100%; height:30px; border-radius:7px;
border:1px solid #ccc; padding:5px;}

.filterthing option.elegant { background-color: #F6DDB7; }
.filterthing option.cool    { background-color: #D5E4EC; }
.filterthing option.fresh   { background-color: #D6E2C7; }
.filterthing option.sweet   { background-color: #FFDCDB; }
.filterthing option.sexy   { background-color: #E0D6EC; }

p.versionthing {text-align:right; color:#777;}
.slotrarthing {
    display: flex;
    justify-content: space-between; 
    align-items: center;
}
.slotthing, .raritything {
    white-space: nowrap;
}
.raritything {margin-right:10px;}

/* Pagination */
.pagination { margin: 20px; text-align: center; }

.pagination a,
.pagination span {
    margin: 0 5px;
    text-decoration: none;
    color: #007bff;
    cursor: pointer;
    font-weight: normal;
    pointer-events: auto;
}

.resonancelink a {
    text-decoration: none;
    color: #007bff;
    cursor: pointer;
    font-weight: normal;
    pointer-events: auto;
}

/* Active page */
.pagination .active {
    font-weight: bold;
    color: #000;
    cursor: default;
    pointer-events: none;
}

/* Labels box */
.labels-box { display: flex; flex-wrap: wrap; gap: 5px; margin: 0px;
  justify-content: center; }
.label-item { transition: 0.15s; }


body {
    margin: 0;
    transition: margin-left 0.3s ease;
}

/* Hamburger button */
#hamburgerBtn {
    font-size: 28px;
    cursor: pointer;
    position: fixed;
    z-index: 1100;
    top: 10px;
    left: 10px;
    transition: left 0.3s ease;
	width: 50px;
	height: 50px;
	background: #fff;
	border:1px solid #ccc; border-radius:8px;
}
#hamburgerBtn.open::before { content: '✕'; }
#hamburgerBtn::before { content: '☰'; }

/* Filter panel */
#filterPanel {
    position: fixed;
    background: #fff;
    box-shadow: 2px 0 10px rgba(0,0,0,0.2);
    padding: 20px;
    z-index: 1050;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

#pagecontent {
    transition: margin-left 0.3s, width 0.3s; 
}

.attrlabels {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  overflow: hidden;
  gap: 2px;
}

.attrlabels span {
  flex-shrink: 1;
  min-width: 0;
  white-space: nowrap;
}

/* Desktop: slide from left */
@media (min-width: 769px) {
    #filterPanel {
        position: fixed;
        top: 0;
        left: 0;
        width: 310px;
        height: 100%;
        background: #fff;
		padding: 80px 20px 20px 20px;
        box-sizing: border-box;
        transform: translateX(-100%);
        transition: transform 0.3s;
        z-index: 990;
    }

    #filterPanel.active {
        transform: translateX(0);
    }

    #pagecontent.shifted {
        margin-left: 330px; /* filterpanel width + padding */
        transition: margin-left 0.3s;
    }

    #hamburgerBtn {
        position: fixed;
        top: 60px;
        left: 10px; 
        z-index: 1100;
        font-size: 28px;
        cursor: pointer;
        transition: left 0.3s;
    }

    #hamburgerBtn.shifted {
        left: 320px; /* filterpanel width + 10px (btn left) */
    }
}

/* Mobile: slide from bottom */
@media (max-width: 768px) {
    #filterPanel {
        position: fixed;
        bottom: -90%; 
        left: 0;
        width: 100%;
        height: 90%;
        background: #fff;
        padding: 20px;
        box-sizing: border-box;
        transition: bottom 0.3s;
        z-index: 1000;
        border-top-left-radius: 12px;
        border-top-right-radius: 12px;
        overflow-y: auto;
    }

    #filterPanel.active {
        bottom: 0; 
    }

    #pagecontent.shifted {
        opacity: 0.5;
        pointer-events: none;
    }

    #hamburgerBtn {
        position: fixed;
        top: 60px; 
        right: 20px;
        font-size: 36px;
        text-align: center;
        line-height: 0px;
        z-index: 1100;
    }

    #clothingContainer {
        display: flex;
        flex-direction: column; 
        gap: 5px;
    }

    .card {
        display: flex;
        flex-direction: row; 
        width: 100%; 
        border: 1px solid #ddd;
        border-radius: 6px;
        padding: 8px;
        box-sizing: border-box;
    }
  
    .card img {
        width: 100px;
        height: 100px;
        object-fit: cover;
        border-radius: 6px;
        margin-right: 12px;
    }
	
	.card img.rarstar {width:33px; height:33px; margin-right:-12px;}

    .card-content {
        display: flex;
        flex-direction: column; 
        justify-content: center;
        flex: 1;    
    overflow: hidden;
    }

    .card-content h3, .card-content p {
        margin: 2px 0;
    }
	
	  .attrlabels {
    font-size: 0.85em;
    transform: scale(0.8);
    transform-origin: left center;
  }
	  
	  .slotrarthing {
	  display: flex;
	  justify-content: space-between;
	  align-items: center;
	  min-width: 0; /* ✨ allows children to shrink correctly instead of clipping */
	}
	.raritything {
	  display: flex;
	  flex-wrap: nowrap;
	  overflow: visible; /* ensure stars can show fully */
	  min-width: 0; /* prevent clipping inside flex */
	}


}


span.itemstyle {display:inline-block; width:100px; height:28px; text-align:center; color:#fff; font-weight:bold; font-size:14pt; line-height: 25px;}
span.itemstyle.cool {background:url("images/bg_cool.png") no-repeat; background-size:contain;}
span.itemstyle.elegant {background:url("images/bg_elegant.png") no-repeat; background-size:contain;}
span.itemstyle.sweet {background:url("images/bg_sweet.png") no-repeat; background-size:contain;}
span.itemstyle.fresh {background:url("images/bg_fresh.png") no-repeat; background-size:contain;}
span.itemstyle.sexy {background:url("images/bg_sexy.png") no-repeat; background-size:contain;}

p.secondaryattr span.itemstyle {display:inline-block; width:72px; height:20px; text-align:center; color:#fff; font-weight:bold; font-size:11pt; line-height: 20px;}

span.itemtag {display:inline-block; width:84px; height:28px; text-align:center; font-weight:bold; font-size:11pt; line-height: 27px;}
span.itemtag.formal, span.itemtag.light, span.itemtag.morelight, span.itemtag.linlang, span.itemtag.terra {color:#E9BE72; background:url("images/T_UI_common_img_label01.png") no-repeat; background-size:contain;}
span.itemtag.home, span.itemtag.fashion, span.itemtag.pastoral, span.itemtag.glow {color:#A9CC88; background:url("images/T_UI_common_img_label02.png") no-repeat; background-size:contain;}
span.itemtag.royal, span.itemtag.adventure, span.itemtag.simple, span.itemtag.classical {color:#F9957E; background:url("images/T_UI_common_img_label03.png") no-repeat; background-size:contain;}
span.itemtag.summer, span.itemtag.romance, span.itemtag.cute, span.itemtag.whimsy {color:#F996A4; background:url("images/T_UI_common_img_label04.png") no-repeat; background-size:contain;}
span.itemtag.warm, span.itemtag.spirited {color:#79ABBE; background:url("images/T_UI_common_img_label05.png") no-repeat; background-size:contain;}
span.itemtag.intellectual, span.itemtag.retro, span.itemtag.trendy, span.itemtag.ballroom, span.itemtag.divine {color:#F5A96D; background:url("images/T_UI_common_img_label06.png") no-repeat; background-size:contain;}
span.itemtag.fairy, span.itemtag.fantasy, span.itemtag.forest {color:#93D2B8; background:url("images/T_UI_common_img_label07.png") no-repeat; background-size:contain;}
span.itemtag.uniform, span.itemtag.playful, span.itemtag.aesthetic {color:#88A4EF; background:url("images/T_UI_common_img_label09.png") no-repeat;  background-size:contain;}

#labelsContainer span.itemtag {
filter: grayscale(70%);}
#labelsContainer span.itemtag.active {
    box-shadow: 0 -3px 0px rgba(255,215,0,0.7);
    border-radius:20px;
filter: grayscale(0%);
}

img.rarstar {width:33px; margin-right:-12px;}

.labelslabellol {
  font-family: Tahoma;
  font-size: 13px;
  padding: 0px 0px 0px 5px;
  margin: 0px;
  border-bottom: 1px solid #ccc;
}
.langlabel {
  font-family: Tahoma;
  font-size: 13px;
  padding: 0px 0px 0px 5px;
  margin: 0px 0px 5px 0px;
  border-bottom: 1px solid #ccc;
}

#pagecontent {
	position: relative;
	min-height: 60vh; /* ensures enough vertical space to center overlays */
}

#loadingOverlay,
#noResultsMessage {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: auto;
    max-width: 90%;
    max-height: 80%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
	font-size: 1.5em;
	font-weight: 600;
	color: #444;
	transition: opacity 0.3s ease;
}


#loadingOverlay.show, #noResultsMessage.show {
	opacity: 1;
	pointer-events: auto;
}

#loadingOverlay::after {
	content: "";
	width: 32px;
	height: 32px;
	border: 3px solid #ccc;
	border-top-color: #666;
	border-radius: 50%;
	margin-left: 12px;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}

.cards.loading {
	opacity: 0.3;
	transition: opacity 0.3s ease;
}

/*
.card p.secondaryattr { padding-bottom:5px;
    border-bottom:1px solid #ccc;}
	*/
.card p.slotrarthing { padding-top:5px;
    border-top:1px solid #ccc;}


/* ===========================
   DARK MODE
=========================== */
body.dark-mode {
  background-color: #121212;
  color: #e0e0e0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-mode #filterPanel {
  background: #1e1e1e;
  color: #ddd;
  box-shadow: 2px 0 10px rgba(255,255,255,0.1);
}

body.dark-mode .card {
  background-color: #1e1e1e;
  border-color: #333;
}

body.dark-mode .card h3,
body.dark-mode .card p {
  color: #ddd;
}
/*
body.dark-mode .label-item {
  background: #333;
  color: #eee;
}

body.dark-mode .label-item.active {
  background: #007bff;
}
*/

body.dark-mode select,
body.dark-mode input,
body.dark-mode button {
  background-color: #2a2a2a;
  color: #fff;
  border-color: #444;
}

body.dark-mode select option.elegant,
body.dark-mode select option.sexy,
body.dark-mode select option.cool,
body.dark-mode select option.fresh,
body.dark-mode select option.sweet,
body.dark-mode select.active-selection {
  color: #000;        /* selected value color */
}

body.dark-mode #hamburgerBtn {
  background: #2a2a2a;
  color: #fff;
  border-color: #444;
}

body.dark-mode #loadingOverlay,
body.dark-mode #noResultsMessage {
  color: #fff;
}

body.dark-mode .pagination a, body.dark-mode .resonancelink a {
  color: #9ecbff;
}
body.dark-mode .pagination .active {
    color: white;
}

.card.dark-mode {
    background-color: #1e1e1e;
    color: #e0e0e0;
}
#filterPanel.dark-mode {
    background-color: #1a1a1a;
    color: #e0e0e0;
}
