/*
Theme Name: FlexMoviez
Theme URI: https://example.com
Author: Your Name
Author URI: https://example.com
Description: قالب حرفه‌ای وردپرس برای سایت فیلم و سریال با پشتیبانی کامل از Custom Post Types
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: flexmoviez
Tags: rtl-language, movies, series, entertainment
*/

/* === Reset & Base Styles === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #d4a849;
  --primary-hover: #bf953f;
  --secondary-color: #1a2332;
  --background-dark: #141b28;
  --card-bg: #1e2736;
  --text-primary: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: rgba(255, 255, 255, 0.1);
  --transition: all 0.3s ease;
}

body {
  font-family: 'IRANSans', 'Tahoma', Arial, sans-serif;
  background-color: var(--background-dark);
  color: var(--text-primary);
  direction: rtl;
  text-align: right;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

/* === Container === */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* === Header & Navigation === */
.site-header {
  background: linear-gradient(to bottom, rgba(10, 10, 10, 0.95), transparent);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 15px 0;
  transition: var(--transition);
}

.site-header.scrolled {
  background: var(--secondary-color);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

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

.site-logo {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.main-nav ul {
  display: flex;
  gap: 30px;
  list-style: none;
}

.main-nav a {
  font-size: 15px;
  font-weight: 500;
  padding: 8px 0;
  position: relative;
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: var(--transition);
}

.main-nav a:hover::after,
.main-nav a.current-menu-item::after {
  width: 100%;
}

/* === Header Search === */
.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.header-search {
  position: relative;
  display: none;
}

@media (min-width: 768px) {
  .header-search {
    display: block;
  }
  
  .search-toggle {
    display: none;
  }
}

.header-search form {
  position: relative;
}

.header-search input {
  width: 250px;
  padding: 8px 40px 8px 15px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  border-radius: 50px;
  color: white;
  font-size: 14px;
  transition: var(--transition);
}

.header-search input:focus {
  outline: none;
  border-color: rgba(212, 168, 73, 0.5);
  background: rgba(255, 255, 255, 0.1);
}

.header-search svg {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  transition: color 0.3s ease;
}

.search-toggle:hover {
  color: var(--primary-color);
}

/* === Hero Section === */
.hero-section {
  position: relative;
  height: 70vh;
  min-height: 500px;
  margin-top: 60px;
  overflow: hidden;
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--background-dark) 0%, transparent 60%);
}

.hero-content {
  position: relative;
  z-index: 10;
  height: 100%;
  display: flex;
  align-items: flex-end;
  padding-bottom: 80px;
}

.hero-info {
  max-width: 600px;
}

.hero-title {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 15px;
  text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.8);
}

.hero-meta {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  font-size: 13px;
  align-items: center;
}

.hero-badge-special {
  background: var(--primary-color);
  color: var(--background-dark);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hero-rating {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #fbbf24;
  font-weight: 600;
}

.hero-rating svg {
  fill: #fbbf24;
}

.hero-description {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-muted);
  margin-bottom: 25px;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

.hero-buttons {
  display: flex;
  gap: 15px;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 30px;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(212, 168, 73, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* === Movie Grid === */
.movies-section {
  padding: 40px 0;
  position: relative;
  z-index: 10;
  margin-top: -100px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
}

.section-title {
  font-size: 28px;
  font-weight: 700;
  padding-right: 15px;
  border-right: 4px solid var(--primary-color);
}

.view-all-link {
  font-size: 14px;
  color: var(--primary-color);
}

.view-all-link:hover {
  text-decoration: underline;
}

.movies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 25px;
  margin-bottom: 60px;
}

@media (max-width: 768px) {
  .movies-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
  }
}

/* === Movie Card === */
.movie-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  transition: var(--transition);
  background: var(--card-bg);
  cursor: pointer;
}

.movie-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 30px rgba(212, 168, 73, 0.15);
}

.movie-poster-wrap {
  position: relative;
  padding-bottom: 150%;
  overflow: hidden;
  background: var(--secondary-color);
  border-radius: 12px;
}

.movie-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

.movie-gradient-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--background-dark), transparent 60%);
  opacity: 0.6;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.movie-card:hover .movie-gradient-overlay {
  opacity: 0.8;
}

.movie-quality-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(212, 168, 73, 0.9);
  color: var(--background-dark);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  z-index: 2;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.movie-rating-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  color: #fbbf24;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 3px;
  z-index: 2;
}

.movie-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.movie-card:hover .movie-play-overlay {
  opacity: 1;
}

.play-button {
  width: 48px;
  height: 48px;
  background: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 16px rgba(212, 168, 73, 0.3);
  transform: scale(0.5);
  transition: transform 0.3s ease;
  color: var(--background-dark);
}

.movie-card:hover .play-button {
  transform: scale(1);
}

.play-button svg {
  margin-left: 2px;
}

.movie-info {
  padding: 12px 0 0;
}

.movie-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.3s ease;
}

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

.movie-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

.movie-duration {
  border: 1px solid var(--border-color);
  padding: 2px 6px;
  border-radius: 4px;
}

/* === Single Movie Page === */
.single-movie-header {
  position: relative;
  height: 60vh;
  min-height: 400px;
  margin-top: 60px;
}

.single-movie-content {
  position: relative;
  z-index: 10;
  margin-top: -150px;
  padding-bottom: 60px;
}

.movie-detail-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

@media (max-width: 768px) {
  .movie-detail-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.movie-poster-large {
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  border: 4px solid var(--card-bg);
}

.movie-details-info {
  padding-top: 100px;
}

.movie-title-large {
  font-size: 40px;
  font-weight: 700;
  margin-bottom: 10px;
}

.movie-original-title {
  font-size: 22px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.movie-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 30px;
}

.meta-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 15px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-size: 14px;
}

.meta-badge svg {
  width: 16px;
  height: 16px;
  color: var(--primary-color);
}

.movie-synopsis,
.movie-crew {
  margin-bottom: 30px;
}

.movie-synopsis h3,
.movie-crew h3 {
  font-size: 20px;
  color: var(--primary-color);
  margin-bottom: 15px;
}

.movie-synopsis p {
  line-height: 1.8;
  color: var(--text-muted);
}

.crew-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.crew-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.crew-label {
  font-size: 13px;
  color: var(--text-muted);
}

.crew-value {
  font-size: 15px;
  font-weight: 500;
}

/* === Download Section === */
.download-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 15px;
  padding: 30px;
  margin-bottom: 40px;
}

.download-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 15px;
}

.download-item {
  background: var(--background-dark);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 20px;
  transition: var(--transition);
}

.download-item:hover {
  border-color: var(--primary-color);
}

.download-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}

.download-quality {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-color);
}

.download-size {
  font-size: 12px;
  color: var(--text-muted);
}

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

.download-encoder {
  font-size: 11px;
  background: var(--card-bg);
  padding: 4px 10px;
  border-radius: 5px;
  color: var(--text-muted);
}

.btn-download {
  font-size: 13px;
  padding: 8px 20px;
}

/* === Footer === */
.site-footer {
  background: rgba(255, 255, 255, 0.03);
  border-top: 1px solid var(--border-color);
  padding: 40px 0;
  margin-top: 60px;
  text-align: center;
}

.footer-content {
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 15px;
  font-size: 14px;
}

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

/* === Taxonomies === */
.genre-tag,
.cast-tag {
  display: inline-block;
  background: rgba(255, 255, 255, 0.05);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 13px;
  margin: 3px;
  transition: var(--transition);
}

.genre-tag:hover,
.cast-tag:hover {
  background: var(--primary-color);
  color: white;
}

/* === Responsive === */
@media (max-width: 768px) {
  .hero-title {
    font-size: 32px;
  }
  
  .movie-title-large {
    font-size: 28px;
  }
  
  .section-title {
    font-size: 22px;
  }
  
  .main-nav {
    display: none;
  }
}

/* === Animations === */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.movie-card {
  animation: fadeIn 0.5s ease forwards;
}

/* === Loading === */
.loading {
  text-align: center;
  padding: 60px 0;
  color: var(--text-muted);
}

.loading::after {
  content: '...';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}

/* === Pagination === */
.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 40px 0;
}

.pagination a,
.pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-weight: 600;
  transition: var(--transition);
}

.pagination a:hover,
.pagination .current {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

/* === Search === */
.search-form {
  display: flex;
  gap: 10px;
  max-width: 500px;
  margin: 20px auto;
}

.search-input {
  flex: 1;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: white;
  font-size: 15px;
}

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

.search-button {
  padding: 12px 25px;
}

/* === Sidebar === */
.sidebar {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 15px;
  padding: 25px;
}

.widget {
  margin-bottom: 30px;
}

.widget-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary-color);
}

.widget ul {
  list-style: none;
}

.widget li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
}

.widget li:last-child {
  border-bottom: none;
}

/* === Archive === */
.archive-header {
  text-align: center;
  padding: 60px 0 40px;
}

.archive-title {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 15px;
}

.archive-description {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}
