@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
  --primary: #E50914;
  --secondary: #B81D24;
  --dark-background: #141414;
  --darker-background: #0B0B0B;
  --light-text: #F5F5F1;
  --dark-text: #221F1F;
  --card-background: #181818;
  --card-hover: #232323;
}

/* Base styles */
body {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--dark-background);
  color: var(--light-text);
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5em;
  font-weight: 700;
  line-height: 1.2;
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

p {
  margin: 0 0 1rem;
  line-height: 1.5;
}

/* Header */
.site-header {
  background-color: rgba(20, 20, 20, 0.9);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.site-logo {
  color: var(--primary);
  font-size: 1.75rem;
  font-weight: 700;
  text-decoration: none;
  margin-right: 2rem;
}

.main-nav {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  color: var(--light-text);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
}

.search-form {
  display: flex;
  margin-left: auto;
  margin-right: 1rem;
}

.search-form input {
  background-color: #333;
  border: none;
  color: var(--light-text);
  padding: 0.5rem 1rem;
  border-radius: 4px 0 0 4px;
  width: 240px;
  font-size: 1rem;
}

.search-button {
  background-color: var(--primary);
  border: none;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Language Selector */
.language-selector {
  position: relative;
  cursor: pointer;
  margin-left: 1rem;
  padding: 0.5rem;
  background-color: #333;
  border-radius: 4px;
  min-width: 100px;
  text-align: center;
}

.language-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background-color: #333;
  min-width: 120px;
  border-radius: 4px;
  z-index: 101;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.language-dropdown.show {
  display: block;
}

.language-option {
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.language-option:hover, .language-option.active {
  background-color: #444;
}

/* Home Page */
.home-content {
  flex: 1;
}

.hero-banner {
  background-image: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('https://images.pexels.com/photos/7991579/pexels-photo-7991579.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260');
  background-size: cover;
  background-position: center;
  height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-bottom: 3rem;
}

.hero-content {
  max-width: 800px;
  padding: 0 1rem;
}

.hero-content h1 {
  font-size: 4rem;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-content p {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  border: none;
  display: inline-block;
  transition: background-color 0.2s;
}

.btn-primary:hover {
  background-color: var(--secondary);
}

.section-title {
  font-size: 1.75rem;
  margin: 2rem 0 1.5rem;
  padding-left: 1rem;
}

/* Carousel */
.carousel {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 1rem;
  gap: 1rem;
  scroll-snap-type: x mandatory;
}

.carousel::-webkit-scrollbar {
  display: none;
}

.carousel .media-card {
  flex: 0 0 300px;
  scroll-snap-align: start;
}

/* Media Grid */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  padding: 1rem;
}

/* Media Card */
.media-card {
  background-color: var(--card-background);
  border-radius: 4px;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
}

.media-card:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  z-index: 1;
}

.media-thumbnail {
  position: relative;
  height: 0;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  overflow: hidden;
}

.media-thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.media-card:hover .media-overlay {
  opacity: 1;
}

.watch-button {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s;
}

.watch-button:hover {
  background-color: var(--secondary);
}

.media-info {
  padding: 1rem;
}

.media-title {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-description {
  font-size: 0.9rem;
  color: #aaa;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.torrent-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #888;
}

/* Favorite button */
.favorite {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.favorite:hover, .favorite.active {
  background-color: rgba(229, 9, 20, 0.8);
}

/* Featured, Trending, and Recent sections */
.featured-section, .trending-section, .recent-section, .favorites-section {
  margin-bottom: 3rem;
}

/* Search Results */
.search-results-content {
  flex: 1;
  padding: 1rem;
}

.results-title {
  margin: 1rem 0 2rem;
  font-size: 2rem;
}

.results-section {
  margin-bottom: 3rem;
}

.no-results {
  text-align: center;
  padding: 3rem 0;
}

.loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 0;
}

.loading-spinner {
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top: 4px solid var(--primary);
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Watch Page */
.watch-content {
  flex: 1;
  padding: 1rem;
}

.player-container {
  background-color: var(--darker-background);
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.player-container video,
.player-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.media-details {
  max-width: 800px;
  margin: 0 auto;
}

.media-metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.metadata-item {
  background-color: var(--card-background);
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-size: 0.875rem;
}

.player-error {
  text-align: center;
}

/* About Page */
.about-content {
  flex: 1;
  padding: 1rem;
}

.about-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.about-info {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 2rem;
}

.about-text {
  flex: 1 1 600px;
}

.about-image {
  flex: 1 1 400px;
}

.about-image img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.about-text h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.about-text ul, .about-text ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.about-text li {
  margin-bottom: 0.5rem;
}

/* Legal Page */
.legal-content {
  flex: 1;
  padding: 1rem;
}

.legal-section {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.legal-text h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

.legal-text p, .legal-text ul, .legal-text ol {
  margin-bottom: 1.5rem;
}

.legal-text ul, .legal-text ol {
  padding-left: 1.5rem;
}

.legal-text li {
  margin-bottom: 0.5rem;
}

/* Footer */
.site-footer {
  background-color: var(--darker-background);
  padding: 2rem 1rem;
  margin-top: auto;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-section {
  flex: 1 1 200px;
}

.footer-section h3 {
  color: var(--primary);
  margin-bottom: 1rem;
}

.footer-section a {
  display: block;
  color: var(--light-text);
  margin-bottom: 0.5rem;
  text-decoration: none;
}

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

.footer-bottom {
  margin-top: 2rem;
  text-align: center;
  color: #777;
  font-size: 0.875rem;
}

/* Mining Consent Banner */
.miner-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(20, 20, 20, 0.95);
  padding: 1rem;
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

.consent-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.consent-buttons {
  display: flex;
  gap: 1rem;
}

.btn-accept {
  background-color: var(--primary);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  border: none;
}

.btn-decline {
  background-color: transparent;
  color: white;
  padding: 0.5rem 1rem;
  border: 1px solid white;
  border-radius: 4px;
  cursor: pointer;
}

/* Scroll to Top Button */
.scroll-top-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: background-color 0.2s;
}

.scroll-top-button:hover {
  background-color: var(--secondary);
}

/* Media Queries */
@media (max-width: 768px) {
  .site-header {
    padding: 0.75rem;
  }
  
  .site-logo {
    font-size: 1.5rem;
    margin-right: 1rem;
  }
  
  .main-nav {
    gap: 1rem;
  }
  
  .hero-content h1 {
    font-size: 2.5rem;
  }
  
  .hero-content p {
    font-size: 1.2rem;
  }
  
  .search-form {
    margin-top: 1rem;
    margin-left: 0;
    width: 100%;
  }
  
  .search-form input {
    width: 100%;
  }
  
  .language-selector {
    margin-top: 1rem;
  }
  
  .media-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  
  .carousel .media-card {
    flex: 0 0 250px;
  }
  
  .consent-content {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .carousel .media-card {
    flex: 0 0 200px;
  }
  
  .media-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
  
  .hero-banner {
    height: 400px;
  }
  
  .hero-content h1 {
    font-size: 2rem;
  }
  
  .hero-content p {
    font-size: 1rem;
  }
  
  .footer-content {
    flex-direction: column;
    gap: 1.5rem;
  }
}