/* Main CSS file for Top5Movies.com - Optimized for performance */
:root {
  --primary-color: #032541;
  --secondary-color: #01b4e4;
  --accent-color: #f5c518;
  --text-color: #333;
  --light-bg: #f8f9fa;
  --dark-bg: #212529;
  --white: #ffffff;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --transition: all 0.3s ease;
  --shadow-sm: 0 2px 5px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 8px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 20px rgba(0,0,0,0.15);
  --radius: 8px;
}

/* Reset */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Base Styles */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  color: var(--text-color);
  line-height: 1.6;
  background-color: var(--white);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: var(--primary-color);
  transition: var(--transition);
}

ul {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  margin-bottom: 1rem;
  line-height: 1.2;
}

p {
  margin-bottom: 1rem;
}

/* Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

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

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.py-1 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2 { padding-top: 1rem; padding-bottom: 1rem; }
.py-3 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-4 { padding-top: 2rem; padding-bottom: 2rem; }
.py-5 { padding-top: 3rem; padding-bottom: 3rem; }

.px-1 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-2 { padding-left: 1rem; padding-right: 1rem; }
.px-3 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-4 { padding-left: 2rem; padding-right: 2rem; }
.px-5 { padding-left: 3rem; padding-right: 3rem; }

.btn {
  display: inline-block;
  padding: 0.8rem 1.8rem;
  border-radius: 4px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

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

.btn-primary:hover {
  background-color: #021d31;
}

.btn-secondary {
  background-color: var(--accent-color);
  color: var(--dark-bg);
}

.btn-secondary:hover {
  background-color: #e0b315;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

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

/* Header & Navigation */
header {
  background-color: var(--primary-color);
  color: var(--white);
  padding: 1rem 0;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
}

.logo span {
  color: var(--accent-color);
}

.nav-menu {
  display: flex;
  align-items: center;
}

.nav-menu li {
  margin-left: 1.5rem;
}

.nav-menu a {
  color: var(--white);
  font-weight: 500;
}

.nav-menu a:hover {
  color: var(--accent-color);
}

.hamburger {
  display: none;
  cursor: pointer;
}

/* Hero Section */
.hero {
  background: linear-gradient(rgba(3, 37, 65, 0.8), rgba(3, 37, 65, 0.8)), 
              url('/images/hero-bg.jpg') center/cover no-repeat;
  color: var(--white);
  padding: 5rem 0;
  text-align: center;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.2rem;
  max-width: 800px;
  margin: 0 auto 2rem;
}

.hero-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Section Styling */
.section {
  padding: 4rem 0;
}

.section-heading {
  text-align: center;
  margin-bottom: 3rem;
}

.section-heading h2 {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.section-heading p {
  max-width: 700px;
  margin: 0 auto;
  color: #666;
}

.section-light {
  background-color: var(--light-bg);
}

.section-dark {
  background-color: var(--primary-color);
  color: var(--white);
}

/* Genre Tabs */
.genre-tabs {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.tab-btn {
  background: none;
  border: none;
  padding: 0.8rem 1.5rem;
  margin: 0.5rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-color);
  border-radius: 30px;
  transition: var(--transition);
  text-decoration: none;
  display: inline-block;
}

.tab-btn.active {
  background-color: var(--primary-color);
  color: var(--white);
}

.tab-btn:hover:not(.active) {
  background-color: var(--light-bg);
}

/* Movie Card Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 2rem;
}

.movie-card {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  background-color: var(--white);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.movie-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.movie-poster {
  position: relative;
  aspect-ratio: 2/3;
  overflow: hidden;
}

.movie-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.movie-card:hover .movie-poster img {
  transform: scale(1.05);
}

.movie-info {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.movie-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.movie-meta {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: #666;
}

.rating {
  display: flex;
  align-items: center;
  margin-right: 1rem;
  color: var(--accent-color);
  font-weight: 600;
}

.rating::before {
  content: "★";
  margin-right: 0.2rem;
}

.movie-desc {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.movie-link {
  margin-top: auto;
  text-align: right;
  font-weight: 600;
  color: var(--secondary-color);
}

.movie-link:hover {
  color: var(--primary-color);
}

/* Features Section */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.feature-card {
  text-align: center;
  padding: 2rem;
  border-radius: var(--radius);
  background-color: var(--light-bg);
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-5px);
}

.feature-icon {
  font-size: 2.5rem;
  color: var(--secondary-color);
  margin-bottom: 1rem;
}

.feature-title {
  font-size: 1.4rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

/* Testimonials */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.testimonial-card {
  padding: 2rem;
  border-radius: var(--radius);
  background-color: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.testimonial-text {
  font-style: italic;
  margin-bottom: 1rem;
}

.testimonial-author {
  font-weight: 600;
}

/* CTA Section */
.cta-section {
  background-color: var(--light-bg);
  padding: 4rem 0;
  text-align: center;
}

.cta-box {
  max-width: 800px;
  margin: 0 auto;
  padding: 2.5rem;
  background-color: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.cta-box h3 {
  font-size: 1.8rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.cta-box p {
  margin-bottom: 1.5rem;
}

.cta-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Footer */
footer {
  background-color: var(--dark-bg);
  color: #adb5bd;
  padding: 3rem 0 1rem;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-column {
  flex: 1;
  min-width: 200px;
}

.footer-column h4 {
  color: var(--white);
  margin-bottom: 1.2rem;
  font-size: 1.2rem;
}

.footer-column ul li {
  margin-bottom: 0.8rem;
}

.footer-column a {
  color: #adb5bd;
  text-decoration: none;
  transition: var(--transition);
}

.footer-column a:hover {
  color: var(--accent-color);
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-links a {
  color: var(--white);
  font-size: 1.2rem;
}

.footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* Article/Blog styles */
.article {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 0;
}

.article-header {
  margin-bottom: 2rem;
}

.article-title {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.article-meta {
  color: #666;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.article-image {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2rem;
}

.article-content {
  line-height: 1.8;
}

.article-content p,
.article-content ul,
.article-content ol {
  margin-bottom: 1.5rem;
}

.article-content h2,
.article-content h3 {
  color: var(--primary-color);
  margin: 2rem 0 1rem;
}

.article-content ul {
  list-style: disc;
  padding-left: 1.5rem;
}

.article-content ol {
  list-style: decimal;
  padding-left: 1.5rem;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 2rem 0;
}

.tag {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  background-color: var(--light-bg);
  border-radius: 30px;
  font-size: 0.85rem;
  color: var(--text-color);
}

/* Movie Detail Page */
.movie-detail {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

.movie-poster-large {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.movie-info-large h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.movie-meta-large {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

.meta-item {
  display: flex;
  align-items: center;
}

.meta-item i {
  margin-right: 0.5rem;
  color: var(--secondary-color);
}

.movie-rating {
  display: inline-block;
  padding: 0.5rem 1rem;
  background-color: var(--accent-color);
  color: var(--dark-bg);
  font-weight: 700;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.movie-synopsis {
  margin-bottom: 2rem;
  line-height: 1.8;
}

.cast-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.cast-item {
  text-align: center;
}

.cast-photo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 0.8rem;
}

.cast-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cast-name {
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.cast-character {
  font-size: 0.9rem;
  color: #666;
}

/* Search Form */
.search-form {
  max-width: 600px;
  margin: 0 auto 2rem;
}

.search-input {
  width: 100%;
  padding: 1rem;
  border: 2px solid var(--light-bg);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--secondary-color);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  margin-top: 3rem;
}

.pagination-item {
  margin: 0 0.3rem;
}

.pagination-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--light-bg);
  color: var(--text-color);
}

.pagination-link:hover,
.pagination-link.active {
  background-color: var(--primary-color);
  color: var(--white);
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
}

.breadcrumb-item:not(:last-child)::after {
  content: "›";
  margin: 0 0.5rem;
  color: #666;
}

.breadcrumb-link {
  color: #666;
}

.breadcrumb-item:last-child .breadcrumb-link {
  color: var(--primary-color);
  font-weight: 600;
}

/* Related Movies */
.related-movies {
  margin-top: 3rem;
}

.related-movies h3 {
  margin-bottom: 1.5rem;
  color: var(--primary-color);
  font-size: 1.8rem;
}

/* Where to Watch */
.watch-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

.platform {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  background-color: var(--light-bg);
  border-radius: var(--radius);
  font-weight: 500;
}

.platform img {
  height: 24px;
  margin-right: 0.5rem;
}

/* Schema.org article */
.schema-article {
  display: none;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .container {
    padding: 0 2rem;
  }
}

@media (max-width: 992px) {
  .movie-detail {
    grid-template-columns: 1fr;
  }
  
  .movie-poster-large {
    max-width: 350px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.2rem;
  }
  
  .section-heading h2 {
    font-size: 2rem;
  }
  
  .nav-menu {
    position: fixed;
    left: -100%;
    top: 70px;
    flex-direction: column;
    background-color: var(--primary-color);
    width: 100%;
    text-align: center;
    transition: 0.3s;
    box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
    padding: 2rem 0;
  }

  .nav-menu.active {
    left: 0;
  }

  .nav-menu li {
    margin: 1.5rem 0;
  }

  .hamburger {
    display: block;
  }
  
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

@media (max-width: 576px) {
  .hero h1 {
    font-size: 1.8rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  .section-heading h2 {
    font-size: 1.7rem;
  }
  
  .grid {
    grid-template-columns: 1fr;
    max-width: 350px;
    margin: 0 auto;
  }
  
  .cta-box {
    padding: 1.5rem;
  }
}

/* Animation Keyframes */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Print Styles */
@media print {
  header, footer, .cta-section, .related-movies {
    display: none;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
  }
  
  a {
    color: #000;
    text-decoration: underline;
  }
  
  .container {
    max-width: 100%;
  }
}