body {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

#comics {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px 0;
}

.comic-item {
    display: flex;
    flex-direction: row;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    align-items: flex-start;
}

.comic-item:hover {
    transform: translateY(-5px);
}

.image-container {
    width: 180px;
    height: 270px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    overflow: hidden;
    flex-shrink: 0;
}

.comic-item img {
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
}

.comic-item:hover img {
    transform: scale(1.05);
}

.comic-info {
    padding: 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    position: relative;
}

.comic-info a {
    text-decoration: none;
    color: #333;
}

.comic-info p {
    margin: 0;
    font-size: 14px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    word-break: break-all;
}

#title {
    font-size: 16px;
    font-weight: bold;
    color: #000;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    padding: 20px;
}

.pagination button {
    padding: 8px 16px;
    border: none;
    background: #007bff;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.pagination button:hover {
    background: #0056b3;
}

.pagination button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.error-message {
    text-align: center;
    color: #dc3545;
    padding: 20px;
    font-size: 18px;
}

/* Header Styles */
.site-header {
    background-color: #333;
    padding: 1rem 0;
    margin-bottom: 0.5rem;
}

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

.nav-left {
    display: flex;
    gap: 1rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.nav-link:hover {
    background-color: #555;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-id {
    color: white;
    font-size: 14px;
}

.login-btn {
    padding: 8px 16px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.login-btn:hover {
    background-color: #0056b3;
}

.login-btn.logout-btn {
    background-color: #dc3545;
}

.login-btn.logout-btn:hover {
    background-color: #c82333;
}

/* Footer Styles */
.site-footer {
    background-color: #333;
    color: white;
    padding: 1rem 0;
    margin-top: 2rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

/* Main Content */
.content-wrapper {
    min-height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
}

.content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    flex: 1;
    width: 100%;
}

/* Search Styles */
.search-container {
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 20px;
    position: relative;
}

.search-form {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 20px;
    width: 100%;
    position: relative;
}

.autocomplete-container {
    position: relative;
    flex: 1;
    min-width: 0;
}

.tag-input {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.tag-input:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.search-button {
    padding: 12px 24px;
    font-size: 16px;
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.search-button:hover {
    background-color: #357abd;
}

.tag-link {
    color: #007bff;
    text-decoration: none;
    margin-right: 5px;
}

.tag-link:hover {
    text-decoration: underline;
}

/* Autocomplete Styles */
.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background: white;
    border: 2px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    display: none;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-top: -2px;
}

.autocomplete-item {
    padding: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.autocomplete-item:hover {
    background-color: #f5f5f5;
}

.highlight {
    background-color: #e3f2fd;
    font-weight: bold;
}

/* Responsive Styles */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .content-wrapper {
        min-height: calc(100vh - 100px);
    }

    .content {
        padding: 0 10px;
    }

    .comic-item {
        flex-direction: column;
        align-items: center;
    }

    .image-container {
        width: 100%;
        height: auto;
        max-width: 200px;
        aspect-ratio: 2/3;
    }

    .comic-info {
        width: 100%;
        text-align: center;
        padding: 10px;
    }

    .search-container {
        padding: 10px;
        max-width: 100%;
    }

    .search-form {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .autocomplete-container {
        width: 100%;
    }

    .tag-input {
        width: 100%;
        font-size: 16px;
        padding: 12px;
        min-width: 280px;
        box-sizing: border-box;
    }

    .search-button {
        width: 100%;
        padding: 12px;
        font-size: 16px;
        box-sizing: border-box;
    }

    .pagination {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }

    .pagination button {
        width: 100%;
    }

    .nav-container {
        flex-direction: column;
        gap: 5px;
        padding: 10px;
    }

    .nav-link {
        text-align: center;
        padding: 8px;
    }

    .footer-content {
        padding: 10px;
    }

    .comic-info p {
        white-space: normal;
        word-break: break-all;
        text-align: left;
    }

    .autocomplete-results {
        max-height: 250px;
    }

    .autocomplete-item {
        padding: 10px;
        font-size: 14px;
    }

    .viewer-container {
        height: calc(100vh - 60px);
        margin-top: 60px;
    }

    .viewer-container img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .viewer-controls {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(0, 0, 0, 0.8);
        padding: 10px;
        z-index: 1000;
    }
}

@media (max-width: 480px) {
    .image-container {
        max-width: 150px;
    }

    .comic-info p {
        font-size: 12px;
    }

    #title {
        font-size: 14px;
    }

    .search-container {
        padding: 5px;
    }

    .tag-input {
        font-size: 14px;
        padding: 10px;
        min-width: 240px;
    }

    .search-button {
        padding: 10px;
        font-size: 14px;
    }
}

.blacklist-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    text-align: center;
    padding: 10px;
}

.image-container {
    position: relative;
}

/* Keywords Section Styles */
.keywords-section {
    margin-top: 30px;
    padding: 20px;
}

.sort-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
    align-items: center;
    position: relative;
}

.sort-group {
    display: flex;
    gap: 10px;
}

.sort-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sort-btn:hover {
    background-color: #f0f0f0;
}

.sort-btn.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.period-select {
    position: absolute;
    right: 0;
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    min-width: 120px;
}

.period-select:hover {
    background-color: #f0f0f0;
}

.period-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.keywords-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.keyword-item {
    padding: 8px 15px;
    background-color: #f0f0f0;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s;
}

.keyword-item:hover {
    background-color: #e0e0e0;
}

.delete-keyword {
    color: #ff4444;
    cursor: pointer;
    font-size: 14px;
    transition: color 0.3s;
}

.delete-keyword:hover {
    color: #cc0000;
}

@media (max-width: 768px) {
    .keywords-section {
        padding: 10px;
    }

    .sort-btn {
        padding: 6px 12px;
        font-size: 14px;
    }

    .keyword-item {
        padding: 6px 12px;
        font-size: 14px;
    }
}

.bookmark-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 6px 12px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 14px;
}

.bookmark-btn:hover {
    background-color: #0056b3;
}

.bookmark-btn.bookmarked {
    background-color: #0056b3;
}

.comic-cover {
    position: relative;
}

#bookmarkMode.active {
    background-color: #ff6b6b;
    color: white;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    width: 300px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.modal-body {
    margin-bottom: 20px;
}

.modal-body input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
    box-sizing: border-box;
}

.modal-footer {
    text-align: right;
}

.modal-footer button {
    padding: 8px 16px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.modal-footer button:hover {
    background-color: #0056b3;
}

.page-form {
    display: flex;
    align-items: center;
    gap: 3px;
}

.page-input {
    width: 45px;
    padding: 4px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}

.page-go-btn {
    padding: 4px 8px;
    border: none;
    background: #007bff;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 12px;
}

.page-go-btn:hover {
    background: #0056b3;
} 