/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4f46e5;
    --primary-light: #6366f1;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-gradient);
    min-height: 100vh;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.header {
    background: url(./assets/img/desktop%20top%20bg.png) repeat center center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 2px solid #0000ff; 
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Banner Slider */
.banner-slider {
    margin: 20px 0;
    display: flex;
    justify-content: center;
}

/* Top Banner (Header) */
.banner-top .banner-container {
    position: relative;
    width: 1280px;
    height: 300px;
    max-width: 100%;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    background: #f8f9fa;
}

/* Bottom Banner */
.banner-bottom {
    margin: 40px 0 20px 0;
}

.banner-bottom .banner-container {
    position: relative;
    width: 1280px;
    height: 160px;
    max-width: 100%;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    background: #f8f9fa;
}

.banner-slides {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    height: 100%;
}

.banner-slide {
    min-width: 100%;
    height: 100%;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    justify-content: center;
}

.banner-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.banner-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    padding: 40px 30px 20px;
    text-align: left;
}

.banner-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.banner-description {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 15px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.banner-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.banner-cta:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    text-decoration: none;
    color: white;
}

.banner-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
}

.banner-btn {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-size: 1.2rem;
}

.banner-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.banner-btn:active {
    transform: scale(0.95);
}



/* Bottom Banner Content Adjustments */
.banner-bottom .banner-title {
    font-size: 1.5rem;
    margin-bottom: 6px;
}

.banner-bottom .banner-description {
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.banner-bottom .banner-content {
    padding: 20px 30px 15px;
}

.banner-bottom .banner-cta {
    padding: 8px 16px;
    font-size: 0.9rem;
}



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

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.logo img {
    width: 120px;
    padding: 8px 0;
}

.search-container {
    position: relative;
    min-width: 300px;
}

.search-input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
    pointer-events: none;
}

.search-input-group .form-field {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #0000ff;
    border-radius: 25px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.1);
    color: #0000ff;
    transition: all 0.3s ease;
    width: 100%;
}

.search-input-group select.form-field {
    width: 200px;
    color: #0000ff;
}

.filter-container {
    position: relative;
}

.category-filter {
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.category-filter:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.2);
}

.category-filter option {
    background: #2c3e50;
    color: white;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
}

.refresh-btn {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.refresh-btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.refresh-btn:active {
    transform: translateY(0);
}

.refresh-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.refresh-btn.loading i {
    animation: spin 1s linear infinite;
}

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

/* Main content */
.main {
    padding: 0.5rem 0;
    min-height: calc(100vh - 180px);
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Comics grid */
.comics-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
    margin-bottom: 3rem;
}

.comic-card {
    background: transparent;
    overflow: hidden;
    /* box-shadow: var(--card-shadow); */
    transition: var(--transition);
    cursor: pointer;
    /* border: 1px solid rgba(229, 231, 235, 0.5); */
    border-radius: 12px;
}

.comic-card:hover {
    transform: translateY(-4px);
    /* box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1); */
}

.comic-cover {
    width: 100%;
    border-radius: 16px;
    height: 280px;
    object-fit: cover;
    background: transparent;
}

.comic-info {
    padding: 0;
}

.comic-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.comic-author {
    display: none;
    color: var(--primary-color);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.comic-meta {
    display: none;
    /* display: flex; */
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.comic-category {
    background: #f3f4f6;
    padding: 0.2rem 0.4rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 3rem;
}

.pagination-btn {
    padding: 0.75rem 1.5rem;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 9999px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.pagination-btn:hover:not(:disabled) {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-pages {
    display: flex;
    gap: 0.5rem;
}

.page-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 9999px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    transition: var(--transition);
    color: var(--text-primary);
}

.page-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.page-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-ellipsis {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--text-secondary);
    font-weight: 500;
}

.page-jump {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-left: 1px solid #e5e7eb;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Desktop pagination navigation controls */
.pagination-nav-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
    animation: modalFadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

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

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: #f3f4f6;
    color: var(--text-primary);
}

.modal-body {
    padding: 2rem;
}

.modal-cover {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.comic-details {
    color: var(--text-secondary);
}

.comic-details p {
    margin-bottom: 0.75rem;
}

.comic-details strong {
    color: var(--text-primary);
    font-weight: 600;
}

.btn {
    padding: 0.875rem 1.75rem;
    border-radius: 9999px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-light);
}

.modal-actions {
    margin-top: 2rem;
}

/* Chapter selection */
.chapter-selection {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.chapter-selection h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.chapter-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f8f9fa;
}

.loading-chapters {
    padding: 1rem;
    text-align: center;
    color: var(--text-secondary);
}

.chapter-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chapter-item:last-child {
    border-bottom: none;
}

.chapter-item:hover {
    background-color: #e3f2fd;
}

.chapter-item.selected {
    background-color: var(--primary-color);
    color: white;
}

.chapter-item.selected:hover {
    background-color: var(--primary-light);
}

.chapter-title {
    font-weight: 500;
}

.chapter-pages {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.chapter-item.selected .chapter-pages {
    color: rgba(255, 255, 255, 0.8);
}

/* Loading */
.loading {
    text-align: center;
    padding: 4rem 2rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Footer */
.footer {
    background: white;
    border-top: 1px solid rgba(229, 231, 235, 0.5);
    padding: 2rem 0;
    text-align: center;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 1200px) {
    .comics-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

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

    .header-content {
        flex-direction: row;
        gap: 1rem;
        padding: 1rem 0;
    }

    /* Fix pagination to match image layout */
    .pagination {
        flex-direction: column;
        gap: 1rem;
        justify-content: center;
        align-items: center;
    }

    /* Navigation controls wrapper */
    .pagination-nav-controls {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 1rem;
        flex-wrap: wrap;
    }

    /* Mobile Banner Slider */
    .banner-top .banner-container {
        width: 100%;
        max-width: 600px;
        height: auto;
        border-radius: 8px;
    }

    .banner-bottom .banner-container {
        width: 100%;
        max-width: 600px;
        height: auto;
        border-radius: 6px;
    }

    .banner-title {
        font-size: 1.4rem;
    }

    .banner-description {
        font-size: 0.9rem;
    }

    .banner-content {
        padding: 20px 15px 15px;
    }

    /* Smaller content for bottom banner on mobile */
    .banner-bottom .banner-title {
        font-size: 1.1rem;
        margin-bottom: 4px;
    }

    .banner-bottom .banner-description {
        font-size: 0.8rem;
        margin-bottom: 8px;
    }

    .banner-bottom .banner-content {
        padding: 10px 15px 8px;
    }

    .banner-bottom .banner-cta {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .banner-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .banner-nav {
        padding: 0 10px;
    }

    /* Ensure banner images are responsive */
    .banner-slide img {
        width: 100%;
        height: auto;
        max-height: 100%;
        object-fit: cover;
    }

    /* Mobile-specific banner adjustments */
    .banner-top {
        margin: 10px 0;
    }

    .banner-bottom {
        margin: 10px 0;
    }



    .logo {
        font-size: 1.5rem;
        text-align: center;
    }

    .header-controls {
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 0.75rem;
        flex: 1;
    }

    .search-container {
        min-width: 280px;
        flex: 1;
        max-width: 100%;
    }

    .search-input {
        padding: 0.875rem 1rem;
        font-size: 1rem;
    }

    .filter-container {
        min-width: 140px;
    }

    .category-filter {
        padding: 0.875rem 1rem;
        font-size: 1rem;
    }

    .btn {
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    .refresh-btn {
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 2rem;
        text-align: center;
    }

    .section-title {
        font-size: 1.75rem;
        width: 100%;
    }

    .pagination-info {
        width: 100%;
        text-align: center;
        font-size: 0.9rem;
    }

    .comics-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .comic-card {
        border-radius: 12px;
    }

    .comic-cover {
        height: 200px;
    }

    .comic-info {
        padding: 0rem;
    }

    .comic-title {
        font-size: 1rem;
        line-height: 1.3;
    }

    .comic-author {
        font-size: 0.85rem;
        margin-bottom: 0.75rem;
    }

    .comic-meta {
        font-size: 0.8rem;
    }

    .comic-category {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }

    .pagination {
        flex-direction: column;
        gap: 1.5rem;
        margin-top: 2rem;
    }

    .pagination-pages {
        order: -1;
        gap: 0.375rem;
        flex-wrap: wrap;
        justify-content: center;
        margin-bottom: 0.5rem;
    }

    .pagination-btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
        width: auto;
    }

    .page-btn {
        width: 44px;
        height: 44px;
        font-size: 0.9rem;
    }
    
    .page-jump {
        margin: 0;
        padding: 0;
        border-left: none;
        font-size: 0.85rem;
        flex-direction: row;
        gap: 0.5rem;
        align-items: center;
        border-top: none;
    }

    /* Hide "Go to" text on mobile */
    .page-jump span {
        display: none;
    }
    
    .page-jump input {
        width: 80px !important;
        padding: 0.75rem !important;
        font-size: 1rem !important;
        text-align: center;
    }

    .page-jump button {
        padding: 0.75rem 1.5rem !important;
        font-size: 0.9rem !important;
    }

    /* Modal improvements */
    .modal-content {
        width: 95%;
        margin: 1rem;
        max-height: 90vh;
        border-radius: 16px;
    }

    .modal-header {
        padding: 1rem 1.5rem;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .modal-close {
        width: 36px;
        height: 36px;
        font-size: 1.25rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .comic-info {
        flex-direction: column;
        text-align: center;
    }

    .modal-cover {
        max-width: 200px;
        margin: 0 auto 1rem;
    }

    .comic-details {
        width: 100%;
    }

    .comic-details p {
        margin-bottom: 0.5rem;
        font-size: 0.9rem;
    }

    .chapter-selection h4 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    .chapter-list {
        max-height: 150px;
    }

    .chapter-item {
        padding: 0.875rem 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .chapter-title {
        font-size: 0.9rem;
    }

    .chapter-pages {
        font-size: 0.8rem;
    }

    .modal-actions {
        margin-top: 1.5rem;
        text-align: center;
    }

    .btn-primary {
        width: 100%;
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
}

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

    .header-content {
        padding: 0.75rem 0;
        gap: 0.75rem;
    }

    .logo {
        font-size: 1.25rem;
    }

    .header-controls {
        gap: 0.5rem;
    }

    .search-container {
        min-width: 240px;
    }

    .search-input {
        padding: 0.75rem 0.875rem;
        font-size: 0.9rem;
    }

    .filter-container {
        min-width: 120px;
    }

    .category-filter {
        padding: 0.75rem 0.875rem;
        font-size: 0.9rem;
    }

    .btn {
        padding: 0.75rem 0.875rem;
        font-size: 0.85rem;
    }

    .refresh-btn {
        padding: 0.75rem 0.875rem;
        font-size: 0.85rem;
    }

    .content-header {
        margin-bottom: 1.5rem;
        gap: 0.75rem;
    }

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

    .pagination-info {
        font-size: 0.85rem;
    }

    .comics-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .comic-card {
        max-width: 100%;
        border-radius: 10px;
    }

    .comic-cover {
        height: 200px;
        border-radius: 8px;
    }

    .comic-info {
        padding: 0;
    }

    .comic-title {
        font-size: 0.95rem;
    }

    .comic-author {
        font-size: 0.8rem;
    }

    .comic-meta {
        font-size: 0.75rem;
    }

    .pagination {
        gap: 1rem;
        margin-top: 1.5rem;
    }

    .pagination-btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.85rem;
    }

    .page-btn {
        width: 40px;
        height: 40px;
        font-size: 0.85rem;
    }

    .page-jump {
        padding-top: 0.75rem;
        margin-top: 0.75rem;
    }

    .page-jump input {
        width: 70px !important;
        padding: 0.625rem !important;
        font-size: 0.9rem !important;
    }

    .page-jump button {
        padding: 0.625rem 1.25rem !important;
        font-size: 0.85rem !important;
    }

    /* Modal improvements for very small screens */
    .modal-content {
        width: 98%;
        margin: 0.5rem;
        border-radius: 12px;
    }

    .modal-header {
        padding: 0.875rem 1rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-cover {
        max-width: 160px;
    }

    .comic-details p {
        font-size: 0.85rem;
    }

    .chapter-list {
        max-height: 120px;
    }

    .chapter-item {
        padding: 0.75rem 0.875rem;
    }

    .chapter-title {
        font-size: 0.85rem;
    }

    .chapter-pages {
        font-size: 0.75rem;
    }

    .btn-primary {
        padding: 0.875rem 1.25rem;
        font-size: 0.9rem;
    }
}

/* Touch-friendly improvements for main page */
@media (hover: none) and (pointer: coarse) {
    .comic-card {
        touch-action: manipulation;
    }

    .btn,
    .pagination-btn,
    .page-btn,
    .search-input,
    .category-filter {
        min-height: 44px;
        touch-action: manipulation;
    }

    .modal-close,
    .chapter-item {
        min-height: 44px;
        touch-action: manipulation;
    }

    /* Prevent text selection on touch */
    .header,
    .pagination,
    .modal-header {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }

    /* Smooth scrolling */
    .comics-grid,
    .chapter-list {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
}

/* Utilities */
.text-center {
    text-align: center;
}

.hidden {
    display: none !important;
}

/* Comic Detail Page Styles */
.detail-page {
    min-height: 100vh;
    background: #f8f9fa;
}

.detail-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
}

.detail-content {
    max-width: 800px;
    margin: -3rem auto 0;
    padding: 0 1rem 3rem;
}

.detail-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
}

.detail-hero {
    display: flex;
    gap: 2rem;
    padding: 2rem;
    align-items: flex-start;
}

.detail-cover {
    width: 200px;
    height: 280px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.detail-info {
    flex: 1;
}

.detail-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1f2937;
    line-height: 1.3;
}

.detail-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.meta-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.meta-value {
    font-size: 1rem;
    color: #1f2937;
    font-weight: 600;
}

.chapter-section {
    border-top: 1px solid #e5e7eb;
    padding: 2rem;
}

.chapter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.chapter-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
}

.chapter-count {
    background: #e0e7ff;
    color: #3730a3;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.chapter-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chapter-item:hover {
    background: #e0e7ff;
    border-color: #c7d2fe;
    transform: translateY(-2px);
}

.chapter-item.selected {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.chapter-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.chapter-pages {
    font-size: 0.8rem;
    color: #6b7280;
}

.chapter-item.selected .chapter-pages {
    color: rgba(255, 255, 255, 0.8);
}

.action-buttons {
    padding: 2rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 1rem;
}

.btn-read {
    flex: 1;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-read:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-read:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    text-decoration: none;
    margin-bottom: 1rem;
    transition: opacity 0.2s;
    font-weight: 500;
}

.back-link:hover {
    opacity: 0.8;
}

/* Mobile responsive for detail page */
@media (max-width: 768px) {
    .detail-content {
        margin-top: -2rem;
        padding: 0 1rem 2rem;
    }

    .detail-hero {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }

    .detail-cover {
        width: 160px;
        height: 224px;
        margin: 0 auto;
    }

    .detail-title {
        font-size: 1.25rem;
    }

    .detail-meta {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .chapter-section {
        padding: 1.5rem;
    }

    .chapter-grid {
        grid-template-columns: 1fr;
        max-height: 300px;
    }

    .action-buttons {
        padding: 1.5rem;
    }
} 