/* 
Theme Name: AniTheme
Description: A modern anime and manga theme with advanced features
Version: 1.0.0
Author: AniTheme Team
*/

/* Override invalid CSS properties that WordPress adds */
img:is([sizes="auto" i], [sizes^="auto," i]) {
    /* WordPress sometimes adds invalid properties - this rule ensures clean styling */
}

/* Custom CSS for the theme */

/* 
This theme uses Tailwind CSS for styling.
Custom styles below are minimal and only used for WordPress-specific elements
or for overriding Tailwind defaults when necessary.
*/

/* ==========================================================================
   BASE STYLES
   ========================================================================== */

body {
  font-family: var(--body-font);
  background-color: var(--body-bg);
  color: var(--text-color);
  line-height: 1.6;
  overflow-x: hidden;
    margin: 0;
    padding: 0;
}

body {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: Inter, sans-serif;
}

/* ==========================================================================
   BLOG STYLES
   ========================================================================== */

/* Blog prose styles for content */
.prose {
    max-width: none;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.prose h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #111827;
    word-wrap: break-word;
}

.prose p {
    margin-bottom: 1rem;
    line-height: 1.7;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.prose blockquote {
    border-left: 4px solid #3b82f6;
    padding-left: 1rem;
    font-style: italic;
    color: #6b7280;
    margin: 1.5rem 0;
    word-wrap: break-word;
}

.prose strong {
    font-weight: 700;
    color: #111827;
}

.prose em {
    font-style: italic;
}

.prose a {
    color: #3b82f6;
    text-decoration: underline;
    word-wrap: break-word;
}

.prose a:hover {
    color: #1d4ed8;
}

.prose ul, .prose ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.prose li {
    margin-bottom: 0.5rem;
    word-wrap: break-word;
}

.prose img {
    margin: 1.5rem 0;
    border-radius: 0.5rem;
    max-width: 100%;
    height: auto;
}

.prose table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin: 1.5rem 0;
    overflow-x: auto;
    display: block;
    white-space: nowrap;
}

.prose th, .prose td {
    border: 1px solid #e5e7eb;
    padding: 0.5rem;
    text-align: left;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.prose pre {
    background-color: #f3f4f6;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    word-wrap: normal;
    white-space: pre;
}

.prose code {
    background-color: #f3f4f6;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-family: monospace;
    word-wrap: break-word;
}

/* Blog line clamp utilities */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Blog text utilities */
.text-balance {
    text-wrap: balance;
}

.text-primary-blue {
    color: #2563eb;
}

/* Blog touch utilities */
.touch-pan-y {
    touch-action: pan-y pinch-zoom;
}

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

/* Social sharing styles */
.social-sharing-container {
    position: relative;
}

.social-sharing-desktop {
    position: relative;
}

.social-sharing-tablet {
    position: relative;
}

.social-sharing-mobile {
    position: relative;
}

/* Ensure proper spacing for mobile layout */
/*
@media (max-width: 640px) {
    body {
        padding-bottom: 80px; 
    }
}
*/

/* Popular section button styles */
#popularPrev, #popularNext {
    transform: translateY(-50%) !important;
    transition: opacity 0.2s ease, background-color 0.2s ease, color 0.2s ease !important;
    will-change: opacity, background-color, color;
}

#popularPrev:hover, #popularNext:hover {
    transform: translateY(-50%) !important;
}

#popularPrev:active, #popularNext:active {
    transform: translateY(-50%) !important;
}

#popularPrev:focus, #popularNext:focus {
    transform: translateY(-50%) !important;
}

/* Ensure buttons stay centered on all devices */
@media (max-width: 640px) {
    #popularPrev, #popularNext {
        top: 50% !important;
        transform: translateY(-50%) !important;
    }
}

/* ==========================================================================
   CUSTOM SCROLLBAR
   ========================================================================== */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.dark ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Prevent scrollbar from taking up layout space */
html {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
    scrollbar-gutter: stable;
}

/* Enhanced scrollbar for character pages */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgb(243 244 246);
}

::-webkit-scrollbar-thumb {
    background: rgb(156 163 175);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgb(107 114 128);
}

/* Dark mode scrollbar */
@media (prefers-color-scheme: dark) {
    ::-webkit-scrollbar-track {
        background: rgb(17 24 39);
    }
    
    ::-webkit-scrollbar-thumb {
        background: rgb(75 85 99);
    }
    
    ::-webkit-scrollbar-thumb:hover {
        background: rgb(107 114 128);
    }
}

/* ==========================================================================
   CONTAINER STYLES
   ========================================================================== */
/*
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}
*/
/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

/* Line clamp utilities */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
    opacity: 1;
    transform: translateY(0);
}

/* Loading animations */
@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes skeleton {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Loading states */
.loading-spinner {
    animation: spin 1s linear infinite;
}

.loading-skeleton {
    background: linear-gradient(90deg, #e2e8f0 25%, #cbd5e1 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-loader {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s infinite;
}

.pulse-animation {
    animation: pulse 2s infinite;
}

/* ==========================================================================
   HERO SECTION STYLES
   ========================================================================== */

.hero-overlay {
    background: linear-gradient(135deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.5) 50%, rgba(0,0,0,0.8) 100%);
}

.glass-card {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   CARD AND IMAGE STYLES
   ========================================================================== */

.anime-card {
    transition: all 0.3s ease-in-out;
    opacity: 1;
    transform: translateY(0);
}

.anime-card:hover {
    transform: translateY(-2px);
}

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

.anime-card.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.manga-card {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.manga-card.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.anime-image {
    transition: all 0.3s ease-in-out;
}

.anime-image.hover {
    transform: scale(1.1);
}

.manga-image {
    transition: transform 0.3s ease-in-out;
}

.manga-image.hover {
    transform: scale(1.1);
}

/* Image loading states */
img {
    transition: opacity 0.3s ease;
}

/* ==========================================================================
   SECTION STYLES
   ========================================================================== */

.anime-section {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.manga-section {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* ==========================================================================
   CAROUSEL STYLES
   ========================================================================== */

.carousel-container {
    scroll-behavior: smooth;
}

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

.carousel-container {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ==========================================================================
   TAB STYLES
   ========================================================================== */

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-button {
    background-color: transparent;
    color: #6b7280;
}

.tab-button.active {
    background-color: #2563eb;
    color: #ffffff;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.tab-button:hover {
    background-color: #dbeafe;
    color: #2563eb;
}

.tab-button.active:hover {
    background-color: #1d4ed8;
    color: #ffffff;
}

/* Section button styles */
.btn-section {
    padding: 0.625rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    background-color: transparent;
    color: #374151;
    transition: all 0.2s;
    border: none;
}

.btn-section:hover {
    background-color: #dbeafe;
    color: #2563eb;
}

.btn-section.active {
    background-color: #2563eb;
    color: #ffffff;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.section-content {
    display: none;
}

.section-content.active {
  display: block;
}

/* ==========================================================================
   MODAL STYLES
   ========================================================================== */

#trailer-modal.hidden {
    display: none;
}

#trailer-modal:not(.hidden) {
    display: block;
}

/* ==========================================================================
   CHECKBOX STYLES
   ========================================================================== */

/* Custom checkbox styling for blue checkmarks */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    background-color: white;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

input[type="checkbox"]:checked {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 0px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 2px #3b82f6, 0 0 0 4px rgba(59, 130, 246, 0.1);
}

input[type="checkbox"]:hover {
    border-color: #3b82f6;
}

/* ==========================================================================
   ACCESSIBILITY AND FOCUS STYLES
   ========================================================================== */

/* Remove focus outline for mouse clicks, keep for keyboard navigation */
a:focus:not(:focus-visible), button:focus:not(:focus-visible) {
    outline: none;
}

/* Enhanced focus states for keyboard navigation only */
a:focus-visible, button:focus-visible {
    outline: 2px solid rgb(59 130 246);
    outline-offset: 2px;
}

/* Remove focus outline from all interactive elements on click */
*:focus:not(:focus-visible) {
    outline: none;
}

/* ==========================================================================
   MOBILE-SPECIFIC STYLES
   ========================================================================== */

@media (max-width: 640px) {
    /* Glass card mobile improvements */
    .glass-card {
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    }
    
    /* Improve touch targets */
    select, input, button {
        min-height: 44px;
    }
    
    /* Better text contrast */
    .text-gray-200 {
        color: rgba(229, 231, 235, 0.95);
    }
    
    /* Enhanced focus states for mobile */
    input:focus, select:focus {
        transform: scale(1.02);
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
    }
    
    /* Improve button touch feedback */
    button:active {
        transform: scale(0.98);
    }
    
    /* Ensure hero content is visible on mobile */
    .hero-section {
        padding-top: 40px;
        padding-bottom: 60px;
        position: relative;
        z-index: 10;
    }
    
    /* Better spacing for mobile hero */
    .hero-content {
        justify-content: space-between;
        padding-top: 25px;
        padding-bottom: 40px;
    }
    
    /* Ensure title is visible */
    .hero-title {
        margin-top: 0;
        margin-bottom: 16px;
    }
    
    /* Better spacing between hero and content */
    .hero-section + section {
        margin-top: 32px;
    }
    
    /* Add proper spacing after hero */
    main > section:first-of-type {
        margin-top: 24px;
    }
    
    /* Blog prose mobile styles */
    .prose {
        font-size: 1rem;
    }
    
    .prose h2 {
        font-size: 1.25rem;
    }
    
    .prose table {
        font-size: 0.875rem;
    }
}

/* ==========================================================================
   BACKDROP BLUR UTILITIES
   ========================================================================== */

.backdrop-blur-sm {
    backdrop-filter: blur(4px);
}

/* ==========================================================================
   TRANSITION UTILITIES
   ========================================================================== */

.transition-all {
    transition: all 0.3s ease;
}

/* ==========================================================================
   ASPECT RATIO UTILITIES
   ========================================================================== */

.aspect-\[3\/4\] {
    aspect-ratio: 3/4;
}

/* ==========================================================================
   GROUP HOVER UTILITIES
   ========================================================================== */

.group:hover .group-hover\:scale-105 {
    transform: scale(1.05);
}

/* ==========================================================================
   SCREEN READER UTILITIES
   ========================================================================== */

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* ==========================================================================
   THEME TOGGLE AND MOBILE MENU STYLES
   ========================================================================== */

/* Mobile menu open state */
body.mobile-menu-open {
    overflow: hidden;
}

/* ==========================================================================
   RESPONSIVE UTILITIES
   ========================================================================== */

/* Ensure containers don't get affected by scrollbar */
/*
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}
*/
/* ==========================================================================
   BLOG RESPONSIVE HANDLING
   ========================================================================== */

/* Responsive image handling */
.prose img, 
.prose video, 
.prose iframe, 
.prose embed, 
.prose object {
    max-width: 100% !important;
    height: auto !important;
    width: auto !important;
}

/* Handle long URLs and text */
.prose a {
    word-break: break-all;
    overflow-wrap: break-word;
}

/* Responsive table wrapper */
.prose table {
    display: block;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
}

/* Custom scrollbar for horizontal scroll */
.overflow-auto::-webkit-scrollbar {
    height: 6px;
}

.overflow-auto::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.overflow-auto::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.overflow-auto::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Ensure no horizontal overflow */
* {
    box-sizing: border-box;
}

.prose * {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}


.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.text-balance {
    text-wrap: balance;
}
.touch-pan-y {
    touch-action: pan-y pinch-zoom;
}

/* Tag header styles */
.embla {
    background-color: #f8fafc;
}
.bg-mute {
    background-color: #f8fafc;
}
.border-soft {
    border-color: #e2e8f0;
}
.border-line {
    border-color: #e2e8f0;
}
.bg-edge {
    background-color: #3b82f6;
}


.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.carousel-container {
    scroll-behavior: smooth;
}
.carousel-container::-webkit-scrollbar {
    display: none;
}
.carousel-container {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.anime-image {
    transition: transform 0.3s ease-in-out;
}
.anime-image.hover {
    transform: scale(1.1);
}
.loading-skeleton {
    background: linear-gradient(90deg, #e2e8f0 25%, #cbd5e1 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}
@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.pulse-animation {
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.fade-in {
    opacity: 1;
    transform: translateY(0);
}
.anime-section {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.anime-card {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}
.anime-card.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.text-balance {
    text-wrap: balance;
}
.touch-pan-y {
    touch-action: pan-y pinch-zoom;
}

/* Category header styles */
.embla {
    background-color: #f8fafc;
}
.bg-mute {
    background-color: #f8fafc;
}
.border-soft {
    border-color: #e2e8f0;
}
.border-line {
    border-color: #e2e8f0;
}
.bg-edge {
    background-color: #3b82f6;
}

  /* Custom styling for character description formatting */
  .character-description strong {
    color: #1f2937;
    font-weight: 600;
}

.character-description p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.character-description br {
    margin-bottom: 0.5rem;
}

/* Ensure proper spacing for formatted content */
.prose strong {
    color: #1f2937;
    font-weight: 600;
}

.prose p {
    margin-bottom: 1rem;
}

.prose br {
    margin-bottom: 0.5rem;
}


.logo-container {
            width: 100%;
            max-width: 55%;
            height: 4rem; /* 64px - equivalent to h-16 */
        }
        
        .logo-image {
            width: auto;
            height: 100%;
            max-width: 70%;
            object-fit: contain;
            transition: all 0.2s;
            /* Reserve space but don't hide the image */
            display: block;
        }
        
        /* Responsive adjustments */
        @media (min-width: 768px) {
            .logo-container {
                max-width: 55%;
            }
            .logo-image {
                max-width: 50%;
            }
        }
        
        @media (min-width: 1024px) {
            .logo-container {
                max-width: 13%;
            }
            .logo-image {
                max-width: 20%;
            }
        }