@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500&display=swap');

:root {
  --bg: #ffffff;
  --bg-subtle: #f9fafb;
  --bg-muted: #f3f4f6;
  --border: #e5e7eb;
  --border-hover: #d1d5db;
  --text: #111827;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --accent: #16a34a;
  --accent-hover: #15803d;
  --dark: #111827;
  --radius: 10px;
  --radius-card: 12px;
  --shadow-card: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.08);
}

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

body {
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  background-color: var(--bg-subtle);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

/* Shared Chrome */
.navbar {
  position: sticky;
  top: 0;
  background-color: var(--bg);
  border-bottom: 0.5px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 50;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 16px;
}

.logo-icon {
  width: 28px;
  height: 28px;
  background-color: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
}

.nav-search {
  flex: 1;
  max-width: 340px;
  position: relative;
  display: flex;
  align-items: center;
}

.nav-search i {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
}

.nav-search input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  background-color: var(--bg-subtle);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.nav-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.1);
  background-color: var(--bg);
}

.nav-auth {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: 0.5px solid transparent;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  background-color: var(--accent);
  color: white;
}
.btn-primary:hover { background-color: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-dark {
  background-color: var(--dark);
  color: white;
}
.btn-dark:hover { background-color: #000; }

.btn-secondary {
  background-color: var(--bg);
  border-color: var(--border);
  color: var(--text);
}
.btn-secondary:hover { background-color: var(--bg-subtle); border-color: var(--border-hover); }

.btn-danger {
  background-color: #dc2626;
  color: white;
}
.btn-danger:hover { background-color: #b91c1c; }

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  background-color: var(--bg);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  transition: all 0.2s;
  outline: none;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.1);
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Avatar & Dropdown */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #dcfce7;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  cursor: pointer;
}
.dropdown-wrap { position: relative; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  min-width: 150px;
  display: none;
  flex-direction: column;
  padding: 4px;
  z-index: 60;
}
.dropdown-menu.active { display: flex; }
.dropdown-item {
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: block;
}
.dropdown-item:hover { background-color: var(--bg-subtle); }

/* Toasts */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--dark);
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: var(--shadow-hover);
  animation: slideIn 0.3s ease forwards, fadeOut 0.3s ease 2.7s forwards;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeOut {
  to { opacity: 0; }
}

/* Homepage */
.hero {
  padding: 32px 20px 20px;
  border-bottom: 0.5px solid var(--border);
  background: var(--bg);
}
.hero h1 {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.hero-sub {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 440px;
  margin-bottom: 24px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.pill-group {
  display: inline-flex;
  background: var(--bg-muted);
  padding: 3px;
  border-radius: 8px;
}
.pill-btn {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: transparent;
  transition: all 0.2s;
}
.pill-btn.active {
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow-card);
}

.grid-walls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 0 20px 40px;
}

.wall-card {
  background: var(--bg);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
.wall-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.mosaic {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 2px;
  aspect-ratio: 16/10;
  background: var(--bg-muted);
}
.mosaic .tile {
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.wall-card-body {
  padding: 11px 13px;
}
.wall-card-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.wall-card-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Wall View */
.wall-header-view {
  padding: 32px 20px 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
}
.wall-title-view {
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 8px;
}
.wall-meta-view {
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 0 20px 40px;
}
.video-wrap {
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
}
.video-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Auth Cards */
.auth-wrap {
  display: flex;
  justify-content: center;
  padding: 40px 20px;
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-card);
  padding: 32px;
  box-shadow: var(--shadow-card);
}
.auth-card h1 {
  font-size: 22px;
  text-align: center;
  margin-bottom: 24px;
}

/* Create Flow */
.creator-card {
  width: 100%;
  max-width: 640px;
  margin: 40px auto;
  background: var(--bg);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-card);
  padding: 32px;
  box-shadow: var(--shadow-card);
}
.creator-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.creator-badge {
  background: #dcfce7;
  color: var(--accent);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  margin-top: 8px;
  flex-shrink: 0;
}
.validation-icon {
  margin-top: 10px;
  width: 20px;
  flex-shrink: 0;
}
.val-valid { color: var(--accent); }
.val-invalid { color: #dc2626; }

/* Admin */
.admin-table-wrap {
  padding: 20px;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.admin-table th, .admin-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 0.5px solid var(--border);
}
.admin-table th {
  background: var(--bg-subtle);
  font-weight: 500;
  color: var(--text-secondary);
}

@media (max-width: 900px) {
  .grid-walls, .video-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-walls, .video-grid { grid-template-columns: 1fr; }
  .navbar { flex-wrap: wrap; }
  .nav-search { order: 3; max-width: 100%; margin-top: 8px; }
}
