/* Base Styling */
:root {
  --primary: #8B5CF6;
  --primary-dark: #7E69AB;
  --secondary: #D6BCFA;
  --dark: #1A1F2C;
  --light: #F6F6F7;
  --gray: #8E9196;
  --gray-light: #eaeaea;
  --gray-dark: #4a4a4a;
  --success: #10B981;
  --error: #EF4444;
  --warning: #F59E0B;
  --radius: 0.5rem;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--dark);
  color: var(--light);
  line-height: 1.6;
}

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

ul {
  list-style: none;
}

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

button {
  cursor: pointer;
  font-family: inherit;
}

/* Header and Navigation */
header {
  background-color: rgba(26, 31, 44, 0.95);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 5%;
  max-width: 1400px;
  margin: 0 auto;
}

.logo a {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--light);
  display: flex;
  align-items: center;
  text-decoration: none;
}

.site-logo {
  height: 40px;
  margin-right: 10px;
}

.logo-text {
  color: var(--primary);
  font-weight: bold;
}

.nav-menu {
  display: flex;
}

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

.nav-menu a {
  color: var(--light);
  font-weight: 500;
  padding: 0.5rem 0;
  transition: color 0.3s;
  position: relative;
}

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

.nav-menu a.active::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary);
  border-radius: 1px;
}

.menu-toggle {
  display: none;
  font-size: 1.5rem;
  color: var(--light);
}

/* Main Content */
main {
  min-height: calc(100vh - 160px);
  padding: 2rem 5%;
  max-width: 1400px;
  margin: 0 auto;
}

/* Hero Section */
.hero-section {
  position: relative;
  height: 400px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.7), rgba(126, 105, 171, 0.7)), url('../images/hero-bg.jpg');
  background-size: cover;
  background-position: center;
  margin-bottom: 2rem;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero-content {
  padding: 2rem;
  max-width: 700px;
  background-color: rgba(26, 31, 44, 0.7);
  border-radius: var(--radius);
  backdrop-filter: blur(5px);
}

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

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

.hero-button {
  display: inline-block;
  background-color: var(--primary);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  transition: background-color 0.3s, transform 0.2s;
  border: none;
}

.hero-button:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
}

.section-title {
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
  color: var(--light);
  position: relative;
  padding-bottom: 0.5rem;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background-color: var(--primary);
}

/* Donghua Grid */
.donghua-list h2 {
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
  color: var(--light);
}

.donghua-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.donghua-card {
  position: relative;
  height: 250px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
}

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

.donghua-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.donghua-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(26, 31, 44, 0.95), transparent);
  padding: 1rem;
}

.donghua-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.donghua-meta {
  display: flex;
  font-size: 0.8rem;
  color: var(--gray);
}

.donghua-meta span:not(:last-child)::after {
  content: '•';
  margin: 0 0.4rem;
}

/* Donghua Detail Page */
.donghua-detail {
  margin-bottom: 2rem;
}

.donghua-backdrop {
  height: 200px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.donghua-backdrop::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent, var(--dark));
}

.donghua-info {
  display: flex;
  flex-direction: column;
  margin-top: -50px;
  position: relative;
  z-index: 2;
  padding: 0 1rem;
}

.donghua-poster {
  width: 130px;
  height: 190px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-bottom: 1rem;
  align-self: center;
}

.donghua-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.donghua-content {
  flex: 1;
}

.donghua-content h1 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.donghua-meta {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  color: var(--gray);
}

.donghua-meta span:not(:last-child)::after {
  content: '•';
  margin: 0 0.4rem;
}

.donghua-rating {
  display: inline-flex;
  align-items: center;
  margin-bottom: 1rem;
  background-color: rgba(139, 92, 246, 0.2);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
}

.donghua-rating i {
  color: var(--warning);
  margin-right: 0.25rem;
}

.donghua-synopsis h3 {
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.donghua-synopsis p {
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

/* Episode List */
.episode-section h2 {
  margin: 2rem 0 1rem;
  font-size: 1.5rem;
}

.episode-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.episode-item {
  display: flex;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s;
}

.episode-item:hover {
  transform: translateX(5px);
}

.episode-thumbnail {
  width: 120px;
  height: 70px;
  overflow: hidden;
  flex-shrink: 0;
}

.episode-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.episode-info {
  padding: 0.75rem;
  flex: 1;
}

.episode-number {
  font-size: 0.8rem;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.episode-title {
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.episode-vip {
  margin-left: auto;
  background-color: rgba(245, 158, 11, 0.2);
  color: var(--warning);
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  border-radius: 1rem;
  align-self: flex-start;
  margin: 0.75rem;
}

/* Video Player Page */
.video-player-section h1 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.video-container {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background-color: #000;
  margin-bottom: 1.5rem;
}

.video-player {
  position: relative;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
}

.video-player video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
}

.vip-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(26, 31, 44, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.vip-message {
  text-align: center;
  padding: 2rem;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: var(--radius);
  width: 80%;
  max-width: 400px;
}

.vip-message i {
  font-size: 2.5rem;
  color: var(--warning);
  margin-bottom: 1rem;
}

.vip-message h2 {
  margin-bottom: 0.5rem;
}

.vip-message p {
  margin-bottom: 1.5rem;
}

.vip-button {
  display: inline-block;
  background-color: var(--primary);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 500;
  transition: background-color 0.3s;
  border: none;
}

.vip-button:hover {
  background-color: var(--primary-dark);
}

/* Episode Navigation */
.episode-navigation {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.nav-button, .back-button {
  background-color: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--light);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  transition: background-color 0.3s;
  flex-basis: 40%;
}

.back-button {
  flex-basis: 20%;
  text-align: center;
}

.nav-button:hover, .back-button:hover {
  background-color: rgba(139, 92, 246, 0.2);
}

.nav-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.episode-info {
  margin-bottom: 2rem;
}

.episode-info h2 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.episode-meta {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  color: var(--gray);
  font-size: 0.9rem;
}

.episode-meta span:not(:last-child)::after {
  content: '•';
  margin: 0 0.4rem;
}

.episode-info p {
  line-height: 1.7;
}

/* More Episodes Grid */
.more-episodes h3 {
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.episode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .episode-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.episode-thumb {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s;
}

.episode-thumb:hover {
  transform: translateY(-3px);
}

.episode-thumb img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.episode-number-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  background-color: var(--dark);
  color: var(--light);
  padding: 0.2rem 0.4rem;
  font-size: 0.7rem;
  border-radius: 0.25rem;
}

.episode-vip-badge {
  position: absolute;
  bottom: 5px;
  left: 5px;
  background-color: rgba(245, 158, 11, 0.8);
  color: white;
  padding: 0.1rem 0.3rem;
  font-size: 0.7rem;
  border-radius: 0.25rem;
}

/* Authentication Pages */
.auth-section {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2rem 0;
}

.auth-container {
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 400px;
}

.auth-tabs {
  display: flex;
  margin-bottom: 2rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.auth-tab {
  flex: 1;
  background: none;
  border: none;
  padding: 0.75rem;
  color: var(--gray);
  font-weight: 500;
  transition: color 0.3s;
}

.auth-tab.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.auth-form h2 {
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  text-align: center;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.9rem;
}

.form-group input {
  width: 100%;
  padding: 0.75rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--light);
  font-family: inherit;
}

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

.auth-button {
  width: 100%;
  padding: 0.75rem;
  border-radius: var(--radius);
  background-color: var(--primary);
  color: white;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s;
}

.auth-button:hover {
  background-color: var(--primary-dark);
}

.error-message {
  background-color: rgba(239, 68, 68, 0.1);
  border-left: 4px solid var(--error);
  color: var(--error);
  padding: 0.75rem;
  margin-bottom: 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  display: none;
}

/* User Profile Page */
.user-profile {
  max-width: 800px;
  margin: 0 auto;
}

.login-prompt {
  text-align: center;
  padding: 3rem 1rem;
}

.login-prompt h2 {
  margin-bottom: 1rem;
}

.login-prompt p {
  margin-bottom: 2rem;
  color: var(--gray);
}

.profile-container {
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 2rem;
}

.profile-header {
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1.5rem;
}

.profile-avatar i {
  font-size: 2.5rem;
  color: var(--gray);
}

.profile-info h2 {
  margin-bottom: 0.25rem;
}

.user-role {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.8rem;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--gray);
}

.user-role.vip {
  background-color: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.user-role.admin {
  background-color: rgba(139, 92, 246, 0.2);
  color: var(--primary);
}

.profile-details {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.detail-card {
  background-color: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.detail-card h3 {
  margin-bottom: 1rem;
  font-size: 1.2rem;
  color: var(--light);
}

.detail-card ul {
  display: grid;
  gap: 0.75rem;
}

.detail-card li {
  display: flex;
  justify-content: space-between;
}

.detail-label {
  color: var(--gray);
}

.vip-card {
  background-color: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius);
  overflow: hidden;
}

.vip-banner {
  background: linear-gradient(to right, #f59e0b, #fbbf24);
  padding: 1.5rem;
  text-align: center;
}

.vip-banner i {
  font-size: 2.5rem;
  color: white;
  margin-bottom: 0.5rem;
}

.vip-banner h3 {
  color: white;
  font-size: 1.5rem;
}

.vip-features {
  padding: 1.5rem;
}

.vip-features p {
  margin-bottom: 1.5rem;
  text-align: center;
}

.vip-features ul {
  margin-bottom: 1.5rem;
}

.vip-features li {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
}

.vip-features li i {
  color: var(--success);
  margin-right: 0.5rem;
}

.vip-note {
  font-size: 0.8rem;
  color: var(--gray);
  margin-top: 1rem;
  text-align: center;
}

.vip-active .vip-banner {
  background: linear-gradient(to right, #8b5cf6, #a78bfa);
}

.vip-active-text {
  text-align: center;
  color: var(--primary);
  font-weight: 500;
}

.profile-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.profile-button {
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 500;
  border: none;
  transition: background-color 0.3s, color 0.3s;
}

.profile-button:first-child {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--light);
}

.profile-button:last-child {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

.profile-button:first-child:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.profile-button:last-child:hover {
  background-color: rgba(239, 68, 68, 0.2);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-content {
  background-color: var(--dark);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 500px;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.modal-content h2 {
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.modal-content p {
  margin-bottom: 1rem;
}

.close-modal {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray);
  transition: color 0.3s;
}

.close-modal:hover {
  color: var(--light);
}

.submit-button {
  background-color: var(--primary);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 500;
  border: none;
  transition: background-color 0.3s;
}

.submit-button:hover {
  background-color: var(--primary-dark);
}

/* Footer */
footer {
  background-color: rgba(26, 31, 44, 0.5);
  padding: 3rem 5% 1rem;
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.footer-logo h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

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

.footer-logo p {
  color: var(--gray);
}

.footer-links h3, .footer-social h3 {
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.footer-links ul {
  display: grid;
  gap: 0.75rem;
}

.footer-links a {
  color: var(--gray);
  transition: color 0.3s;
}

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

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

.social-icons a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray);
  transition: background-color 0.3s, color 0.3s;
}

.social-icons a:hover {
  background-color: var(--primary);
  color: white;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--gray);
  font-size: 0.9rem;
}

/* Responsive Styles */
@media (min-width: 640px) {
  .donghua-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .footer-content {
    grid-template-columns: 2fr 1fr 1fr;
  }
  
  .profile-details {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 768px) {
  .donghua-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .donghua-info {
    flex-direction: row;
    gap: 2rem;
  }
  
  .donghua-poster {
    width: 180px;
    height: 270px;
    margin-top: -70px;
    margin-bottom: 0;
    align-self: flex-start;
  }
}

@media (min-width: 1024px) {
  .donghua-grid {
    grid-template-columns: repeat(5, 1fr);
  }
  
  .hero {
    height: 400px;
  }
  
  .hero h1 {
    font-size: 3rem;
  }
  
  .hero p {
    font-size: 1.5rem;
  }
}

@media (max-width: 640px) {
  .nav-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    height: 100vh;
    background-color: var(--dark);
    flex-direction: column;
    justify-content: flex-start;
    padding: 2rem;
    transition: left 0.3s ease;
    z-index: 101;
  }
  
  .nav-menu.active {
    left: 0;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  }
  
  .nav-menu li {
    margin: 1.5rem 0;
  }
  
  .menu-toggle {
    display: block;
    z-index: 102;
  }
  
  .episode-navigation {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  
  .nav-button, .back-button {
    flex-basis: 100%;
  }
  
  .back-button {
    order: -1;
  }
}
