/* FontAwesome Icons */
        @import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css");
        @import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css");
    
        /* ----- 1. Global & Theme ----- */
        :root {
            --color-primary-black: #121212;
            --color-secondary-black: #1a1a1a;
            --color-surface: #2a2a2a;
            --color-primary-red: #e60000;
            --color-text-primary: #f0f0f0;
            --color-text-secondary: #aaaaaa;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: "Sansation", serif;
			font-weight: 300;
            font-style: normal;
            background-color: var(--color-primary-black);
            color: var(--color-text-primary);
            line-height: 1.6;
            position: relative;
        }
        
        body.modal-open > *:not(#signup-modal) {
            filter: blur(5px);
            pointer-events: none;
        }

        a {
            color: var(--color-primary-red);
            text-decoration: none;
            transition: color 0.3s ease;
        }

        a:hover {
            color: #ff4d4d;
        }

        img {
            max-width: 100%;
            display: block;
        }

        /* ----- 2. Blur-Load for Images ----- */
        img.blur-load {
            filter: blur(8px);
            opacity: 0.6;
            transition: filter 0.4s ease-out, opacity 0.4s ease-out;
        }

        img.blur-load.loaded {
            filter: blur(0);
            opacity: 1;
        }

        /* ----- 3. Logo Animation (No Header) ----- */
        .logo-container {
            padding: 20px 25px;
            background-color: var(--color-secondary-black);
            border-bottom: 1px solid #333;
            overflow: hidden;
            position: relative;
            z-index: 2;
        }
        
        .logo-link-animated {
            display: inline-block;
        }

        .logo-img-animated {
            height: 85px;
            width: auto;
            object-fit: contain;
            animation: slideInFromLeft 1.2s ease-out forwards;
        }
        
        @keyframes slideInFromLeft {
            0% { transform: translateX(-100%); opacity: 0; }
            100% { transform: translateX(0); opacity: 1; }
        }
        
        /* ----- 4. Hero Banner Section ----- */
        .hero-banner {
            max-width: 1200px;
            margin: 40px auto;
            border-radius: 12px;
            overflow: hidden;
            position: relative;
            background-color: #000;
            border: 1px solid #333;
            
            mask-image: linear-gradient( to bottom, black 85%, transparent 100% );
            -webkit-mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
        }
        
        /* Background Scroller (HTML version) */
        .hero-banner .background-scroller {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 1;
            overflow: hidden;
            filter: blur(5px) opacity(0.3);
        }
        .hero-banner .scroller-track {
            display: flex;
            width: calc(20 * 400px); /* 10 images + 10 duplicates */
            height: 100%;
            animation: scrollHorizontal 120s linear infinite;
        }
        .hero-banner .scroller-track img {
            width: 400px;
            height: 100%;
            object-fit: cover;
            flex-shrink: 0;
        }
        
        @keyframes scrollHorizontal {
            0% { transform: translateX(0); }
            100% { transform: translateX(calc(-10 * 400px)); }
        }
        
        .hero-content {
            padding: 30px;
            display: flex;
            gap: 30px;
            position: relative;
            z-index: 2; /* Sits on top of the scroller */
        }
        
        .hero-left {
            flex: 0 0 250px;
        }
        
        .hero-cover {
            width: 100%;
            aspect-ratio: 2 / 3;
            object-fit: cover;
            border-radius: 8px;
            box-shadow: 0 5px 20px rgba(0,0,0,0.5);
        }
        
        .hero-status {
            text-align: center;
            font-weight: 700;
            font-size: 1.1rem;
            color: var(--color-text-primary);
            margin-top: 15px;
        }
        
        .hero-right {
            flex: 1;
        }
        
        /* NEW: Wrapper for title/logo on mobile */
        .hero-title-wrapper {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 15px;
        }
        
        .hero-title {
            font-size: 2.8rem;
            font-weight: 700;
            color: #fff;
            text-shadow: 0 2px 10px rgba(0,0,0,0.5);
        }
        
        .hero-author {
            font-size: 1.1rem;
            font-weight: 400;
            color: var(--color-text-secondary);
            margin-top: 5px;
        }
        
        .hero-description {
            font-size: 1.1rem;
            color: #ddd;
            margin-top: 20px;
            max-width: 600px;
        }
        
        .hero-rating-logo {
            width: 150px; /* MODIFIED: Was 130px */
            height: auto;
            margin-top: 20px;
            transition: opacity 0.3s ease;
        }
        
        .hero-rating-logo:hover {
            opacity: 0.8;
        }
        
        /* ----- 5. Main Content Layout ----- */
        .main-content-container {
            display: flex;
            max-width: 1200px;
            margin: 40px auto;
            padding: 0 20px;
            gap: 40px;
        }
        
        .chapter-column {
            flex: 2;
        }
        
        .sidebar-column {
            flex: 1;
        }
        
        /* ----- 6. Chapter List Styling ----- */
        .chapter-list {
            background-color: var(--color-secondary-black);
            border-radius: 8px;
            overflow: hidden;
            border: 1px solid #444;
        }
        
        .chapter-item {
            display: flex;
            align-items: flex-start;
            padding: 15px;
            gap: 15px;
            border-bottom: 1px solid #444; 
            transition: background-color 0.3s ease;
            text-decoration: none;
            color: var(--color-text-secondary);
        }
        
        .chapter-item:last-child {
            border-bottom: none;
        }
        
        .chapter-item:hover {
            background-color: var(--color-surface);
        }
        
        .chapter-thumbnail {
            flex: 0 0 160px;
            position: relative;
            border-radius: 6px;
            overflow: hidden;
        }

        .chapter-thumbnail img {
            width: 100%;
            aspect-ratio: 16 / 9;
            object-fit: cover;
            display: block;
        }
        
        .chapter-number {
            position: absolute;
            bottom: 5px;
            right: 5px;
            background-color: rgba(0, 0, 0, 0.7);
            color: #fff;
            padding: 2px 6px;
            border-radius: 4px;
            font-size: 0.8rem;
            font-weight: 700;
        }
        
        .chapter-info {
            flex: 1;
            display: flex;
            flex-direction: column;
        }
        
        .chapter-title {
            font-weight: 700;
            color: var(--color-text-primary);
            font-size: 1.2rem;
            line-height: 1.3;
            margin-bottom: 5px;
        }
        
        .chapter-date {
            font-size: 0.9rem;
            color: var(--color-text-secondary);
            margin-bottom: 8px;
        }
        
        .chapter-stats {
            display: flex;
            gap: 15px;
            font-size: 0.9rem;
            color: var(--color-text-secondary);
            align-items: center;
        }
        
        .chapter-stats i {
            margin-right: 5px;
        }
        
        /* ----- 7. Sidebar Styling ----- */
        .sidebar-widget {
            background-color: var(--color-secondary-black);
            border-radius: 8px;
            padding: 20px;
            margin-bottom: 30px;
        }
        
        .add-favorite-btn {
            width: 100%;
            padding: 12px;
            background-color: var(--color-primary-red);
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 1.1rem;
            font-weight: 700;
            transition: background-color 0.3s ease, opacity 0.3s ease;
        }
        
        .add-favorite-btn:hover {
            background-color: #c00;
        }
        
        .add-favorite-btn.is-favorite {
            background-color: var(--color-surface);
            color: var(--color-text-secondary);
            cursor: default;
        }
        
        .sidebar-title {
            font-size: 1.2rem;
            font-weight: 700;
            color: var(--color-text-primary);
            margin-bottom: 15px;
        }
        
        .language-list {
            font-size: 1rem;
            color: var(--color-text-secondary);
        }
        
        .next-chapter-info {
            font-size: 1rem;
            color: var(--color-text-secondary);
        }
        .next-chapter-info strong {
            color: var(--color-primary-red);
        }
        
        .recommendations-list {
            display: grid;
            gap: 15px;
        }
        
        .manga-card {
            background-color: var(--color-surface);
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 4px 10px rgba(0,0,0,0.3);
            transition: transform 0.3s ease;
            position: relative;
        }
        .manga-card:hover {
            transform: translateY(-5px);
        }
        .card-image-link {
            display: block;
        }
        .card-image {
            width: 100%;
            aspect-ratio: 2 / 3; 
            object-fit: cover;
        }
        .card-content {
            padding: 15px;
        }
        .card-title {
		    font-weight: 300;
            font-size: 1.1rem;
            color: var(--color-text-primary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        /* ----- 8. Footer ----- */
        .main-footer {
            background-color: var(--color-secondary-black);
            border-top: 1px solid #333;
            padding: 40px 20px;
            margin-top: 40px;
            position: relative;
            z-index: 2;
        }
        
        .footer-container {
            max-width: 1200px;
            margin: 0 auto;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 30px;
            text-align: left;
        }

        .footer-logo {
            width: 150px;
            margin-bottom: 20px;
        }
        
        .footer-column {
            display: flex;
            flex-direction: column;
        }

        .footer-column h4 {
            font-weight: 300;
            font-size: 1.1rem;
            margin-bottom: 15px;
            color: #fff;
        }

        .footer-column a,
        .footer-column p {
            color: var(--color-text-secondary);
            margin-bottom: 10px;
            font-size: 0.9rem;
        }

        .footer-column a:hover {
            color: #fff;
        }

        .social-links {
            display: flex;
            gap: 15px;
        }

        .social-links a {
            font-size: 1.5rem;
            color: var(--color-text-secondary);
        }

        .social-links a:hover {
            color: var(--color-primary-red);
        }

        .footer-bottom {
            text-align: center;
            margin-top: 30px;
            padding-top: 20px;
            border-top: 1px solid #444;
            font-size: 0.9rem;
            font-weight: 300;
            color: var(--color-text-secondary);
        }

        /* ----- 9. Signup / Login Modal ----- */
        #signup-modal {
            display: none;
            position: fixed;
            z-index: 6000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            overflow: auto;
            background-color: rgba(0, 0, 0, 0.6);
        }

        .modal-content {
            background-color: var(--color-surface);
            margin: 10vh auto;
            padding: 25px;
            border: 1px solid #444;
            width: 90%;
            max-width: 450px;
            border-radius: 8px;
            position: relative;
            box-shadow: 0 5px 20px rgba(0,0,0,0.5);
        }

        .close {
            color: #aaa;
            position: absolute;
            top: 10px;
            right: 20px;
            font-size: 28px;
            font-weight: 300;
            cursor: pointer;
        }

        .close:hover,
        .close:focus {
            color: #fff;
        }

        #form-title {
            text-align: center;
			font-weight: 300;
            font-size: 1.8rem;
            margin-bottom: 20px;
        }

        #error-message {
            color: var(--color-primary-red);
            background-color: rgba(230, 0, 0, 0.1);
            border: 1px solid var(--color-primary-red);
            padding: 10px;
            margin-bottom: 15px;
            border-radius: 5px;
            text-align: center;
            font-weight: 300;
            min-height: 1.5em;
        }
        
        #error-message:empty {
            display: none;
        }

        #signup-form input[type="text"],
        #signup-form input[type="email"],
        #signup-form input[type="password"] {
            width: 100%;
            padding: 12px;
            margin-bottom: 15px;
            background: #1a1a1a;
            border: 1px solid #444;
            color: #fff;
            border-radius: 5px;
			font-weight: 300;
            font-size: 1rem;
        }
        
        #signup-form input[type="email"] {
            text-transform: lowercase;
        }

        #signup-form input[type="text"]:focus,
        #signup-form input[type="email"]:focus,
        #signup-form input[type="password"]:focus {
            outline: none;
            border-color: var(--color-primary-red);
        }
        
        .password-wrapper {
            position: relative;
        }
        
        .toggle-password {
            position: absolute;
            right: 15px;
            top: 50%;
            transform: translateY(-50%);
            margin-top: -7.5px;
            color: #888;
            cursor: pointer;
        }

        #signup-form #submit-btn {
            width: 100%;
            padding: 12px;
            background-color: var(--color-primary-red);
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 1.1rem;
            font-weight: 300;
            transition: background-color 0.3s ease;
        }

        #signup-form #submit-btn:hover {
            background-color: #c00;
        }

        .form-disclaimer {
		    font-weight: 300;
            font-size: 0.8rem;
            color: var(--color-text-secondary);
            margin-top: 15px;
            text-align: center;
        }

        .form-disclaimer a {
            color: var(--color-primary-red);
            font-weight: 300;
        }

        #switch-form {
            text-align: center;
            margin-top: 20px;
            color: var(--color-text-secondary);
            cursor: pointer;
        }

        #switch-form span {
            color: var(--color-primary-red);
            font-weight: 300;
        }

        /* ----- 10. Media Queries ----- */
        @media (max-width: 768px) {
            .logo-img-animated {
                height: 70px;
            }
            
            .hero-content {
                flex-direction: column;
            }
            
            .hero-left {
                flex: 0 0 auto;
                max-width: 250px;
                margin: 0 auto;
            }
            
            .hero-right {
                text-align: left;
            }

            /* NEW: Wrapper for title/logo on mobile */
            .hero-title-wrapper {
                display: flex;
                align-items: center;
                justify-content: space-between; /* Pushes title and logo apart */
                gap: 15px; /* Space between them */
            }
            
            .hero-title {
                font-size: 2rem;
                flex-grow: 1; /* Allows title to take up space */
            }
            
            /* MODIFIED: Mobile logo size and opacity */
            .hero-rating-logo {
                flex-shrink: 0; /* Prevents logo from shrinking */
                margin: 0; /* Removed top margin */
                width: 120px; /* MODIFIED: Was 100px */
                opacity: 1; /* Make it fully visible */
            }
            
            .main-content-container {
                flex-direction: column;
            }
            
            /* MODIFIED: Mobile re-order */
            .sidebar-widget {
                order: 1; /* Sidebar widgets first */
            }
            .chapter-column {
                order: 2; /* Chapters second */
            }
            /* This is the "You might also like" widget */
            .recommendations-widget { 
                 order: 3; /* This widget comes last */
            }
            
            .chapter-item {
                flex-direction: row;
                gap: 15px;
                align-items: flex-start;
            }
            .chapter-thumbnail {
                flex-basis: 120px;
                flex-shrink: 0;
                width: 120px;
            }
            .chapter-thumbnail img {
                image-rendering: -webkit-optimize-contrast;
                image-rendering: crisp-edges;
            }
            .chapter-title {
                font-size: 1.1rem;
            }
            .chapter-stats {
                font-size: 0.8rem;
                gap: 10px;
            }
            
            .recommendations-list {
                grid-template-columns: 1fr 1fr;
            }

            .footer-container {
                grid-template-columns: 1fr;
                text-align: center;
            }
            .footer-logo {
                margin: 0 auto 20px;
            }
            .social-links {
                justify-content: center;
            }
        }