/*
 * MTube basic styles
 *
 * Colour palette based on the MTube logo: white background with a cool blue accent.
 */

:root {
  --primary: #1d4ed8;  /* Deep blue */
  --secondary: #60a5fa; /* Light blue */
  --accent: #ef4444;    /* Red accent used sparingly */
  --bg: #f9fafb;        /* Soft off‑white background */
  --card-bg: #ffffff;   /* Card backgrounds */
  --text: #1f2937;      /* Dark grey text */
  --text-light: #6b7280;/* Light grey text */
  --nav-height: 56px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  background-color: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Overlay for login */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.overlay.hidden {
  display: none;
}

.auth-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 24px;
  width: min(400px, 90%);
  box-shadow: 0 12px 24px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}
.auth-logo {
  width: 160px;
  height: auto;
  margin: 0 auto;
  display: block;
}
.auth-title {
  font-size: 1.4rem;
  text-align: center;
  color: var(--primary);
}
.auth-desc {
  font-size: 0.9rem;
  text-align: center;
  color: var(--text-light);
}
.auth-card label {
  font-size: 0.85rem;
  color: var(--text);
}
.auth-card input {
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 1rem;
}
.auth-card .primary-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 8px;
}
.auth-msg {
  font-size: 0.85rem;
  color: var(--accent);
  min-height: 1.2em;
  text-align: center;
}

/* Header */
.app-header {
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-img {
  height: 40px;
  width: auto;
}
.app-header h1 {
  font-size: 1.2rem;
  font-weight: bold;
}
.app-header h1 small {
  font-size: 0.7rem;
  display: block;
  opacity: 0.8;
}
.header-actions button {
  background: none;
  border: none;
  color: inherit;
  font-size: 1.2rem;
  margin-left: 12px;
  cursor: pointer;
}

/* Search bar */
.search-bar {
  background: var(--card-bg);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.search-bar input[type="search"] {
  flex: 1;
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 1rem;
  margin-right: 8px;
}
.search-bar button {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text);
}

/* Main area */
#app-main {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}
.hero {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.hero h2 {
  font-size: 1.4rem;
  color: var(--primary);
  margin-bottom: 4px;
}
.hero p {
  font-size: 0.95rem;
  color: var(--text-light);
}

.video-section {
  margin-bottom: 24px;
}
.video-section h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: var(--primary);
}
.video-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.video-card {
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}
.video-thumb {
  width: 100%;
  height: 90px;
  object-fit: cover;
}
.video-info {
  padding: 8px;
  flex: 1;
}
.video-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.video-meta {
  font-size: 0.75rem;
  color: var(--text-light);
}

/* Category list (chips) */
.category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.category-list button {
  background: var(--secondary);
  color: white;
  border: none;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
}

/* MTuber list placeholder */
.mtuber-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.mtuber-list .mtuber-card {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  text-align: center;
}
.mtuber-card img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 6px;
}

/* Bottom navigation */
.bottom-nav {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: space-around;
  box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
}
.bottom-nav .nav-item {
  background: none;
  border: none;
  color: white;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
  padding: 6px;
  cursor: pointer;
}
.bottom-nav .nav-item.active {
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
}

/* Utility classes */
.hidden { display: none !important; }