:root {
  --bg: #0b0f1a;
  --card: rgba(255,255,255,0.08);
  --text: white;
  --accent: #00e5ff;
  --gold: gold;
  --red: red;
}

body.light {
  --bg: #f5f5f5;
  --card: white;
  --text: black;
  --accent: #007bff;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: Arial, sans-serif;
  margin: 0;
}

header {
  padding: 12px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(12px);
}

h1 {
  text-align: center;
  margin: 5px 0 10px;
}

.top-bar {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

select, input, button {
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
}

button {
  background: var(--accent);
  color: black;
  cursor: pointer;
  font-weight: bold;
}

/* GRID */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px,1fr));
  gap: 15px;
  padding: 15px;
}

/* CARD */
.card {
  background: var(--card);
  padding: 10px;
  border-radius: 12px;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 12px rgba(0,229,255,0.25);
  transition: 0.25s;
  position: relative;
  cursor: pointer;
}

.card:hover {
  transform: scale(1.04);
}

.card img {
  width: 100%;
  border-radius: 10px;
}

.card h4 {
  margin: 6px 0 2px;
}

.star {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 20px;
  cursor: pointer;
  color: var(--gold);
}

.star.active {
  color: var(--red);
}

/* MODAL */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(6px);
  z-index: 999;
}

.modal-content {
  background: var(--card);
  width: 95%;
  max-width: 500px;
  max-height: 90vh;
  margin: auto;
  margin-top: 4%;
  padding: 12px;
  border-radius: 14px;
  box-shadow: 0 0 25px rgba(0,229,255,0.3);
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

/* Modal image */
.modal-content img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 10px;
}

/* Textarea */
textarea {
  width: 100%;
  min-height: 100px;
  background: black;
  color: white;
  padding: 10px;
  border-radius: 8px;
  font-size: 14px;
}

/* Close */
#closeModal {
  float: right;
  cursor: pointer;
  font-size: 20px;
}

/* Buttons always visible */
.modal-buttons {
  display: flex;
  gap: 10px;
  position: sticky;
  bottom: 0;
  background: var(--card);
  padding-top: 8px;
}

/* Favorites Page */
.favorites-page {
  position: fixed;
  inset: 0;
  background: var(--bg);
  padding: 20px;
  overflow: auto;
  z-index: 999;
}

.hidden {
  display: none;
}

/* MOBILE FULLSCREEN MODAL */
@media (max-width:600px){
  .modal-content{
    width: 100%;
    height: 100%;
    margin: 0;
    border-radius: 0;
  }
}