/**
 * @version 2.0.0
 * @lastModified 2025-01-27
 * @author Kernfunke
 * @description Stylesheet für Lehrwerk Frontend Template
 * @changelog
 * - v2.0.0: Container margin-left hinzugefügt, responsive Design für mobile Geräte optimiert
 */

/* Allgemeine Container-Styling */
body {
    margin: 0;
    padding: 0;
}

.container {
    max-width: 800px;
    margin: 100px auto 100px 100px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
}

/* Responsive Design - Mobile Optimierung */
@media (max-width: 1024px) {
    .container {
        margin: 50px auto;
        max-width: 90%;
    }
}

@media (max-width: 768px) {
    .container {
        margin: 30px auto;
        padding: 15px;
        max-width: 95%;
    }
    
    .free-pdf {
        margin: 15px 0;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .container {
        margin: 20px auto;
        padding: 12px;
        border-radius: 8px;
    }
    
    .free-pdf {
        margin: 10px 0;
        padding: 12px;
        border-radius: 8px;
    }
    
    .free-pdf h3 {
        font-size: 1.2em;
        margin-bottom: 15px;
    }
    
    .free-pdf .button {
        width: 100%;
        padding: 12px;
        font-size: 14px;
        word-break: break-word;
    }
}

/* Sicherstellen, dass der Header nicht vom Plugin beeinflusst wird */
header#masthead.site-header,
.site-header,
.sticky-header {
    background: none !important;
    position: relative !important;
    z-index: 1000 !important;
    width: 100% !important;
}

/* Styling für die Login-Meldung */
.login-message {
    background: #c5c5c5;
    color: #333;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 20px;
}

.login-message a {
    color: #000;
    font-weight: bold;
}

/* Styling für Free- & Pro-Bereich */
.free-pdf, .pro-content {
    margin: 20px 0;
    padding: 20px;
    border-radius: 10px;
}

.free-pdf {
    background: #d4edda;
    border: 1px solid #c3e6cb;
}

.pro-content {
    background: #e2e3e5;
    border: 1px solid #d6d8db;
}

.pro-message {
    color: #856404;
    background: #fff3cd;
    padding: 15px;
    text-align: center;
    border-radius: 10px;
    margin-bottom: 20px;
}

.pro-content[style*="opacity: 0.5"] {
    opacity: 0.5;
}

/* Dateivorschau */
.file-thumbnail img {
    width: 50px;
    height: auto;
    margin-right: 10px;
}

.pro-files {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.pro-files ul {
    list-style-type: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.pro-files li {
    display: flex;
    align-items: center;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 10px;
    background: #f9f9f9;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   PDF.js Viewer Styles
   ========================================================================== */

.kf-pdf-viewer {
    width: 100%;
    background: #525659;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    /* Download-Schutz */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* Toolbar */
.kf-pdf-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #323639;
    border-bottom: 1px solid #1a1a1a;
}

.kf-pdf-toolbar-left,
.kf-pdf-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Buttons */
.kf-pdf-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 4px;
    background: #525659;
    color: #d7d7d7;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kf-pdf-btn:hover:not(:disabled) {
    background: #6b6f73;
    color: #fff;
}

.kf-pdf-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.kf-pdf-btn:focus {
    outline: 2px solid #4a90d9;
    outline-offset: 2px;
}

.kf-pdf-icon {
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
}

/* Page Info */
.kf-pdf-page-info,
.kf-pdf-zoom-info {
    color: #d7d7d7;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-width: 80px;
    text-align: center;
}

.kf-pdf-zoom-info {
    min-width: 50px;
}

/* Canvas Container */
.kf-pdf-canvas-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 500px;
    max-height: 80vh;
    overflow: auto;
    padding: 20px;
    background: #808080;
}

#kf-pdf-canvas {
    display: block;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    background: #fff;
    /* Verhindert Drag & Drop */
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}

/* Loading */
.kf-pdf-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
    background: rgba(82, 86, 89, 0.95);
    color: #fff;
    font-size: 14px;
}

.kf-pdf-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: kf-pdf-spin 0.8s linear infinite;
}

@keyframes kf-pdf-spin {
    to { transform: rotate(360deg); }
}

/* Error */
.kf-pdf-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: #ff6b6b;
    text-align: center;
}

.kf-pdf-error-icon {
    font-size: 32px;
}

/* NoScript */
.kf-pdf-noscript {
    background: #fff3cd;
    color: #856404;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

/* Responsive */
@media (max-width: 600px) {
    .kf-pdf-toolbar {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    .kf-pdf-toolbar-left,
    .kf-pdf-toolbar-right {
        width: 100%;
        justify-content: center;
    }
    
    .kf-pdf-btn {
        width: 32px;
        height: 32px;
    }
    
    .kf-pdf-canvas-container {
        min-height: 400px;
        padding: 10px;
    }
}

/* Print Protection - Versteckt Viewer beim Drucken */
@media print {
    .kf-pdf-viewer {
        display: none !important;
    }
    
    .kf-pdf-viewer::after {
        content: 'Drucken ist für dieses Dokument nicht gestattet.';
        display: block;
        padding: 20px;
        text-align: center;
    }
}
