*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #1a1a1a;
  --bg-card: #151515;
  --bg-hover: #1e1e1e;
  --bg-nav: rgba(15, 15, 15, 0.85);
  --text: #f0f0f0;
  --text-muted: #888;
  --accent: #fff;
  --border: #222;
  --radius: 16px;
  --radius-sm: 12px;
  --transition: 0.2s ease;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  -webkit-user-select: none;
  user-select: none;
  cursor: default;
}

/* ── Navigation ── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  padding: 1rem;
  gap: 1rem;
  height: 4rem;
  -webkit-app-region: drag;
}

nav a, nav button, nav .nav-tabs { -webkit-app-region: no-drag; }

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.nav-logo-mark {
  width: 28px;
  height: 28px;
  background: var(--text);
  color: var(--bg);
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.nav-logo-text {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
}

.nav-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  padding: 3px;
  gap: 1rem;
}

.nav-tab {
  padding: 6px 20px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 500;
  width: 100%;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}


.nav-tab.active {
  background: #1a1a1a;
  color: #f0f0f0;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: flex-end;
}

.nav-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: grid;
  border: none;
  place-items: center;
  transition: var(--transition);
  text-decoration: none;
}

.nav-icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}

/* ── Theme Toggle ── */
.theme-tab {
  padding: 6px 20px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 500;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.theme-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  padding: 3px;
  gap: 1rem;
}


.theme-tab.active {
  background: #1a1a1a;
  color: #f0f0f0;
}

/* ── Main Content ── */
main {
  padding-top: 0px;
}

.section {
  padding: 32px 24px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
}

.section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Featured Hero ── */
.featured {
  position: relative;
  width: 100%;
  height: 80vh;
  overflow: hidden;
}

.featured img,
.featured canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.featured-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 32px;
}

.featured-badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  color: #ffffff;
  margin-bottom: 8px;
}

.featured-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 4px;
  color: #ffffff;
}

.featured-meta {
  font-size: 13px;
  color: #ffffff;
}

.featured-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.btn-primary {
  background: #ffffff;
  color: #000000;
  cursor: pointer;
}

.btn-primary:hover { opacity: 0.85; }

.btn-ghost {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
}

.btn-ghost:hover { background: rgba(255,255,255,0.18); }

/* ── Carousel ── */
.carousel {
  display: flex;
  gap: 12px;
  padding: 0 24px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.carousel::-webkit-scrollbar { display: none; }

.carousel-item {
  flex-shrink: 0;
  width: 140px;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
}

.carousel-item:hover,
.carousel-item.active {
  border-color: var(--text);
}

.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Section Carousel Cards ── */
.section-carousel {
  gap: 12px;
}

.carousel-card {
  flex-shrink: 0;
  width: 280px;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: var(--bg-card);
}

.carousel-card canvas {
  display: block;
  transition: transform 0.3s ease;
}

.carousel-card:hover canvas {
  transform: scale(1.05);
}

.carousel-card .wall-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition);
  display: flex;
  align-items: flex-end;
  padding: 14px;
}

.carousel-card:hover .wall-card-overlay { opacity: 1; }

/* ── Wallpaper Grid ── */
.wall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.wall-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  cursor: pointer;
  background: var(--bg-card);
}

.wall-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.wall-card:hover img {
  transform: scale(1.05);
}

.wall-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition);
  display: flex;
  align-items: flex-end;
  padding: 14px;
}

.wall-card:hover .wall-card-overlay { opacity: 1; }

.wall-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wall-card-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.wall-card-res {
  font-size: 11px;
  color: rgba(255,255,255,0.7);
}

/* ── Settings Page ── */
.settings-container {
  max-width: 560px;
  margin: 0 auto;
  padding: 32px 24px;
}

.settings-title {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 32px;
}

.settings-group {
  margin-bottom: 28px;
}

.settings-group-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.settings-row-label {
  font-size: 14px;
}

.settings-row-value {
  font-size: 13px;
  color: var(--text-muted);
}

/* Toggle switch */
.toggle {
  position: relative;
  width: 42px;
  height: 24px;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text);
  top: 3px;
  left: 3px;
  transition: var(--transition);
}

.toggle input:checked + .toggle-slider { background: #4caf50; }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* Select dropdown */
.settings-select {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 6px 16px;
  font-size: 13px;
  cursor: pointer;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Utility ── */
.nav-arrows {
  display: flex;
  gap: 6px;
}

.nav-arrow {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: var(--transition);
}

.nav-arrow:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  margin-bottom: 20px;
  transition: var(--transition);
}

.back-link:hover { color: var(--text); }

footer {
  text-align: center;
  padding: 24px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

footer a {
  color: var(--text);
  text-decoration: none;
}

footer a:hover { text-decoration: underline; }

/* ── Loading Overlay ── */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid var(--border);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

button.nav-tab {
  border: none;
  background: transparent;
  cursor: pointer;
}
