/* Shared styles for build/auth/admin pages (uses the shared sidebar component). */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  line-height: 1.45;
  color: #333;
  display: flex;
  padding: 0;
  margin: 0;
}

/* Sidebar (matches existing pages) */
.sidebar {
  width: 260px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
  padding: 20px;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 1000;
}

.sidebar-header {
  padding-bottom: 20px;
  border-bottom: 2px solid #e0e0e0;
  margin-bottom: 20px;
}

.sidebar-logo {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 5px;
}

.sidebar-tagline {
  font-size: 12px;
  color: #999;
}

.nav-section {
  margin-bottom: 25px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.nav-item {
  display: block;
  padding: 10px 15px;
  margin-bottom: 5px;
  border-radius: 8px;
  text-decoration: none;
  color: #333;
  transition: all 0.2s ease;
  cursor: pointer;
}

.nav-item:hover {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  transform: translateX(4px);
}

.nav-item.active {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
}

.nav-item-text {
  font-size: 14px;
  font-weight: 500;
}

#sidebarLinksContainer {
  display: grid;
  grid-template-columns: repeat(var(--links-per-row, 1), 1fr);
  gap: 5px;
  justify-items: var(--links-align, center);
}

/* Language selector (shared sidebar) */
.language-selector {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background-color: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.language-selector:hover {
  border-color: #667eea;
}

.language-selector:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.language-selector option {
  padding: 8px;
}

.sidebar-footer {
  padding-top: 20px;
  border-top: 2px solid #e0e0e0;
  font-size: 11px;
  color: #999;
  text-align: center;
}

/* Main layout */
.main-content {
  margin-left: 260px;
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
  min-height: 100vh;
}

.container {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 980px;
  width: 100%;
  padding: 28px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.page-title {
  font-size: 28px;
  font-weight: 700;
  color: #333;
}

.page-subtitle {
  color: #666;
  font-size: 13px;
  margin-top: 4px;
}

.muted {
  color: #666;
  font-size: 13px;
}

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.card {
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  padding: 14px;
  background: #fff;
}

label {
  font-size: 12px;
  color: #666;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 90px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #667eea;
}

.btn {
  background: #667eea;
  color: white;
  /* Match form control height (inputs have a 2px border). */
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn:hover {
  background: #5568d3;
}

.btn.secondary {
  background: #eaeaea;
  color: #333;
}

.btn.secondary:hover {
  background: #dcdcdc;
}

.btn.danger {
  background: #dc3545;
}

.btn.danger:hover {
  background: #b92a37;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f2f2f2;
  font-size: 12px;
  color: #444;
}

.tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(102, 126, 234, 0.12);
  color: #667eea;
  font-size: 12px;
  cursor: pointer;
  margin-right: 6px;
  margin-bottom: 6px;
}

.tag:hover {
  background: rgba(102, 126, 234, 0.18);
}

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.build-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  position: relative;
}

.build-item-header .list-item-title {
  flex: 1;
  min-width: 0;
  padding-right: 44px; /* reserve space for absolute-positioned like button */
}

.btn-compact {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 9px;
  line-height: 1.1;
  white-space: nowrap;
}

.build-like-btn {
  position: absolute;
  top: 0;
  right: 0;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
}

.build-like-btn.liked {
  background: rgba(220, 53, 69, 0.14);
  color: #b92a37;
  border-color: rgba(220, 53, 69, 0.25);
}

.list-item {
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}

.list-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.list-item-title {
  font-weight: 700;
  color: #333;
}

.list-item-meta {
  margin-top: 6px;
  color: #666;
  font-size: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.divider {
  height: 1px;
  background: #eee;
  margin: 12px 0;
}

.alert {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
}

.error {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.success {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

/* Build editor: tabbed + split layouts */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab-btn {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  background: #eaeaea;
  color: #333;
  transition: background 0.2s ease;
}

.tab-btn:hover {
  background: #dcdcdc;
}

.tab-btn.active {
  background: #667eea;
  color: #fff;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.available-list {
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  background: #fff;
  max-height: 540px;
  overflow-y: auto;
}

.select-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
}

.select-row:last-child {
  border-bottom: none;
}

.select-row:hover {
  background: rgba(102, 126, 234, 0.08);
}

.select-row-title {
  font-weight: 600;
  color: #333;
}

.select-row-meta {
  font-size: 12px;
  color: #666;
  white-space: nowrap;
}

.select-row-meta.wrap {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.input-active {
  border-color: #667eea !important;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

@media (max-width: 768px) {
  body {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    position: relative;
    border-radius: 0;
  }
  .main-content {
    margin-left: 0;
  }
  .container {
    padding: 18px;
  }
}

@media (max-width: 900px) {
  .split {
    grid-template-columns: 1fr;
  }
  .available-list {
    max-height: 420px;
  }
}
