/**
 * Debug Page Styles
 * @version 1.0.0
 */

/* Page title section */
.page-content {
    margin-bottom: 30px;
    text-align: center;
    padding-top: 20px;
}

.page-title {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.title-divider {
    color: var(--text-secondary);
    margin: 0 10px;
}

.title-subtitle {
    color: var(--text-secondary);
    font-size: 20px;
    font-weight: 400;
}

@media (max-width: 768px) {
    .page-title {
        font-size: 24px;
    }
    .title-subtitle {
        font-size: 16px;
        display: block;
        margin-top: 5px;
    }
    .title-divider {
        display: none;
    }
}

body.app-page main {
    margin-top: 60px;
    padding-bottom: 2rem
}

.hero-section {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-lg);
    margin: 0 auto 1.5rem;
    max-width: 1200px;
    width: calc(100% - 2rem)
}

.hero-icon {
    display: none
}

.hero-title {
    font-size: var(--font-size-xl);
    margin: 0;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative
}

.hero-title::before {
    content: "🐛";
    font-size: 1.5rem
}

.hero-description {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-top: 0.5rem
}

.resolution-display {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 0.5rem;
    font-family: monospace
}

.copy-resolution-btn {
    background: none;
    border: none;
    padding: 0.25rem;
    margin-left: 0.25rem;
    cursor: pointer;
    font-size: 0.875rem;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    vertical-align: middle
}

.copy-resolution-btn:hover {
    opacity: 1
}

.copy-resolution-btn.copied {
    opacity: 1
}

.copy-resolution-btn.copied::before {
    content: "✓ Copied!";
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--success-color,#22c55e);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    white-space: nowrap;
    animation: fade-in-out 2s ease-in-out;
    pointer-events: none
}

@keyframes fade-in-out {
    0%,100% {
        opacity: 0
    }
    10%,90% {
        opacity: 1
    }
}

.tool-section {
    width: 100%;
    padding: 2rem 0
}

.debug-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem
}

.render-status {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--surface-bg);
    border-radius: 8px
}

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

.render-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap
}

.view-toggle {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-tertiary);
    padding: 0.25rem;
    border-radius: 6px
}

.view-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.2s,color 0.2s
}

.view-btn:hover {
    background: rgb(255 255 255 / 5%)
}

.view-btn.active {
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 500
}

.refresh-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.2s,border-color 0.2s
}

.refresh-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--primary)
}

.refresh-icon {
    display: inline-block;
    transition: transform 0.3s
}

.refresh-btn:active .refresh-icon {
    transform: rotate(360deg)
}

.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(280px,1fr));
    gap: 1.5rem;
    margin: 2rem 0 3rem;
    width: 100%
}

@media (width>= 768px) {
    .gallery-container {
        grid-template-columns: repeat(auto-fill,minmax(300px,1fr))
    }
}

@media (width>= 1200px) {
    .gallery-container {
        grid-template-columns: repeat(auto-fill,minmax(320px,1fr))
    }
}

.gallery-item {
    background: var(--surface-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s,box-shadow 0.2s;
    cursor: pointer;
    min-height: 250px
}

.gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgb(0 0 0 / 10%)
}

.gallery-item-image {
    width: 100%;
    height: 400px;
    background: var(--bg-tertiary);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center
}

.gallery-item-image.has-error {
    cursor: default
}

.gallery-item-info {
    padding: 1rem
}

.gallery-item-info h4 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    color: var(--text-primary)
}

.gallery-item-info p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary)
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    display: block
}

.missing-render {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    text-align: center;
    padding: 2rem
}

.missing-icon {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 1rem
}

.missing-text {
    font-size: 1rem;
    margin-bottom: 0.5rem
}

.missing-hint {
    font-size: 0.75rem;
    font-family: "SF Mono",Monaco,Inconsolata,"Fira Code",monospace;
    background: var(--code-bg);
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    margin-top: 0.5rem
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--surface-bg);
    border-radius: 8px
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5
}

.empty-state h3 {
    margin: 0 0 1rem;
    font-size: 1.5rem;
    color: var(--text-primary)
}

.empty-state p {
    margin: 0 0 1rem;
    color: var(--text-secondary)
}

.empty-state ol {
    max-width: 400px;
    margin: 2rem auto 0;
    text-align: left;
    color: var(--text-secondary)
}

.empty-state ol li {
    margin-bottom: 0.5rem
}

.empty-state code {
    background: var(--code-bg);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-family: "Courier New",monospace;
    font-size: 0.875rem
}

.empty-note {
    margin-top: 2rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-style: italic
}

.debug-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgb(0 0 0 / 90%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 2rem
}

.debug-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column
}

.debug-modal-close {
    position: absolute;
    top: -2rem;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.2s
}

.debug-modal-close:hover {
    opacity: 1
}

.debug-modal img {
    max-width: 100%;
    max-height: calc(90vh - 4rem);
    object-fit: contain;
    display: block
}

.debug-modal-caption {
    margin-top: 1rem;
    color: white;
    text-align: center;
    font-size: 0.875rem
}

.debug-modal-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 2rem;
    pointer-events: none
}

.debug-modal-nav-btn {
    width: 50px;
    height: 50px;
    background: rgb(0 0 0 / 50%);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.2s,background-color 0.2s;
    pointer-events: all
}

.debug-modal-nav-btn:hover {
    opacity: 1;
    background: rgb(0 0 0 / 70%)
}

.debug-modal-prev {
    margin-left: 2rem
}

.debug-modal-next {
    margin-right: 2rem
}

@media (width <= 768px) {
    .gallery-container {
        grid-template-columns: repeat(auto-fill,minmax(250px,1fr));
        gap: 1rem
    }
    .render-controls {
        flex-direction: column;
        width: 100%
    }
    .view-toggle {
        width: 100%;
        justify-content: center
    }
    .refresh-btn {
        width: 100%;
        justify-content: center
    }
    .debug-modal {
        padding: 1rem
    }
    .debug-modal-close {
        top: -2.5rem
    }
}

.features-section {
    margin-top: var(--spacing-lg);
    padding: 0 var(--spacing-md);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto
}

.features-title {
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-md);
    color: var(--text-primary)
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(250px,1fr));
    gap: var(--spacing-md)
}

.feature-card {
    background: var(--bg-secondary);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-md);
    text-align: center
}

.feature-card .feature-icon {
    font-size: 2rem;
    margin-bottom: var(--spacing-sm)
}

.feature-card h4 {
    font-size: var(--font-size-md);
    margin: 0 0 var(--spacing-xs) 0;
    color: var(--text-primary)
}

.feature-card p {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5
}

.technical-details {
    margin: var(--spacing-lg) auto;
    background: var(--bg-secondary);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-lg);
    max-width: 1200px;
    width: calc(100% - 2rem)
}

.technical-details h3 {
    font-size: var(--font-size-lg);
    margin: 0 0 var(--spacing-md) 0;
    color: var(--text-primary)
}

.technical-details p {
    font-size: var(--font-size-md);
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--spacing-sm)
}

.technical-details p:last-child {
    margin-bottom: 0
}

.technical-details code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: var(--border-radius-sm);
    font-family: "SF Mono",Monaco,Inconsolata,"Fira Code",monospace;
    font-size: 0.875em;
    color: var(--primary)
}

.back-button-container {
    padding: var(--spacing-lg);
    text-align: center
}

.real-mode-html .gallery-item {
    box-shadow: 0 1px 3px rgb(0 0 0 / 10%)
}

.real-mode-html .gallery-item:hover {
    box-shadow: 0 4px 12px rgb(0 0 0 / 15%)
}
