/* 
  Global Stylesheet for TrendingHub
  Aesthetics: Modern Media App, Dark Theme, Clean UI
*/

:root {
  --bg-color: #121212;
  --surface-color: #1e1e1e;
  --accent-color: #0A84FF; /* Premium Blue */
  --accent-hover: #0073e6;
  --text-primary: #ffffff;
  --text-secondary: #b3b3b3;
  --text-muted: #808080;
  --border-radius: 12px;
  --transition-speed: 0.3s;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: 'Inter', 'Roboto', 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

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

img, video {
  max-width: 100%;
  display: block;
}

/* Header */
.navbar {
  background-color: rgba(18, 18, 18, 0.95);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}
.logo span {
  color: var(--accent-color);
}

.nav-links {
  display: flex;
  gap: 20px;
}
.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition-speed);
}
.nav-links a:hover {
  color: var(--accent-color);
}
.nav-links a.active {
  color: var(--accent-color);
  font-weight: 600;
}

.telegram-btn {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color var(--transition-speed);
}

.telegram-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

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

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary);
}

/* Grid Layout */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

/* Video Card */
.video-card {
  background-color: var(--surface-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.thumbnail-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #000;
  overflow: hidden;
}

.thumbnail-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-speed);
}

/* Dark gradient overlay on thumbnail */
.thumbnail-wrapper::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  pointer-events: none;
}

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

/* Badge styling */
.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: var(--accent-color);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  z-index: 2;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.card-content {
  padding: 15px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.video-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 15px;
}

.watch-btn {
  margin-top: auto;
  background-color: rgba(10, 132, 255, 0.1);
  color: var(--accent-color);
  text-align: center;
  padding: 10px;
  border-radius: 6px;
  font-weight: 600;
  transition: all var(--transition-speed);
  border: 1px solid rgba(10, 132, 255, 0.2);
}

.watch-btn:hover {
  background-color: var(--accent-color);
  color: #fff;
}

/* Ad Spaces */
.ad-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 30px 0;
  padding: 10px;
  background-color: rgba(255,255,255,0.02);
  border-radius: var(--border-radius);
  min-height: 100px;
}

.ad-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 5px;
  letter-spacing: 1px;
}

.ad-slot {
  width: 100%;
  max-width: 728px;
  min-height: 90px;
  background-color: rgba(255,255,255,0.05); /* Placeholder */
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Sticky Bottom Ad */
.sticky-ad {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: var(--bg-color);
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 10px 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 -5px 15px rgba(0,0,0,0.5);
}

/* Video Player Page Specifics */
.player-container {
  max-width: 900px;
  margin: 0 auto 30px auto;
  background-color: #000;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.video-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #000;
}

.video-details {
  max-width: 900px;
  margin: 0 auto 40px auto;
}

.video-details-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.video-details-meta {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.video-description {
  color: var(--text-secondary);
  line-height: 1.6;
}

.next-video-container {
  max-width: 900px;
  margin: 0 auto 40px auto;
  display: flex;
  justify-content: center;
}

.next-video-btn {
  background-color: var(--accent-color);
  color: white;
  padding: 15px 40px;
  border-radius: 30px;
  font-size: 1.1rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: transform var(--transition-speed), background-color var(--transition-speed);
}

.next-video-btn:hover {
  background-color: var(--accent-hover);
  transform: scale(1.05);
}

/* Footer */
footer {
  text-align: center;
  padding: 40px 20px 100px 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 50px;
}

footer .footer-links {
  margin-top: 15px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
}

footer a {
  transition: color var(--transition-speed);
}

footer a:hover {
  color: var(--text-primary);
}

/* Loading Spinner */
.loader {
  display: flex;
  justify-content: center;
  margin: 30px 0;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255,255,255,0.1);
  border-left-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
  .nav-links {
    display: none; /* Simplify header for mobile, maybe add a hamburger later if needed */
  }

  .video-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .card-content {
    padding: 10px;
  }

  .video-title {
    font-size: 0.85rem;
    margin-bottom: 6px;
  }
  
  .video-meta {
    font-size: 0.75rem;
    margin-bottom: 10px;
  }
  
  .watch-btn {
    padding: 8px;
    font-size: 0.85rem;
  }
  
  .video-details-title {
    font-size: 1.4rem;
  }
}
