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

:root {
    --primary-color: #4A90E2; /* Modern Blue */
    --primary-dark: #357ABD; /* Darker Blue */
    --secondary-color: #50E3C2; /* Muted Teal */
    --accent-color: #F5A623; /* Vibrant Orange/Yellow */
    --text-primary: #333333; /* Soft Dark Gray */
    --text-secondary: #666666; /* Medium Gray */
    --text-light: #999999; /* Light Gray */
    --bg-primary: #F8F8F8; /* Off-white */
    --bg-secondary: #EEEEEE; /* Very Light Gray */
    --bg-dark: #222222; /* Deep, Soft Black */
    --border-color: #DDDDDD; /* Subtle Light Gray */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 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);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Dark theme variables */
[data-theme="dark"] {
    --text-primary: #E0E0E0; /* Light Gray */
    --text-secondary: #B0B0B0; /* Medium Light Gray */
    --text-light: #808080; /* Muted Light Gray */
    --bg-primary: #1A1A1A; /* Dark Charcoal */
    --bg-secondary: #2C2C2C; /* Slightly Lighter Charcoal */
    --bg-dark: #0D0D0D; /* Even Darker Charcoal */
    --border-color: #444444; /* Dark Gray */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    scroll-behavior: smooth;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

.section {
    padding: 5rem 0;
}

.bg-light {
    background-color: var(--bg-secondary);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: all 0.3s ease;
}

[data-theme="dark"] .navbar {
    background: rgba(17, 24, 39, 0.95);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .navbar.scrolled {
    background: rgba(17, 24, 39, 0.98);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 48px;
    height: 48px;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.nav-logo:hover .logo-icon {
    transform: scale(1.1) rotate(5deg);
    color: var(--secondary-color);
}



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

.theme-toggle {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    margin-left: 1rem;
}

.theme-toggle:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.theme-toggle i {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

[data-theme="dark"] .theme-toggle i::before {
    content: "\f186"; /* fa-moon */
}

.theme-toggle:hover i {
    transform: rotate(180deg);
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    position: relative;
    transition: all 0.3s ease;
    padding: 0.5rem 0;
}

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

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
}

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

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    transition: 0.3s;
    border-radius: 2px;
}

/* Hero Section */
.hero-section {
    padding: 120px 0 80px;
    background: linear-gradient(135deg, #0A0A2A 0%, #2A0A4A 50%, #4A0A6A 100%); /* Galaxy Gradient */
    position: relative;
    overflow: hidden;
    animation: galaxy-flow 30s ease-in-out infinite alternate;
}

[data-theme="dark"] .hero-section {
    background: linear-gradient(135deg, #050515 0%, #150525 50%, #250535 100%); /* Darker Galaxy Gradient */
}

@keyframes galaxy-flow {
    0% {
        background-size: 100% 100%;
        background-position: 0% 0%;
    }
    50% {
        background-size: 120% 120%;
        background-position: 50% 50%;
    }
    100% {
        background-size: 100% 100%;
        background-position: 0% 0%;
    }
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)" /></svg>');
    opacity: 0.3;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-content {
    animation: slideInLeft 0.8s ease-out;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: white;
}

.gradient-text {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    line-height: 1.7;
}

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

.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-color), #ea580c);
    color: white;
    box-shadow: var(--shadow-lg);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Hero Image */
.hero-image {
    position: relative;
    height: 500px;
    animation: slideInRight 0.8s ease-out;
}

.floating-card {
    position: absolute;
    background: var(--bg-primary);
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    animation: float 6s ease-in-out infinite;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-1 {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.card-2 {
    top: 50%;
    right: 20%;
    animation-delay: 2s;
}

.card-3 {
    bottom: 20%;
    left: 20%;
    animation-delay: 4s;
}

.comic-preview h4 {
    margin: 1rem 0 0.5rem;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.comic-cover {
    width: 120px;
    height: 160px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    position: relative;
    overflow: hidden;
}

.cover-2 {
    background: linear-gradient(135deg, #10b981, #059669);
}

.cover-3 {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.comic-cover::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-color);
}

.rating i {
    color: var(--accent-color);
}

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

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* About Section */
.about-content {
    max-width: 1000px;
    margin: 0 auto;
}

.about-text h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.about-text p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.8;
}

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

.feature-item {
    text-align: center;
    padding: 2rem;
    background: var(--bg-primary);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

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

.feature-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 1.5rem;
}

.feature-item h4 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.feature-item p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Help Section */
.help-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    max-width: 1000px;
    margin: 0 auto;
}

.faq-section h3,
.contact-section h3 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.faq-item {
    background: var(--bg-primary);
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.faq-item:hover {
    box-shadow: var(--shadow-md);
}

.faq-question {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: var(--bg-primary);
    transition: background-color 0.3s ease;
}

.faq-question:hover {
    background: var(--bg-secondary);
}

.faq-question h4 {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.faq-question i {
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
}

.faq-item.active .faq-answer {
    padding: 1.5rem;
    max-height: 200px;
}

.faq-answer p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.contact-section {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    height: fit-content;
}

.contact-section p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
}

.contact-item i {
    color: var(--primary-color);
    width: 20px;
    text-align: center;
}

/* Legal Content */
.legal-content {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

.legal-content h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin: 2rem 0 1rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.legal-content p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.legal-content ul {
    margin: 1rem 0 1rem 2rem;
}

.legal-content li {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* Footer */
.footer {
    background: var(--bg-dark);
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-section h4 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: white;
}

.footer-section p {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.footer-section ul {
    list-style: none;
}

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

.footer-section a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

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

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

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

/* Animations */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

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

/* Scroll animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.animate-on-scroll.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: white;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow-lg);
        padding: 2rem 0;
        gap: 1rem;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active .bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .nav-toggle.active .bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-image {
        height: 300px;
    }

    .floating-card {
        padding: 1rem;
    }

    .comic-cover {
        width: 80px;
        height: 100px;
    }

    .section-title {
        font-size: 2rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .help-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-buttons {
        justify-content: center;
    }

    .btn {
        flex: 1;
        justify-content: center;
        min-width: 200px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .section {
        padding: 3rem 0;
    }

    .btn {
        min-width: auto;
        width: 100%;
    }

    .hero-buttons {
        flex-direction: column;
    }
}

.floating-card {
    position: absolute;
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    animation: float 6s ease-in-out infinite;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
    width: 120px; /* Consistent width for comic covers */
    height: 160px; /* Consistent height for comic covers */
    overflow: hidden; /* Ensure content stays within rounded corners */
    display: flex; /* For centering content */
    align-items: center; /* For centering content */
    justify-content: center; /* For centering content */
}

.comic-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px; /* Apply border-radius here */
    opacity: 0; /* Initially hidden */
    transition: opacity 0.3s ease;
    position: relative;
    z-index: 1;
}

.image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-secondary); /* Use a background color from the theme */
    border-radius: 8px; /* Match image border-radius */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-light);
    z-index: 2; /* Ensure it's above the image initially */
    transition: opacity 0.3s ease;
}

.image-placeholder::after {
    content: '';
    border: 4px solid var(--primary-color);
    border-top: 4px solid transparent;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

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

/* When image is loaded, hide placeholder and show image */
.comic-image.loaded {
    opacity: 1;
    z-index: 3;
}

.comic-image.loaded + .image-placeholder {
    opacity: 0;
    pointer-events: none; /* Allow clicks to pass through */
    z-index: 0;
}
