/* RESET + GLOBAL */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  background: #f0f2f5;
  color: #333;
}

/* HEADER + FOOTER */
header {
  background: #3f3f3f;
  color: #fff;
  padding: 1rem;
  text-align: center;
}

header nav a {
  color: #fff;
  margin: 0 0.5rem;
  text-decoration: none;
}

header nav a:hover {
  text-decoration: underline;
}

footer {
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
  background: #eee;
  border-top: 1px solid #ccc;
}

/* FILTERS + SEARCH */
.filters {
  display: flex;
  gap: 1rem;
  background: #f7f7f7;
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.filters label {
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
}

.filters select,
#searchInput {
  padding: 0.4rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 14px;
}

#searchInput {
  padding: 6px 10px;
  margin-right: 10px;
}

/* GRID + CARDS */
.themes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
  align-items: start;
}

.theme-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  height: 100%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.theme-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 22px rgba(0,0,0,0.18);
}

.theme-card a {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

/* Image preview (dynamic height) */
.theme-card img {
  width: 100%;
  height: auto;             /* let images scale naturally */
  object-fit: contain;      /* no cropping */
  background: #fafafa;      /* subtle backdrop for smaller images */
  display: block;
  flex-shrink: 0;
  transition: transform 0.3s ease; /* smooth zoom effect */
}

/* Zoom-in on hover */
.theme-card:hover img {
  transform: scale(1.05);
}

/* Card content */
.card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
}

.card-top h3 {
  margin: 0 0 6px 0;
  font-size: 1.05rem;
  line-height: 1.2;
  color: #111;
}

.card-top .meta {
  margin: 0;
  color: #666;
  font-size: 0.9rem;
}

/* Badges section at bottom */
.card-bottom {
  margin-top: auto;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1;
  border-radius: 999px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  transition: box-shadow 0.2s ease;
}

.badge:hover {
  box-shadow: 0 0 8px rgba(0,0,0,0.25);
}

/* Badge colors */
.badge.model { background: #0078d7; }
.badge.platform { background: #444; }
.badge.resolution { background: #28a745; }
.badge.home-type { background: #8e44ad; } /* purple for home type */

/* THEME DETAIL PAGE */
.theme-details {
  max-width: 800px;
  margin: 2rem auto;
  padding: 1rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.theme-details h2 {
  margin-top: 2rem;
}

.screenshots {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;      /* ✅ center vertically */
  justify-content: center;  /* ✅ center horizontally */
}

.screenshots img {
  max-width: 300px;
  height: auto;
  border-radius: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  cursor: pointer;
  display: block;
}

.screenshots img:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Lightbox */
#lightbox {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(10px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  overflow: hidden;
}

#lightbox .content {
  position: relative;
  display: flex;
  align-items: center;
}

#lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  transition: transform 0.2s ease;
  transform-origin: center center;
}

#lightbox .arrow {
  font-size: 3rem;
  color: white;
  cursor: pointer;
  user-select: none;
  padding: 0 10px;
  transition: color 0.2s;
}
#lightbox .arrow:hover {
  color: #ccc;
}



.download-btn {
  display: inline-block;
  margin-top: 2rem;
  padding: 0.8rem 1.2rem;
  background: #0066cc;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.2s;
}

.download-btn:hover {
  background: #004a99;
}

.badge.type.preloaded {
  background-color: #2e8b57; /* green */
  color: #fff;
}

.badge.type.user-made {
  background-color: #800080; /* purple */
  color: #fff;
}

.badge.type.carrier {
  background-color: #1e90ff; /* blue */
  color: #fff;
}

.badge.flash {
  background-color: #dd7d0f; /* blue */
  color: #fff;
}
/* Custom model select */
.custom-select {
  position: relative;
  display: inline-block;
  width: 180px;
}

.select-btn {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.select-options {
  position: absolute;
  z-index: 20;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  max-height: 480px;
  overflow-y: auto;
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: none;
}

.select-options li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.select-options li:hover {
  background: #f0f0f0;
}

.select-options img {
  width: 28px;
  height: auto;
  flex-shrink: 0;
}

/* Model dropdown images */
.custom-select .select-options li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  cursor: pointer;
}

.custom-select .select-options li img {
  width: 80px;   /* bigger phones */
  height: auto;
  flex-shrink: 0;
}

.alt-flash-menus {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 20px;
}
.alt-flash-menu {
  flex: 1 1 250px;
  max-width: 300px;
  text-align: center;
}
.alt-flash-menu img {
  max-width: 100%;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  margin-bottom: 8px;
}

.header-top {
  display: flex;
  justify-content: space-between; /* left group + right counter */
  align-items: center;
  padding: 10px 20px;
}

.left-side {
  display: flex;
  align-items: center;
  gap: 20px; /* space between title and nav */
}

.left-side h1 {
  margin: 0;
}

.left-side nav a {
  margin-left: 10px;
  text-decoration: none;
  font-weight: 500;
  color: #fff;
}

.left-side nav a:hover {
  text-decoration: underline;
}

.theme-counter {
  font-size: 1.1em;
  font-weight: bold;
  color: #fff;
  background: #242424;
  border-radius: 10px;
  padding: 6px 12px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  transition: transform 0.3s ease;
  white-space: nowrap;
}
.theme-counter:hover {
  transform: scale(1.05);
}
