/* Comic App Styles */

/* Comic Section on Home Page */
.latest-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2em;
    margin: 2em 0;
}

.latest-content-grid > * {
    height: 100%;
}

.latest-comic-section,
.latest-blog-post {
    padding: 1.5em;
    background: var(--tile-background);
    border-radius: 12px;
    box-shadow: 0 5px 5px rgba(0, 0, 0, 0.5);
    height: fit-content;
}

/* Responsive grid */
@media (max-width: 768px) {
    .latest-content-grid {
        grid-template-columns: 1fr;
        gap: 1em;
    }
}

.latest-comic-section h2,
.latest-blog-post h2 {
    margin-top: 0;
    color: var(--text-color);
    text-align: center;
}

.comic-frame-wrapper {
    display: flex;
    justify-content: center;
    margin: 1em 0;
}

.comic-section-footer {
    text-align: center;
    margin-top: 1em;
}

.comic-section-footer a {
    color: var(--link-default);
    text-decoration: none;
    font-weight: bold;
}

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

.comic-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.comic-page-detail {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.comic-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 5px;
}

.comic-navigation.bottom {
    margin-top: 30px;
}

.nav-btn {
    padding: 8px 16px;
    text-decoration: none;
    background: var(--accent-color);
    color: white;
    border-radius: 4px;
    transition: background 0.3s;
}

.nav-btn:hover {
    background: var(--link-hover);
    color: white;
}

.home-btn {
    background: #6c757d;
}

.home-btn:hover {
    background: #545b62;
}

.page-info {
    font-weight: bold;
    color: #666;
}

.comic-image {
    text-align: center;
    margin: 20px 0;
}

.comic-img {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.comic-info {
    margin: 20px 0;
    text-align: center;
}

.comic-description {
    color: #666;
    font-style: italic;
}

/* Comic Frame Styles */
.comic-frame {
    border: 2px solid var(--tile-background);
    border-radius: 8px;
    background: var(--tile-background);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin: 0 auto;
}

/* Size variants */
.comic-frame.size-small {
    max-width: 100%;
    width: 100%;
}

.comic-frame.size-medium {
    max-width: 500px;
}

.comic-frame.size-large {
    max-width: 700px;
}

.comic-frame.size-full {
    max-width: 100%;
    width: 100%;
}

.comic-navigation-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--tile-background);
    gap: 20px;
}

.nav-left, .nav-right {
    flex: 0 0 auto;
    min-width: 60px;
}

.nav-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.nav-btn {
    display: inline-flex;
    flex-direction: column; /* So the image is on top of the text */
    align-items: center;
    justify-content: center;
    padding: 0px;
    border-radius: 6px;
    transition: all 0.2s;
    text-decoration: none;
    background: var(--accent-color);
    color: white;
    min-width: 98px;
    min-height: 98px;
    position: relative;
}

.nav-btn:not(.disabled):hover {
    transform: scale(1.1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    background: var(--link-hover);
}

.nav-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #6c757d;
}

.nav-icon {
    width: 98px;
    height: 98px;
    display: block;
    border: none;
    outline: none;
}

/* Navigation icon states */
.nav-icon-activated {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    transition: opacity 0.2s ease;
}

.nav-icon-deactivated {
    opacity: 1;
    transition: opacity 0.2s ease;
}

.nav-btn:hover .nav-icon-activated {
    opacity: 1;
}

.nav-btn:hover .nav-icon-deactivated {
    opacity: 0;
}

/* Override hover effects for disabled buttons */
.nav-btn.disabled:hover .nav-icon-activated {
    opacity: 0 !important;
}

.nav-btn.disabled:hover .nav-icon-deactivated {
    opacity: 1 !important;
}

/* Rotate navigation button images to point in correct directions */
.nav-left .nav-icon {
    transform: rotate(-90deg);
}

.nav-right .nav-icon {
    transform: rotate(90deg);
}

.nav-label {
    display: block;
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: bold;
    color: var(--background-color);
    text-align: center;
    position: relative;
    z-index: 1;
}

.page-selector select {
    padding: 6px 12px;
    border: 1px solid var(--tile-background);
    border-radius: 4px;
    background: var(--tile-background);
    color: var(--text-color);
    font-size: 14px;
    min-width: 120px;
}

.page-info {
    text-align: center;
}

.page-number {
    font-weight: bold;
    color: var(--text-color);
    font-size: 16px;
}

.page-title {
    display: block;
    color: var(--text-color);
    font-size: 28px;
    margin-top: 2px;
    opacity: 0.8;
}

.comic-display {
    padding: 20px;
    text-align: center;
}

.comic-image-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.comic-image {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: filter 0.3s ease;
}

/* NSFW Blur Effects */
.nsfw-blurred {
    filter: blur(20px);
}

.nsfw-blur-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    z-index: 10;
}

.nsfw-warning-content {
    text-align: center;
    color: white;
    padding: 20px;
    max-width: 300px;
}

.nsfw-warning-content h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.nsfw-warning-content p {
    margin: 0 0 20px 0;
    opacity: 0.9;
}

.nsfw-acknowledge-btn {
    background: #ffc107;
    color: #000;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.nsfw-acknowledge-btn:hover {
    background: #e0a800;
}

.comic-description {
    margin-top: 15px;
    padding: 15px;
    background: var(--sidebar-bg);
    border-radius: 4px;
    color: var(--text-color);
    text-align: left;
    line-height: 1.6;
}

.comic-description h1, .comic-description h2, .comic-description h3,
.comic-description h4, .comic-description h5, .comic-description h6 {
    color: var(--text-color);
    margin-top: 1em;
    margin-bottom: 0.5em;
}

.comic-description p {
    margin-bottom: 1em;
}

.comic-description ul, .comic-description ol {
    margin-bottom: 1em;
    padding-left: 2em;
}

.comic-description blockquote {
    border-left: 4px solid var(--link-default);
    padding-left: 1em;
    margin: 1em 0;
    font-style: italic;
    opacity: 0.8;
}

.comic-placeholder {
    padding: 40px;
    color: var(--text-color);
    font-style: italic;
    opacity: 0.6;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .comic-navigation-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-left, .nav-right {
        order: 2;
    }
    
    .nav-center {
        order: 1;
    }
    
    .comic-frame.size-small {
        max-width: 100%;
    }
}

/* Mobile comic padding adjustments */
@media (max-width: 800px) {
    .comic-page-detail {
        padding: 5px !important; /* Much tighter padding on mobile */
    }
    
    .comic-display {
        padding: 2px !important; /* Very tight padding for maximum image space */
    }
}

/* Comments Section */
.comments-section {
    margin-top: 40px;
    border-top: 1px solid #ddd;
    padding-top: 20px;
}

.comment-form {
    margin-bottom: 20px;
}

.comment-form textarea,
.comment-form input[type="text"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.comment-form button {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
}

.comment-form button:hover {
    background: #218838;
}

.comment {
    border: 1px solid #eee;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 5px;
    background: #f9f9f9;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9em;
}

.comment-author {
    font-weight: bold;
    color: #333;
}

.comment-date {
    color: #666;
}

.comment-content {
    line-height: 1.5;
}

/* Comic Home */
.comic-home {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

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

.rss-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #ff6600;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.rss-link:hover {
    background: #e55a00;
    color: white;
    text-decoration: none;
}

.pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.page-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
}

.page-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.page-card a {
    text-decoration: none;
    color: inherit;
}

.page-thumbnail {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.page-info {
    padding: 15px;
}

.page-info h3 {
    margin: 0 0 5px 0;
    font-size: 1.1em;
}

.page-info p {
    margin: 0;
    color: #666;
    font-size: 0.9em;
}

.nsfw-tag {
    display: inline-block;
    background: #dc3545;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    margin-top: 5px;
}

/* Comic Discussion Section */
.comic-discussion-section {
    margin-top: 2em;
    padding: 1.5em;
    background: var(--tile-background);
    border-radius: 8px;
    text-align: center;
}

.comic-discussion-section h3 {
    margin: 0 0 0.5em 0;
    color: var(--text-color);
}

.comic-discussion-section p {
    margin: 0 0 1em 0;
    color: var(--text-color);
    opacity: 0.8;
}

.comic-discussion-section .btn {
    display: inline-block;
    padding: 0.75em 1.5em;
    background: var(--link-default);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.comic-discussion-section .btn:hover {
    background: var(--link-hover);
    color: white;
}

.comic-discussion-section em {
    font-style: italic;
    opacity: 0.7;
    font-size: 0.9em;
}

.staff-actions {
    margin-top: 1em;
    padding-top: 1em;
    border-top: 1px solid var(--border-color);
}

.staff-actions small {
    font-size: 0.85em;
}

.staff-actions a {
    color: var(--link-default);
    text-decoration: none;
}

.staff-actions a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

.staff-actions .btn-secondary {
    background: var(--text-color);
    color: var(--background-color);
    margin-top: 0.5em;
}

.staff-actions .btn-secondary:hover {
    background: var(--text-hover);
    color: var(--background-color);
}

/* Markdown Content Styling */
.markdown-content {
    line-height: 1.6;
    color: var(--text-color);
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    margin: 1em 0 0.5em 0;
    color: var(--text-color);
}

.markdown-content p {
    margin: 0 0 1em 0;
}

.markdown-content ul,
.markdown-content ol {
    margin: 0 0 1em 1.5em;
}

.markdown-content li {
    margin: 0.25em 0;
}

.markdown-content blockquote {
    margin: 1em 0;
    padding: 0.5em 1em;
    border-left: 4px solid var(--link-default);
    background: var(--tile-background);
    font-style: italic;
}

.markdown-content code {
    background: var(--tile-background);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: monospace;
}

.markdown-content pre {
    background: var(--tile-background);
    padding: 1em;
    border-radius: 4px;
    overflow-x: auto;
}

.markdown-content pre code {
    background: none;
    padding: 0;
}

.markdown-content a {
    color: var(--link-default);
    text-decoration: none;
}

.markdown-content a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* Transcript Elements on Comic Pages */
.comic-image-container {
    position: relative;
    display: inline-block;
}

.transcript-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Ensure overlay aligns with image, not container padding */
    margin: 0;
    padding: 0;
    /* Remove default positioning - will be set by JavaScript */
    transform: none;
}

.transcript-element {
    position: absolute;
    pointer-events: auto;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    /* Make elements invisible by default */
    background-color: transparent;
    opacity: 0;
    /* Add subtle outline to show clickable areas */
    outline: 1px solid rgba(0, 0, 0, 0.1);
}

.transcript-element:hover {
    opacity: 1;
    z-index: 10;
    outline: none; /* Remove outline on hover */
}

/* Transcript Text Elements - Show on hover */
.transcript-element.transcript {
    border-color: rgba(40, 167, 69, 0.6);
    background-color: rgba(40, 167, 69, 0.1);
    cursor: help;
}

.transcript-element.transcript:hover {
    border-color: rgba(40, 167, 69, 0.9);
    background-color: rgba(40, 167, 69, 0.2);
}

/* Character Credits - Clickable */
.transcript-element.credits {
    border-color: rgba(255, 193, 7, 0.6);
    background-color: rgba(255, 193, 7, 0.1);
    cursor: pointer;
}

.transcript-element.credits:hover {
    border-color: rgba(255, 193, 7, 0.9);
    background-color: rgba(255, 193, 7, 0.2);
    cursor: pointer;
}

/* Notes - Always visible */
.transcript-element.note {
    border-color: rgba(111, 66, 193, 0.6);
    background-color: rgba(111, 66, 193, 0.1);
    pointer-events: none;
    opacity: 1; /* Notes are always visible */
}

.note-content {
    position: absolute;
    top: -30px;
    left: 0;
    background: rgba(111, 66, 193, 0.9);
    color: white;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 20;
}

/* Navigation button groups */
.nav-btn-group {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
}

/* Small navigation buttons for First/Latest */
.nav-btn-small {
    min-width: 60px !important;
    min-height: 60px !important;
}

.nav-btn-small .nav-icon {
    width: 60px !important;
    height: 60px !important;
}

.nav-btn-small .nav-label {
    font-size: 14px !important;
    margin-bottom: 4px !important;
}

/* Rotated icons for First button (upside down paw) */
.nav-icon-rotated {
    transform: rotate(-180deg) !important;
}

/* Override the left/right rotation for small buttons in their respective containers */
.nav-left .nav-btn-small .nav-icon-rotated {
    transform: rotate(-180deg) !important;
}

.nav-right .nav-btn-small .nav-icon {
    transform: rotate(0deg) !important; /* Upright paw for Latest */
}

 