/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--dark-blue);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Stars Container */
.stars-container {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
    transform: translate(-50%, -50%);
}

.stars-container canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Comics Container */
.comics-container {
    min-height: calc(100vh - var(--header-height));
    padding-top: var(--header-height);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* Comics Grid */
.comics-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem; /* Space between cards */
    padding: 1rem; /* Space from edges */
    width: 100%;
    max-width: calc(3 * 350px + 2 * 2rem + 4rem); /* Fits exactly 3 cards (3 * 350px + 2 gaps + padding) */
    margin: 0 auto;
}

/* Comic Card */
.comic-card {
    flex: 0 0 350px;
    background: var(--dark-blue);
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.comic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Thumbnail */
.comic-thumbnail {
    position: relative;
    padding-top: 140%;
    overflow: hidden;
    background: var(--dark-blue);
}

.comic-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Overlay */
.comic-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(12, 22, 36, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.comic-card:hover .comic-overlay {
    opacity: 1;
}

.comic-card:hover .comic-thumbnail img {
    transform: scale(1.05);
}

/* Read Button */
.read-button {
    color: var(--light-gray);
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    border: 2px solid var(--light-gray);
    border-radius: 25px;
    font-family: 'Rubik', sans-serif;
    font-weight: 500;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
}

.read-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* Genre Tags */
.genre-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0 1rem;
}

.genre-tag {
    color: var(--light-gray);
    font-size: 0.9rem;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.08);
    font-family: 'Chivo', sans-serif;
}

/* Comic Info */
.comic-info {
    padding: 1.5rem;
    text-align: center;
    background: rgba(240, 241, 242, 0.95);
    border-radius: 0 0 15px 15px;
}

.comic-info h2 {
    color: var(--dark-blue);
    font-family: 'Rubik', sans-serif;
    font-size: 1.25rem;
    margin: 0;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .comics-container {
        padding-top: 20px;
        height: calc(100vh - 10px);
        overflow: hidden;
    }

    .comics-grid {
        padding: 0;
        margin: 0;
        height: 100%;
        position: relative;
        overflow: hidden;
    }

    .comic-card {
        position: absolute;
        width: 85vw;
        max-width: 500px;
        left: 50%;
        top: 45%;
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
        pointer-events: none;
        transition: all 0.5s ease;
    }

    .comic-card.active {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
        pointer-events: auto;
        z-index: 2;
    }

    .comic-card.previous {
        opacity: 0.3;
        transform: translate(-150%, -50%) scale(0.8);
    }

    .comic-card.next {
        opacity: 0.3;
        transform: translate(50%, -50%) scale(0.8);
    }

    .comic-thumbnail {
        height: 60vh;
        padding-top: 0;
        border-radius: 10px 10px 0 0;
    }

    .comic-overlay {
        opacity: 1;
        background: rgba(12, 22, 36, 0.5);
    }

    /* Carousel Indicators */
    .carousel-indicators {
        position: fixed;
        bottom: 2rem;
        left: 0;
        right: 0;
        display: flex;
        justify-content: center;
        gap: 0.5rem;
        z-index: 3;
    }

    .indicator {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: rgba(240, 241, 242, 0.3);
        transition: all 0.3s ease;
    }

    .indicator.active {
        background: var(--light-gray);
        transform: scale(1.2);
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .comic-card {
        width: 95vw;
        height: 80vh;
    }

    .read-button {
        font-size: 1.1rem;
        padding: 0.8rem 1.8rem;
    }

    .genre-tag {
        font-size: 0.9rem;
        padding: 0.3rem 0.8rem;
    }

    .comic-info h2 {
        font-size: 1.3rem;
    }
}

/* Responsive adjustments for very wide screens */
@media (min-width: 1400px) {
    .comics-grid {
        gap: 3rem;
    }
}

/* Responsive adjustments for smaller desktop screens */
@media (max-width: 1200px) {
    .comic-card {
        flex: 0 0 300px;
    }
    
    .comics-grid {
        max-width: calc(3 * 300px + 2 * 2rem + 4rem); /* Fits exactly 3 cards at 300px each */
    }
}

/* Header Mobile Styles */
@media (max-width: 768px) {
    .main-header {
        padding: 0.5rem 0;
    }

    .nav-links {
        gap: 1rem;
    }

    .nav-links a {
        font-size: 0.9rem;
    }

    .logo-container {
        width: 80px;
        height: 100px;
    }
}

/* Ensure touch targets are large enough on mobile */
@media (hover: none) {
    .read-button {
        padding: 0.8rem 1.5rem;
    }

    .genre-tags {
        gap: 0.8rem;
    }
}

/* Add to ensure header stays on top */
.main-header {
    z-index: 10;
    position: relative;
} 
/* Add to comics.css */

/* Button Group */
.button-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    align-items: center;
}

.summary-button {
    color: var(--light-gray);
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    border: 2px solid var(--light-gray);
    border-radius: 25px;
    font-family: 'Rubik', sans-serif;
    font-weight: 500;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    width: 100%;
    max-width: 200px;
}

.summary-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* Comic Summary */
.comic-summary {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(12, 22, 36, 0.9);
    backdrop-filter: blur(2px);
    color: var(--light-gray);
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.comic-card.show-summary .comic-summary {
    opacity: 1;
    visibility: visible;
}

.summary-content {
    max-height: 90%;
    overflow-y: auto;
    text-align: center;
}

.summary-content p {
    margin-bottom: 2rem;
    line-height: 1.6;
    font-family: 'Chivo', sans-serif;
}

/* Audio Controls */
.audio-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.audio-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--light-gray);
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--light-gray);
    border-radius: 25px;
    padding: 0.6rem 1.2rem;
    font-family: 'Rubik', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    justify-content: center;
}

.audio-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.audio-button.playing {
    background: rgba(255, 255, 255, 0.25);
    border-color: #3179d6;
}

.audio-icon {
    font-size: 0.9rem;
    display: inline-block;
    min-width: 1rem;
}

.audio-label {
    font-size: 0.9rem;
}

.close-summary {
    color: var(--light-gray);
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--light-gray);
    border-radius: 25px;
    padding: 0.6rem 1.2rem;
    font-family: 'Rubik', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-summary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Adjust comic card for summary view */
.comic-card.show-summary {
    transform: none !important;
    z-index: 3;
}

.comic-card.show-summary .comic-thumbnail img {
    transform: none;
}

.comic-card.show-summary .comic-overlay {
    opacity: 0;
    pointer-events: none;
}

.comic-card.show-summary .comic-info {
    opacity: 0;
}

@media (max-width: 768px) {
    .comic-card.show-summary {
        transform: translate(-50%, -50%) scale(1) !important;
        height: auto;
        min-height: 80vh;
    }
    
    .comic-summary {
        padding: 1.5rem;
    }
    
    .summary-content {
        max-height: 80vh;
    }
}
/* Add these styles to your existing CSS */

/* Make summary content scrollable */
.summary-content {
    max-height: 90%;
    overflow-y: auto;
    text-align: center;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    padding: 0 0.5rem; /* Add some padding for better scrolling experience */
}

/* Prevent touch events on summary from affecting card */
.comic-card.show-summary {
    pointer-events: auto;
}

/* Ensure summary content receives touch events */
.comic-card.show-summary .summary-content {
    pointer-events: auto;
    position: relative;
    z-index: 10;
}

/* Make sure the close button is visible and clickable */
.close-summary {
    margin-top: 1rem;
    position: relative;
    z-index: 11;
    display: inline-block;
}

/* Improve scrolling area for mobile */
@media (max-width: 768px) {
    .comic-summary {
        padding: 1.5rem;
        overflow: hidden;
    }
    
    .summary-content {
        max-height: 70vh;
        padding-bottom: 2rem;
    }
    
    .audio-controls {
        gap: 0.8rem;
        margin-bottom: 1.5rem;
    }
    
    .audio-button {
        padding: 0.5rem 1rem;
        min-width: 100px;
        font-size: 0.85rem;
    }
    
    .audio-icon {
        font-size: 0.8rem;
    }
    
    .audio-label {
        font-size: 0.85rem;
    }
}
