/* Design System - Inspired by shadcn/ui */
:root {
  /* Colors */
  --background: 0 0% 100%;
  --foreground: 222.2 84% 4.9%;
  --card: 0 0% 100%;
  --card-foreground: 222.2 84% 4.9%;
  --popover: 0 0% 100%;
  --popover-foreground: 222.2 84% 4.9%;
  --primary: 221.2 83.2% 53.3%;
  --primary-foreground: 210 40% 98%;
  --secondary: 210 40% 96%;
  --secondary-foreground: 222.2 84% 4.9%;
  --muted: 210 40% 96%;
  --muted-foreground: 215.4 16.3% 46.9%;
  --accent: 210 40% 96%;
  --accent-foreground: 222.2 84% 4.9%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 210 40% 98%;
  --border: 214.3 31.8% 91.4%;
  --input: 214.3 31.8% 91.4%;
  --ring: 221.2 83.2% 53.3%;
  --radius: 0.5rem;
  
  /* Custom colors for manga theme */
  --manga-primary: 262 83% 58%;
  --manga-secondary: 280 65% 60%;
  --manga-accent: 48 96% 89%;
  --manga-success: 142 76% 36%;
  --manga-warning: 38 92% 50%;
  --manga-error: 0 84% 60%;
}

/* Performance Optimizations */
.lazy-load {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.lazy-load.loaded {
    opacity: 1;
}

/* Image optimization */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Preload critical images */
.comic-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.comic-image img:hover {
    transform: scale(1.05);
}

/* Critical CSS for above-the-fold content */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

/* Optimize for Core Web Vitals */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
}

/* Reduce layout shift */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Optimize animations */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: hsl(var(--foreground));
}

h1 {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

h2 {
  font-size: 2.25rem;
  font-weight: 600;
  letter-spacing: -0.025em;
}

h3 {
  font-size: 1.875rem;
  font-weight: 600;
}

p {
  margin-bottom: 1rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.7;
}

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

/* Buttons - shadcn style */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-weight: 500;
  transition: all 0.2s ease-in-out;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1.25rem;
  padding: 0.5rem 1rem;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

.btn:disabled {
  pointer-events: none;
  opacity: 0.5;
}

.btn-primary {
  background-color: hsl(var(--manga-primary));
  color: hsl(var(--primary-foreground));
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.btn-primary:hover {
  background-color: hsl(var(--manga-primary) / 0.9);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px 0 rgb(0 0 0 / 0.15);
}

.btn-secondary {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  border: 1px solid hsl(var(--border));
}

.btn-secondary:hover {
  background-color: hsl(var(--secondary) / 0.8);
  color: hsl(var(--secondary-foreground));
}

.btn-outline {
  background-color: transparent;
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
}

.btn-outline:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.btn-ghost {
  background-color: transparent;
  color: hsl(var(--foreground));
}

.btn-ghost:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.btn-large {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.btn-small {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
}

/* Header - Modern glassmorphism */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid hsl(var(--border));
  z-index: 1000;
  transition: all 0.3s ease;
}

.navbar {
  padding: 1rem 0;
}

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

.nav-brand h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: hsl(var(--manga-primary));
  margin: 0;
  background: linear-gradient(135deg, hsl(var(--manga-primary)), hsl(var(--manga-secondary)));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.nav-link {
  text-decoration: none;
  color: hsl(var(--muted-foreground));
  font-weight: 500;
  transition: color 0.2s ease;
  position: relative;
}

.nav-link:hover {
  color: hsl(var(--foreground));
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: hsl(var(--manga-primary));
  transition: width 0.2s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* Hero Section - Modern gradient */
.hero {
  padding: 120px 0 80px;
  background: linear-gradient(135deg, hsl(var(--background)) 0%, hsl(var(--muted)) 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 80%, hsl(var(--manga-primary) / 0.1) 0%, transparent 50%),
              radial-gradient(circle at 80% 20%, hsl(var(--manga-secondary) / 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: hsl(var(--foreground));
  line-height: 1.1;
}

.highlight {
  background: linear-gradient(135deg, hsl(var(--manga-primary)), hsl(var(--manga-secondary)));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-description {
  font-size: 1.125rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 2rem;
  line-height: 1.7;
}

.hero-stats {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
}

.stat {
  text-align: center;
  padding: 1rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: hsl(var(--manga-primary));
  line-height: 1;
}

.stat-label {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  font-weight: 500;
  margin-top: 0.5rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-image {
  display: flex;
  justify-content: center;
  align-items: center;
}

.image-placeholder {
  width: 400px;
  height: 300px;
  background: linear-gradient(135deg, hsl(var(--manga-primary) / 0.1), hsl(var(--manga-secondary) / 0.1));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  border: 2px dashed hsl(var(--border));
  position: relative;
  overflow: hidden;
}

.image-placeholder::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, hsl(var(--manga-primary) / 0.1) 50%, transparent 70%);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Section Headers */
.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: hsl(var(--foreground));
}

.section-header p {
  font-size: 1.125rem;
  color: hsl(var(--muted-foreground));
  max-width: 600px;
  margin: 0 auto;
}

/* Latest Comics Section */
.latest-comics {
  padding: 80px 0;
  background: hsl(var(--background));
}

.comics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.comic-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.comic-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px 0 rgb(0 0 0 / 0.15);
  border-color: hsl(var(--manga-primary));
}

.comic-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3/4;
}

.comic-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.comic-card:hover .comic-image img {
  transform: scale(1.05);
}

.comic-info {
  padding: 1.5rem;
}

.comic-info h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: hsl(var(--foreground));
}

.comic-genre {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.5rem;
}

.comic-status {
  font-size: 0.75rem;
  color: hsl(var(--manga-success));
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Features Section */
.features {
  padding: 80px 0;
  background: hsl(var(--muted));
}

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

.feature-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px 0 rgb(0 0 0 / 0.15);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, hsl(var(--manga-primary)), hsl(var(--manga-secondary)));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.feature-card h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: hsl(var(--foreground));
}

.feature-card p {
  color: hsl(var(--muted-foreground));
  line-height: 1.6;
}

/* Genres Section */
.genres {
  padding: 80px 0;
  background: hsl(var(--background));
}

.genres-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.genre-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.genre-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px 0 rgb(0 0 0 / 0.15);
  border-color: hsl(var(--manga-primary));
}

.genre-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, hsl(var(--manga-primary)), hsl(var(--manga-secondary)));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.genre-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: hsl(var(--foreground));
}

.genre-card p {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin: 0;
}

/* CTA Section */
.cta-section {
  padding: 80px 0;
  background: linear-gradient(135deg, hsl(var(--manga-primary)), hsl(var(--manga-secondary)));
  color: hsl(var(--primary-foreground));
  text-align: center;
}

.cta-content h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: hsl(var(--primary-foreground));
}

.cta-content p {
  font-size: 1.125rem;
  margin-bottom: 2rem;
  color: hsl(var(--primary-foreground) / 0.9);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

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

.cta-section .btn-primary {
  background: hsl(var(--primary-foreground));
  color: hsl(var(--manga-primary));
}

.cta-section .btn-primary:hover {
  background: hsl(var(--primary-foreground) / 0.9);
  transform: translateY(-2px);
}

.cta-section .btn-secondary {
  background: transparent;
  color: hsl(var(--primary-foreground));
  border: 1px solid hsl(var(--primary-foreground));
}

.cta-section .btn-secondary:hover {
  background: hsl(var(--primary-foreground));
  color: hsl(var(--manga-primary));
}

/* About Section */
.about {
  padding: 80px 0;
  background: hsl(var(--muted));
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-text h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: hsl(var(--foreground));
}

.about-text p {
  font-size: 1.125rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 2rem;
  line-height: 1.7;
}

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

.about-stat {
  text-align: center;
  padding: 1.5rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.about-stat .stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: hsl(var(--manga-primary));
  line-height: 1;
}

.about-stat .stat-label {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  font-weight: 500;
  margin-top: 0.5rem;
}

.about-image {
  display: flex;
  justify-content: center;
  align-items: center;
}

.about-image .image-placeholder {
  width: 100%;
  max-width: 400px;
  height: 300px;
}

/* Footer */
.footer {
  background: hsl(var(--foreground));
  color: hsl(var(--primary-foreground));
  padding: 3rem 0 1rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: hsl(var(--primary-foreground));
}

.footer-section p {
  color: hsl(var(--primary-foreground) / 0.8);
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: hsl(var(--primary-foreground) / 0.8);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

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

.social-link {
  color: hsl(var(--primary-foreground) / 0.8);
  font-size: 1.5rem;
  transition: color 0.2s ease;
}

.social-link:hover {
  color: hsl(var(--primary-foreground));
}

.footer-bottom {
  border-top: 1px solid hsl(var(--primary-foreground) / 0.2);
  padding-top: 1rem;
  text-align: center;
}

.footer-bottom p {
  color: hsl(var(--primary-foreground) / 0.6);
  margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
  
  .navbar .container {
    flex-direction: column;
    gap: 1rem;
  }
  
  .nav-menu {
    flex-direction: column;
    gap: 1rem;
  }
  
  .hero {
    padding: 100px 0 60px;
  }
  
  .hero .container {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-stats {
    justify-content: center;
  }
  
  .hero-actions {
    justify-content: center;
  }
  
  .image-placeholder {
    width: 100%;
    max-width: 300px;
    height: 200px;
  }
  
  .about-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .about-stats {
    grid-template-columns: 1fr;
  }
  
  .cta-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .cta-actions .btn {
    width: 100%;
    max-width: 300px;
  }
  
  .comics-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .genres-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }
  
  .section-header h2 {
    font-size: 2rem;
  }
  
  .hero-stats {
    flex-direction: column;
    gap: 1rem;
  }
  
  .about-stats {
    grid-template-columns: 1fr;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* Loading states */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Mobile loading improvements */
@media (max-width: 768px) {
  .loading {
    opacity: 0.7;
  }
  
  .loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid hsl(var(--muted-foreground));
    border-top: 2px solid hsl(var(--manga-primary));
    border-radius: 50%;
    animation: spin 1s linear infinite;
  }
}

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

/* Focus states */
.btn:focus,
.nav-link:focus {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

/* Mobile focus improvements */
@media (max-width: 768px) {
  .btn:focus,
  .nav-link:focus,
  .mobile-menu-toggle:focus {
    outline: 3px solid hsl(var(--ring));
    outline-offset: 1px;
  }
  
  .comic-card:focus {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 2px;
  }
  
  /* Screen reader improvements */
  .nav-menu[aria-hidden="true"] {
    display: none;
  }
  
  .nav-menu[aria-hidden="false"] {
    display: flex;
  }
  
  .mobile-menu-toggle[aria-expanded="true"] {
    background-color: hsl(var(--accent));
  }
}

/* Breadcrumb */
.breadcrumb {
  padding: 1rem 0;
  background: hsl(var(--muted));
  border-bottom: 1px solid hsl(var(--border));
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  font-size: 0.875rem;
}

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

.breadcrumb-list li:not(:last-child)::after {
  content: '/';
  margin-left: 0.5rem;
  color: hsl(var(--muted-foreground));
}

.breadcrumb-list a {
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb-list a:hover {
  color: hsl(var(--foreground));
}

/* Comic Detail */
.comic-detail {
  padding: 80px 0;
  background: hsl(var(--background));
}

.comic-header {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.comic-cover {
  position: relative;
}

.cover-image {
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 12px 0 rgb(0 0 0 / 0.15);
  border: 1px solid hsl(var(--border));
}

.cover-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.cover-image:hover img {
  transform: scale(1.05);
}

.cover-image span {
  font-size: 3rem;
  color: hsl(var(--muted-foreground));
}

.comic-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: hsl(var(--foreground));
  line-height: 1.2;
}

.comic-meta {
  margin-bottom: 2rem;
}

.meta-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 1rem;
  gap: 1rem;
}

.meta-label {
  font-weight: 600;
  color: hsl(var(--foreground));
  min-width: 120px;
  font-size: 0.875rem;
}

.meta-value {
  color: hsl(var(--muted-foreground));
  flex: 1;
  font-size: 0.875rem;
}

.status-ongoing {
  color: hsl(var(--manga-success));
}

.status-completed {
  color: hsl(var(--manga-warning));
}

.comic-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.comic-actions .btn {
  flex: 1;
  min-width: 150px;
}

.btn-outline {
  background: transparent;
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
}

.btn-outline:hover {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.comic-summary {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 3rem;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.comic-summary h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: hsl(var(--foreground));
}

.comic-summary p {
  color: hsl(var(--muted-foreground));
  line-height: 1.7;
  margin: 0;
}

.related-comics {
  padding: 80px 0;
  background: hsl(var(--muted));
}

.popular-manga {
  padding: 80px 0;
  background: hsl(var(--background));
}

.manga-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.manga-item {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.manga-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px 0 rgb(0 0 0 / 0.15);
  border-color: hsl(var(--manga-primary));
}

.manga-info h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: hsl(var(--foreground));
}

.chapter-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.chapter-links a {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  border-radius: calc(var(--radius) - 2px);
  transition: all 0.2s ease;
}

.chapter-links a:hover {
  background: hsl(var(--manga-primary));
  color: hsl(var(--primary-foreground));
}

/* Mobile responsive for comic detail */
@media (max-width: 768px) {
  .comic-header {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .cover-image {
    max-width: 250px;
    margin: 0 auto;
  }
  
  .cover-image img {
    width: 100%;
  }
  
  .cover-image span {
    font-size: 2rem;
  }
  
  .comic-title {
    font-size: 2rem;
  }
  
  .meta-item {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .meta-label {
    min-width: auto;
  }
  
  .comic-actions {
    flex-direction: column;
    gap: 1rem;
  }
  
  .comic-actions .btn {
    width: 100%;
  }
  
  .breadcrumb-list {
    flex-wrap: wrap;
    gap: 0.25rem;
  }
  
  .breadcrumb-list li {
    font-size: 0.8rem;
  }
  
  .breadcrumb-list li:not(:last-child)::after {
    margin-left: 0.25rem;
  }
  
  .comic-summary {
    padding: 2rem 0;
  }
  
  .comic-summary h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }
  
  .related-comics,
  .popular-manga {
    padding: 2rem 0;
  }
  
  .section-header h2 {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .comic-title {
    font-size: 1.75rem;
  }
  
  .cover-image {
    max-width: 200px;
  }
  
  .cover-image img {
    width: 100%;
  }
  
  .cover-image span {
    font-size: 1.5rem;
  }
  
  .comic-actions {
    flex-direction: column;
  }
  
  .comic-actions .btn {
    width: 100%;
  }
  
  .breadcrumb-list {
    font-size: 0.75rem;
  }
  
  .breadcrumb-list li:not(:last-child)::after {
    margin-left: 0.2rem;
  }
}

/* Print styles */
@media print {
  .header,
  .footer,
  .nav-menu,
  .hero-actions,
  .comic-actions {
    display: none !important;
  }
  
  .hero {
    padding: 2rem 0;
  }
  
  .container {
    max-width: none;
    padding: 0;
  }
}

/* Comic List Page */
.comic-list {
  padding: 80px 0;
  background: hsl(var(--background));
}

.comic-list h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: hsl(var(--foreground));
}

.comics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.comic-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.comic-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px 0 rgb(0 0 0 / 0.15);
  border-color: hsl(var(--manga-primary));
}

.comic-cover {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3/4;
}

.comic-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.comic-card:hover .comic-cover img {
  transform: scale(1.05);
}

.comic-info {
  padding: 1.5rem;
}

.comic-info h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: hsl(var(--foreground));
}

.genre {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.5rem;
}

.description {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 1rem;
  line-height: 1.5;
}

.comic-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.comic-actions .btn {
  flex: 1;
  min-width: 120px;
  font-size: 0.75rem;
  padding: 0.5rem 0.75rem;
}

/* Stats Section */
.stats {
  padding: 60px 0;
  background: hsl(var(--muted));
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.stat-item h3 {
  font-size: 2.5rem;
  font-weight: 700;
  color: hsl(var(--manga-primary));
  margin-bottom: 0.5rem;
  text-align: center;
}

.stat-item p {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  text-align: center;
  margin: 0;
}

/* Mobile responsive for comic list */
@media (max-width: 768px) {
  .comics-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
  
  .comic-card {
    max-width: 350px;
    margin: 0 auto;
  }
  
  .comic-cover {
    height: 200px;
  }
  
  .comic-info {
    padding: 1rem;
  }
  
  .comic-actions {
    flex-direction: column;
    gap: 1rem;
  }
  
  .comic-actions .btn {
    width: 100%;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .stat-item h3 {
    font-size: 2rem;
  }
  
  .comic-list h2 {
    font-size: 2rem;
  }
  
  .quick-links h2 {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .comics-grid {
    grid-template-columns: 1fr;
  }
  
  .comic-cover {
    height: 180px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .comic-list h2 {
    font-size: 1.75rem;
  }
  
  .quick-links h2 {
    font-size: 1.75rem;
  }
  
  .comic-actions .btn {
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
  }
}

/* Quick Links Section */
.quick-links {
  padding: 60px 0;
  background: hsl(var(--background));
}

.quick-links h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: hsl(var(--foreground));
}

.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.quick-link-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.quick-link-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px 0 rgb(0 0 0 / 0.15);
  border-color: hsl(var(--manga-primary));
}

.quick-link-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: hsl(var(--foreground));
}

.quick-link-card p {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin: 0;
}

/* Mobile responsive for quick links */
@media (max-width: 768px) {
  .links-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
  
  .quick-link-card {
    padding: 1rem;
  }
  
  .quick-link-card h3 {
    font-size: 1rem;
  }
  
  .quick-link-card p {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .links-grid {
    grid-template-columns: 1fr;
  }
  
  .quick-link-card {
    padding: 1.25rem;
  }
  
  .quick-link-card h3 {
    font-size: 1.125rem;
  }
} 

/* Mobile Navigation */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 0.5rem;
  border: none;
  background: none;
  gap: 4px;
  z-index: 1001;
  position: relative;
}

.mobile-menu-toggle span {
  width: 25px;
  height: 3px;
  background-color: hsl(var(--foreground));
  transition: all 0.3s ease;
  border-radius: 2px;
  display: block;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
  display: block;
  opacity: 1;
}

/* Touch-friendly improvements */
.btn {
  min-height: 44px;
  min-width: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.nav-link {
  min-height: 44px;
  display: flex;
  align-items: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.comic-card {
  touch-action: manipulation;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Mobile touch improvements */
@media (max-width: 768px) {
  .comic-card:active {
    transform: scale(0.98);
  }
  
  .btn:active {
    transform: scale(0.98);
  }
  
  .nav-link:active {
    background-color: hsl(var(--accent) / 0.8);
  }
  
  .quick-link-card:active {
    transform: scale(0.98);
  }
  
  .genre-card:active {
    transform: scale(0.98);
  }
  
  .feature-card:active {
    transform: scale(0.98);
  }
  
  /* Safe area support for notched devices */
  .navbar {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
  
  .nav-menu {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
  }
  
  .container {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
}

.mobile-menu-toggle {
  min-height: 44px;
  min-width: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Improve touch targets for mobile */
.comic-image img,
.cover-image img {
  pointer-events: none;
}

.comic-card:active,
.btn:active,
.nav-link:active {
  transform: scale(0.98);
  transition: transform 0.1s ease;
}

/* Body scroll lock when mobile menu is open */
body.menu-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* Smooth scrolling for mobile */
@media (max-width: 768px) {
  html {
    scroll-behavior: smooth;
  }
  
  .nav-menu {
    -webkit-overflow-scrolling: touch;
  }
}

/* Mobile-first responsive design */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }
  
  .nav-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100vh;
    background: hsl(var(--background));
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 0;
    transition: left 0.3s ease;
    z-index: 1000;
    padding-top: 80px;
    overflow-y: auto;
  }
  
  .nav-menu.active {
    left: 0;
  }
  
  .nav-menu .nav-link {
    font-size: 1.25rem;
    padding: 1.5rem 2rem;
    width: 100%;
    text-align: center;
    border-bottom: 1px solid hsl(var(--border));
    transition: background-color 0.2s ease;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .nav-menu .nav-link:hover {
    background-color: hsl(var(--accent));
  }
  
  .nav-menu .nav-link:active {
    background-color: hsl(var(--accent) / 0.8);
  }
  
  .navbar .container {
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    position: relative;
  }
  
  .nav-brand {
    z-index: 1001;
  }
  
  .nav-cta {
    display: none;
  }
  
  .navbar {
    position: relative;
    z-index: 1000;
  }
  
  .hero {
    padding: 80px 0 40px;
    min-height: 80vh;
  }
  
  .hero .container {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }
  
  .hero-title {
    font-size: 2rem;
    line-height: 1.2;
  }
  
  .hero-description {
    font-size: 1rem;
  }
  
  .hero-stats {
    flex-direction: column;
    gap: 1rem;
  }
  
  .hero-actions {
    flex-direction: column;
    gap: 1rem;
  }
  
  .hero-actions .btn {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
  }
  
  .comics-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
  }
  
  .comic-card {
    min-height: 200px;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .genres-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
  
  .about-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .about-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .cta-actions {
    flex-direction: column;
    gap: 1rem;
  }
  
  .cta-actions .btn {
    width: 100%;
    max-width: 300px;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }
  
  .footer-links {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .social-links {
    justify-content: center;
    gap: 1rem;
  }
  
  .footer-section {
    padding: 0 1rem;
  }
  
  .footer-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }
  
  .footer-section p {
    font-size: 0.875rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }
  
  .hero-title {
    font-size: 1.75rem;
  }
  
  .section-header h2 {
    font-size: 1.75rem;
  }
  
  .comics-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .comic-card {
    min-height: 180px;
  }
  
  .about-stats {
    grid-template-columns: 1fr;
  }
  
  .hero-stats {
    gap: 0.5rem;
  }
  
  .stat {
    padding: 0.75rem;
  }
  
  .stat-number {
    font-size: 1.5rem;
  }
  
  .btn {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }
  
  .footer-content {
    gap: 1.5rem;
  }
  
  .footer-section h3 {
    font-size: 1.125rem;
  }
  
  .footer-section p {
    font-size: 0.8rem;
  }
  
  .footer-links {
    gap: 0.5rem;
  }
  
  .social-links {
    gap: 0.75rem;
  }
}

/* Tablet optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
  .container {
    padding: 0 2rem;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .comics-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
  
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .genres-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
  
  .mobile-menu-toggle {
    display: none;
  }
  
  .nav-menu {
    display: flex !important;
    position: static;
    width: auto;
    height: auto;
    background: none;
    flex-direction: row;
    gap: 1rem;
    padding: 0;
  }
  
  .nav-menu .nav-link {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border: none;
    min-height: auto;
  }
  
  .nav-cta {
    display: block;
  }
}

/* Landscape mobile optimizations */
@media (max-width: 768px) and (orientation: landscape) {
  .hero {
    min-height: 60vh;
    padding: 60px 0 30px;
  }
  
  .nav-menu {
    padding-top: 60px;
    justify-content: flex-start;
  }
  
  .nav-menu .nav-link {
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    min-height: 50px;
  }
  
  .mobile-menu-toggle {
    padding: 0.25rem;
  }
  
  .mobile-menu-toggle span {
    width: 20px;
    height: 2px;
  }
  
  .comic-header {
    grid-template-columns: 200px 1fr;
    gap: 1.5rem;
  }
  
  .cover-image {
    max-width: 200px;
  }
  
  .comic-title {
    font-size: 1.75rem;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .comic-image img,
  .cover-image img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Performance optimizations for mobile */
@media (max-width: 768px) {
  .comic-card,
  .feature-card,
  .genre-card,
  .quick-link-card {
    will-change: transform;
  }
  
  .nav-menu {
    will-change: transform;
  }
  
  .mobile-menu-toggle span {
    will-change: transform;
  }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .mobile-menu-toggle span,
  .nav-menu,
  .comic-card,
  .btn {
    transition: none;
  }
  
  .loading::after {
    animation: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .mobile-menu-toggle span {
    background-color: hsl(var(--foreground));
  }
  
  .nav-menu .nav-link {
    border-bottom: 2px solid hsl(var(--border));
  }
  
  .btn {
    border: 2px solid hsl(var(--border));
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --background: 222.2 84% 4.9%;
    --foreground: 210 40% 98%;
    --card: 222.2 84% 4.9%;
    --card-foreground: 210 40% 98%;
    --popover: 222.2 84% 4.9%;
    --popover-foreground: 210 40% 98%;
    --primary: 210 40% 98%;
    --primary-foreground: 222.2 84% 4.9%;
    --secondary: 217.2 32.6% 17.5%;
    --secondary-foreground: 210 40% 98%;
    --muted: 217.2 32.6% 17.5%;
    --muted-foreground: 215 20.2% 65.1%;
    --accent: 217.2 32.6% 17.5%;
    --accent-foreground: 210 40% 98%;
    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 210 40% 98%;
    --border: 217.2 32.6% 17.5%;
    --input: 217.2 32.6% 17.5%;
    --ring: 212.7 26.8% 83.9%;
  }
  
  /* Mobile dark mode improvements */
  @media (max-width: 768px) {
    .mobile-menu-toggle span {
      background-color: hsl(var(--foreground));
    }
    
    .nav-menu {
      background: hsl(var(--background));
      border-right: 1px solid hsl(var(--border));
    }
    
    .nav-menu .nav-link {
      border-bottom: 1px solid hsl(var(--border));
    }
    
    .nav-menu .nav-link:hover {
      background-color: hsl(var(--accent));
    }
  }
} 