/* FutureIQ Portal - Premium Dark Mode Design */

:root {
  /* Core Colors - Dark Theme */
  --bg-primary: #0f0f0f;
  --bg-secondary: #1f1f1f; /* Card background */
  --bg-tertiary: #2a2a2a; /* Hover states */
  --bg-overlay: rgba(0, 0, 0, 0.8);
  
  --text-primary: #f1f1f1;
  --text-secondary: #aaaaaa;
  --text-muted: #717171;
  
  --accent-color: #3ea6ff; /* YouTube-ish Blue for actions */
  --accent-hover: #65b8ff;
  --accent-danger: #ff4e45; /* Red for brand moments */
  
  --border-color: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(255, 255, 255, 0.2);
  
  /* Utilities */
  --radius-sm: 4px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  
  --header-height: 56px;
  --sidebar-width: 240px;
  
  /* Typography */
  --font-sans: "Roboto", "Arial", sans-serif;
  --font-mono: "Fira Code", monospace;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.5);
}

/* Reset & Base */
* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  margin: 0;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 500;
}

p {
  margin: 0;
}

/* Layout */
.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(15, 15, 15, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
}

.header-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-right: 2rem;
}

.brand {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.brand span {
  color: var(--text-primary);
}

.brand .highlight {
  color: var(--accent-color);
}

.tagline {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 0.5rem;
  padding-left: 0.5rem;
  border-left: 1px solid var(--border-color);
  display: none; /* Hide on small screens */
}

@media (min-width: 768px) {
    .tagline { display: block; }
}

/* Navigation */
.nav-links {
  display: flex;
  gap: 0.5rem;
}

.nav-item {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.nav-item:hover, .nav-item.active {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* Search Bar (Header) */
.search-container {
  flex: 1;
  max-width: 600px;
  margin: 0 2rem;
  position: relative;
}

.search-form {
  display: flex;
  align-items: center;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  background: #121212;
  border: 1px solid var(--border-color);
  border-right: none;
  border-radius: var(--radius-pill) 0 0 var(--radius-pill);
  padding: 0.6rem 1rem 0.6rem 1.2rem;
  color: var(--text-primary);
  font-size: 1rem;
  transition: border-color 0.2s;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.search-input:focus {
  outline: none;
  border-color: #1c62b9;
}

.search-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
  padding: 0.6rem 1.25rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background 0.2s;
}

.search-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* Main Content */
.main-shell {
  flex: 1;
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Grid Layout for Videos */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem 1rem;
}

/* Video Card */
.video-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform 0.2s;
}

.video-card:hover .thumbnail-img {
    transform: scale(1.03);
}

.thumbnail-wrapper {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-secondary);
  aspect-ratio: 16/9;
}

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

.duration-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 3px 6px;
  border-radius: 4px;
}

.card-content {
  display: flex;
  gap: 0.75rem;
}

.card-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-info {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.card-tags {
    margin-top: 0.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.tag {
    font-size: 0.7rem;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Pagination */
.pagination {
  margin-top: 3rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding-bottom: 2rem;
}

.page-btn {
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  transition: background 0.2s;
}

.page-btn:hover {
  background: var(--bg-tertiary);
}

.page-info {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Detail Page - Theater Mode */
.detail-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .detail-container {
        grid-template-columns: 2.5fr 1fr;
        align-items: start;
    }
}

.player-wrapper {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 1rem;
}

.player-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.video-header h1 {
    font-size: 1.4rem;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.video-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.description-panel {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 1rem;
    font-size: 0.95rem;
    white-space: pre-wrap;
    line-height: 1.6;
}

/* Transcript Column */
.transcript-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 100px);
    position: sticky;
    top: 70px;
    overflow: hidden;
}

.transcript-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(31, 31, 31, 0.95);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.transcript-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.transcript-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.transcript-content p {
    font-family: var(--font-sans); /* Easier to read on screen than serif */
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
}

.transcript-content p:hover {
    color: var(--text-primary);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #777;
}

/* Interactive Transcript */
.transcript-line {
    cursor: pointer;
    padding: 0.5rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
    border-left: 3px solid transparent;
}

.transcript-line:hover {
    background: var(--bg-tertiary);
    border-left-color: var(--accent-color);
}

.transcript-line time {
    display: inline-block;
    min-width: 45px;
    font-size: 0.75rem;
    color: var(--accent-color);
    font-family: var(--font-mono);
    margin-right: 0.5rem;
    user-select: none;
    opacity: 0.7;
}

.transcript-line:hover time {
    opacity: 1;
}

/* Search Snippets */
.snippet-card {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 0.6rem;
    border-radius: var(--radius-sm);
    line-height: 1.4;
    border-left: 2px solid var(--accent-color);
    
    /* Line Clamping */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
