/* Frontend styles for PDF to Image display - GrauesRathaus Theme */

.pdf-images-container {
    background: #f1ebdb;
    border: 10px solid #181818;
    border-radius: 0;
    font-family: "VT323", monospace;
    font-size: 23px;
    font-weight: 100;
    line-height: 1;
    position: relative;
    color: #181818;
}

.pdf-images-header {
    padding: 20px;
    background: #b91023;
    color: #ffffff;
    font-family: "VT323", monospace;
    text-align: center;
    position: relative;
    
    /* Cool pixelated pattern background */
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(24, 24, 24, 0.1) 2px,
            rgba(24, 24, 24, 0.1) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(24, 24, 24, 0.1) 2px,
            rgba(24, 24, 24, 0.1) 4px
        );
    background-size: 8px 8px;
}

.pdf-images-header h3 {
    margin: 0 0 10px 0;
    color: #ffffff;
    font-size: 42px;
    font-weight: 100;
    text-transform: uppercase;
    font-family: "VT323", monospace;
    line-height: 1;
    
    /* Cool text shadow effect */
    text-shadow: 
        2px 2px 0px #181818,
        4px 4px 0px rgba(24, 24, 24, 0.5);
}

.pdf-images-header p {
    margin: 0;
    color: #ffffff;
    font-size: 23px;
    font-family: "VT323", monospace;
    line-height: 1;
}

.pdf-images-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: #181818;
    color: #ffffff;
    position: relative;
    z-index: 10;
    font-family: "VT323", monospace;
    
    /* Subtle pattern */
    background-image: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 4px,
            rgba(185, 16, 35, 0.1) 4px,
            rgba(185, 16, 35, 0.1) 8px
        );
}

.pdf-controls-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pdf-controls-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pdf-page-info {
    font-size: 23px;
    font-weight: 100;
    color: #ffffff;
    min-width: 100px;
    text-align: center;
    text-transform: uppercase;
    font-family: "VT323", monospace;
    line-height: 1;
    
    /* Cool glowing effect */
    background: #b91023;
    padding: 0.2em 0.5em;
    border: 2px solid #ffffff;
    text-shadow: 0px 0px 4px rgba(255, 255, 255, 0.5);
}

.pdf-btn {
    background: #75787b;
    color: #ffffff;
    border: 3px solid #ffffff;
    padding: 0.2em 0.8em;
    border-radius: 0;
    cursor: pointer;
    font-size: 20px;
    font-weight: 100;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s ease;
    white-space: nowrap;
    text-transform: uppercase;
    font-family: "VT323", monospace;
    line-height: 1;
    margin: 5px;
    position: relative;
    
    /* Cool pixelated shadow */
    box-shadow: 
        2px 2px 0px #181818,
        4px 4px 0px rgba(24, 24, 24, 0.3);
    
    /* Text shadow */
    text-shadow: 1px 1px 0px #181818;
}

.pdf-btn:hover {
    background: #b91023;
    color: #ffffff;
    text-decoration: none;
    
    box-shadow: 
        1px 1px 0px #181818,
        2px 2px 0px rgba(24, 24, 24, 0.3);
}

.pdf-btn:active {
    background: #b91023;
    transform: translate(2px, 2px);
    box-shadow: none;
}

.pdf-btn:disabled {
    background: #6c757d;
    border-color: #6c757d;
    opacity: 0.6;
    cursor: not-allowed;
}

.pdf-btn:disabled:hover {
    background: #6c757d;
    color: #ffffff;
    border-color: #6c757d;
}

.pdf-images-display {
    position: relative;
    background: #f1ebdb;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pdf-page-image {
    text-align: center;
    width: 100%;
    position: relative;
}

.pdf-page-image img {
    max-width: 100%;
    height: auto;
    border: 5px solid #181818;
    border-radius: 0;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.1s ease;
    position: relative;
}

.pdf-page-image img:hover {
    border-color: #b91023;
}

/* Loading state */
.pdf-page-image img[src*="data:image/gif"] {
    opacity: 0.3;
    background: #f0f0f0;
    min-height: 400px;
}

/* Add cool retro scanlines effect */
.pdf-images-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(24, 24, 24, 0.03) 2px,
        rgba(24, 24, 24, 0.03) 4px
    );
    pointer-events: none;
    z-index: 1;
}

.pdf-images-container > * {
    position: relative;
    z-index: 2;
}

/* Responsive design */
@media (max-width: 768px) {
    .pdf-images-container {
        margin: 15px 0px;
        border: 7px solid #181818;
        outline: 12px solid #ffffff;
    }
    
    .pdf-images-header {
        padding: 10px;
    }
    
    .pdf-images-header h3 {
        font-size: 30px;
    }
    
    .pdf-images-header p {
        font-size: 14px;
    }
    
    .pdf-images-toolbar {
        padding: 10px 15px;
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .pdf-controls-left {
        gap: 5px;
    }
    
    .pdf-controls-right {
        gap: 5px;
    }
    
    .pdf-btn {
        font-size: 20px;
        padding: 0.2em 0.6em;
        margin: 3px;
        border: 2px solid #ffffff;
        box-shadow: 
            1px 1px 0px #181818,
            2px 2px 0px rgba(24, 24, 24, 0.3);
    }
    
    .pdf-page-info {
        font-size: 20px;
        min-width: 80px;
        padding: 0.1em 0.3em;
    }
    
    .pdf-images-display {
        padding: 10px;
    }
    
    .pdf-page-image img {
        border: 4px solid #181818;
        box-shadow: 
            3px 3px 0px #75787b,
            6px 6px 0px rgba(117, 120, 123, 0.5);
    }
}

@media (max-width: 480px) {
    .pdf-images-toolbar {
        padding: 8px;
        flex-direction: column;
        align-items: stretch;
    }
    
    .pdf-controls-left,
    .pdf-controls-right {
        justify-content: center;
        margin: 5px 0;
    }
    
    .pdf-btn {
        font-size: 11px;
        padding: 6px 10px;
        min-height: 32px;
    }
    
    .pdf-page-info {
        font-size: 13px;
    }
    
    .pdf-images-display {
        padding: 5px;
    }
}

/* Print styles */
@media print {
    .pdf-images-toolbar {
        display: none;
    }
    
    .pdf-images-container {
        border: none;
        box-shadow: none;
        background: transparent;
    }
    
    .pdf-images-header {
        background: transparent;
        color: black;
        border: none;
    }
    
    .pdf-images-display {
        padding: 0;
        background: transparent;
    }
    
    .pdf-page-image {
        page-break-inside: avoid;
    }
    
    .pdf-page-image img {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .pdf-images-container {
        border: 3px solid #000000;
    }
    
    .pdf-images-header,
    .pdf-images-toolbar {
        background: #000000;
        border-bottom-color: #000000;
    }
    
    .pdf-btn {
        background: #333333;
        border: 2px solid #ffffff;
    }
    
    .pdf-btn:hover {
        background: #666666;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .pdf-btn {
        transition: none;
    }
    
    .pdf-btn:hover {
        transform: none;
    }
    
    .pdf-page-image img {
        transition: none;
    }
    
    .pdf-page-image img:hover {
        transform: none;
    }
}

/* Focus styles for accessibility */
.pdf-btn:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.pdf-page-image img:focus {
    outline: 3px solid #007cba;
    outline-offset: 3px;
}

.pdf-images-container:focus {
    outline: 2px solid #007cba;
    outline-offset: 4px;
}

/* Zoom Modal Styles */
.pdf-zoom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(24, 24, 24, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "VT323", monospace;
    
    /* Pixelated overlay pattern */
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(185, 16, 35, 0.1) 2px,
            rgba(185, 16, 35, 0.1) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(185, 16, 35, 0.1) 2px,
            rgba(185, 16, 35, 0.1) 4px
        );
    background-size: 8px 8px;
}

.pdf-zoom-content {
    display: flex;
    flex-direction: column;
    width: 95%;
    height: 95%;
    max-width: 1200px;
    max-height: 900px;
    position: relative;
}

.pdf-zoom-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: #181818;
    color: #ffffff;
    border: 3px solid #ffffff;
    margin-bottom: 10px;
    
    /* Subtle pattern */
    background-image: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 4px,
            rgba(185, 16, 35, 0.1) 4px,
            rgba(185, 16, 35, 0.1) 8px
        );
}

.pdf-zoom-controls-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pdf-zoom-controls-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pdf-zoom-btn {
    background: #75787b;
    color: #ffffff;
    border: 3px solid #ffffff;
    padding: 0.3em 0.6em;
    border-radius: 0;
    cursor: pointer;
    font-size: 18px;
    font-weight: 100;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s ease;
    white-space: nowrap;
    text-transform: uppercase;
    font-family: "VT323", monospace;
    line-height: 1;
    min-width: 40px;
    
    /* Cool pixelated shadow */
    box-shadow: 
        2px 2px 0px #181818,
        4px 4px 0px rgba(24, 24, 24, 0.3);
    
    /* Text shadow */
    text-shadow: 1px 1px 0px #181818;
}

.pdf-zoom-btn:hover {
    background: #b91023;
    color: #ffffff;
    text-decoration: none;
    
    box-shadow: 
        1px 1px 0px #181818,
        2px 2px 0px rgba(24, 24, 24, 0.3);
}

.pdf-zoom-btn:active {
    background: #b91023;
    transform: translate(2px, 2px);
    box-shadow: none;
}

.pdf-zoom-btn span {
    font-size: 16px;
    line-height: 1;
}

.pdf-zoom-level {
    font-size: 20px;
    font-weight: 100;
    color: #ffffff;
    min-width: 60px;
    text-align: center;
    text-transform: uppercase;
    font-family: "VT323", monospace;
    line-height: 1;
    
    /* Cool glowing effect */
    background: #b91023;
    padding: 0.3em 0.6em;
    border: 2px solid #ffffff;
    text-shadow: 0px 0px 4px rgba(255, 255, 255, 0.5);
}

.pdf-zoom-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f1ebdb;
    border: 5px solid #181818;
    position: relative;
    
    /* Retro CRT-style scanlines */
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(24, 24, 24, 0.02) 2px,
            rgba(24, 24, 24, 0.02) 4px
        );
}

.pdf-zoom-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border: none;
    background: #ffffff;
    transition: transform 0.2s ease;
    transform-origin: center;
    
    /* Subtle shadow */
    box-shadow: 0 0 20px rgba(24, 24, 24, 0.3);
}

/* Loading state for zoom modal */
.pdf-zoom-image-container.loading {
    background: #f0f0f0;
}

.pdf-zoom-image-container.loading::after {
    content: 'LOADING...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: "VT323", monospace;
    font-size: 24px;
    color: #181818;
    text-transform: uppercase;
}

/* Focus styles for accessibility */
.pdf-zoom-btn:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.pdf-zoom-modal:focus {
    outline: none;
}

/* Animation for modal appearance */
.pdf-zoom-modal {
    animation: zoomModalFadeIn 0.2s ease-out;
}

@keyframes zoomModalFadeIn {
    from {
        opacity: 0;
        background: rgba(24, 24, 24, 0);
    }
    to {
        opacity: 1;
        background: rgba(24, 24, 24, 0.95);
    }
}

/* Responsive zoom modal */
@media (max-width: 768px) {
    .pdf-zoom-content {
        width: 98%;
        height: 98%;
    }
    
    .pdf-zoom-controls {
        padding: 10px 15px;
        margin-bottom: 5px;
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .pdf-zoom-controls-left,
    .pdf-zoom-controls-right {
        gap: 5px;
    }
    
    .pdf-zoom-btn {
        font-size: 16px;
        padding: 0.2em 0.4em;
        min-width: 35px;
        border: 2px solid #ffffff;
        box-shadow: 
            1px 1px 0px #181818,
            2px 2px 0px rgba(24, 24, 24, 0.3);
    }
    
    .pdf-zoom-btn span {
        font-size: 14px;
    }
    
    .pdf-zoom-level {
        font-size: 18px;
        min-width: 50px;
        padding: 0.2em 0.4em;
    }
    
    .pdf-zoom-image-container {
        border: 3px solid #181818;
    }
}

@media (max-width: 480px) {
    .pdf-zoom-controls {
        padding: 8px;
        flex-direction: column;
        align-items: stretch;
    }
    
    .pdf-zoom-controls-left,
    .pdf-zoom-controls-right {
        justify-content: center;
        margin: 3px 0;
    }
    
    .pdf-zoom-btn {
        font-size: 14px;
        padding: 8px 12px;
        min-height: 32px;
    }
    
    .pdf-zoom-level {
        font-size: 16px;
        padding: 8px 12px;
    }
}

/* Animation for showing/hiding pages */
.pdf-page-image {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* When showing all pages */
.pdf-images-container.show-all .pdf-page-image {
    display: block !important;
    margin-bottom: 30px;
}

.pdf-images-container.show-all .pdf-images-display {
    align-items: stretch;
}

/* Smooth scrolling for page navigation */
html {
    scroll-behavior: smooth;
}

/* Loading placeholder */
.pdf-page-loading {
    display: inline-block;
    width: 100%;
    height: 400px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 2s infinite;
}

@keyframes loading-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}