/* style.css */

/* Sidebar Logo */
.sidebar .logo {
  display: block;
  max-width: 80%;
  max-height: 60px;       /* reduced from 80px */
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0 auto 1rem;
}

/* Root variables */
:root {
  --bg: #121212;
  --fg: #e0e0e0;
  --card-bg: #1e1e1e;
  --border: #333;
  /* Accent gradient matching logo */
  --accent-start: #ff7e79;
  --accent-end:   #ff4a8e;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--fg);
}

.container {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: 200px;
  background: #1a1a1a;
  padding: 1rem;
  box-sizing: border-box;
  overflow-y: auto;
}

.main {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  box-sizing: border-box;
}

/* Tabs */
.nav-tabs {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: flex;
  flex-direction: column;
}
.nav-tabs li {
  padding: 0.5rem;
  text-align: center;
  cursor: pointer;
  color: var(--fg);
  border-radius: 4px;
  transition: background 0.2s;
}
.nav-tabs li.active {
  background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  color: var(--bg);
}
.nav-tabs li:hover {
  background: #2a2a2a;
}

/* Sections */
.section {
  display: block;
}
.hidden  {
  display: none;
}

/* Filters */
.filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}
.search,
select {
  background: #1a1a1a;
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.5rem;
  min-width: 150px;
}

/* Gallery grid and cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.7);
}
.card img {
  width: 100%;
  height: auto;
  object-fit: contain;
  background-color: var(--card-bg);
}
.card .info {
  padding: 0.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.card .psna {
  font-family: monospace;
  font-size: 0.7rem;
  color: var(--accent-start);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card .title {
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.2;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.card .system,
.card .region {
  font-size: 0.8rem;
  color: #bbb;
  margin: 0;
}

/* Actions buttons */
.actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  padding: 0.5rem;
  margin-top: auto; /* push to bottom */
}
.copy-btn,
.buy-btn {
  background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  color: var(--bg);
  border: none;
  border-radius: 4px;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.75rem;
  transition: background 0.2s;
}
.copy-btn:hover,
.buy-btn:hover {
  background: #9a6cdf;
}

/* Toast notification */
#toast {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  color: var(--bg);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 10000;
}
#toast.show {
  opacity: 1;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}
.pagination button {
  background: var(--card-bg);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: background 0.2s;
}
.pagination button:disabled {
  opacity: 0.5;
  cursor: default;
}
.pagination button:hover:not(:disabled) {
  background: #333;
}

/* Responsive layout */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    padding: 0.5rem;
  }
  .sidebar .logo {
    max-height: 50px;
    margin-bottom: 0.5rem;
  }
  .main {
    padding: 0.5rem;
  }
  .nav-tabs {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    margin-bottom: 0.5rem;
  }
  .nav-tabs li {
    flex: 1;
    text-align: center;
    padding: 0.3rem 0.5rem;
    font-size: 0.9rem;
  }
  .filters {
    flex-direction: column;
    gap: 0.5rem;
  }
  .search,
  select {
    width: 100%;
  }
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}

@media (max-width: 480px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
  .card .info {
    padding: 0.25rem;
    gap: 0.15rem;
  }
  .copy-btn,
  .buy-btn {
    padding: 0.2rem 0.4rem;
    font-size: 0.65rem;
  }
  .card .psna {
    font-size: 0.6rem;
  }
  .card .title {
    font-size: 0.8rem;
  }
}
