/* ============================================================================
   SCP Custom Features Plugin Styles
   ============================================================================ */

/* Widgets Container */
.scp-widget {
    margin-bottom: 20px;
}

.scp-widget-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #003d82;
}

/* Widget Header - Blau-Gradient wie Site-Header (Navy-800 → Navy-700 → Blue-700) */
.widget-header,
.scp-webcam-widget .widget-header,
.scp-weather-widget .widget-header,
.weather-widget .widget-header,
.webcam-widget .widget-header {
    background: linear-gradient(135deg, #002d4a 0%, #003d5c 50%, #004d99 100%) !important;
    padding: 16px 20px;
    border-radius: 8px 8px 0 0;
}

.widget-header .widget-header-title,
.scp-webcam-widget .widget-header-title,
.scp-weather-widget .widget-header-title,
.widget-header h3,
.widget-header h4 {
    color: #ffffff !important;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

/* Widget Footer - Gleicher Blau-Gradient */
.widget-footer,
.scp-webcam-widget .widget-footer,
.scp-weather-widget .widget-footer,
.weather-widget .widget-footer,
.webcam-widget .widget-footer {
    background: linear-gradient(135deg, #002d4a 0%, #003d5c 50%, #004d99 100%) !important;
    padding: 12px 20px;
    border-radius: 0 0 8px 8px;
}

.widget-footer a,
.widget-footer span {
    color: #90e0ef !important;
    font-size: 14px;
}

.widget-footer a:hover {
    color: #ffffff !important;
}

/* Widget Container mit abgerundeten Ecken */
.weather-widget,
.webcam-widget,
.scp-webcam-widget,
.scp-weather-widget {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 45, 74, 0.15);
}

/* Webcam Widget */
.scp-webcam-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.scp-webcam-container iframe {
    width: 100%;
    border: none;
    display: block;
}

/* Webcam Bild - Anpassung an Widget-Größe */
.scp-webcam-image-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    background: #f0f4f8;
}

.scp-webcam-image-container img {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Bild lädt - Platzhalter */
.scp-webcam-image-container img[src=""],
.scp-webcam-image-container img:not([src]) {
    min-height: 200px;
    background: linear-gradient(135deg, #e0e8f0 0%, #f0f4f8 100%);
}

.scp-webcam-image-container:hover img {
    transform: scale(1.02);
}

/* Klick-Hinweis Overlay */
.scp-webcam-image-container::after {
    content: "🔍 Klicken für Vollbild";
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 61, 130, 0.9);
    color: #fff;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.scp-webcam-image-container:hover::after {
    opacity: 1;
}

/* Responsive Anpassungen für Webcam-Bild */
@media (max-width: 768px) {
    .scp-webcam-image-container::after {
        font-size: 11px;
        padding: 6px 10px;
        bottom: 8px;
        right: 8px;
    }
}

/* Webcam Lightbox Popup */
.scp-webcam-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.scp-webcam-lightbox.active {
    display: flex;
}

.scp-webcam-lightbox-content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
}

.scp-webcam-lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.scp-webcam-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    padding: 5px 15px;
    transition: color 0.3s ease;
}

.scp-webcam-lightbox-close:hover {
    color: #ff6b6b;
}

.scp-webcam-lightbox-info {
    position: absolute;
    bottom: -35px;
    left: 0;
    right: 0;
    text-align: center;
    color: #ccc;
    font-size: 14px;
}

/* Weather Widget */
.scp-weather-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.scp-weather-container iframe {
    width: 100%;
    border: none;
    display: block;
}

/* Instagram Feed Widget */
.scp-instagram-feed {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.scp-instagram-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    aspect-ratio: 1;
}

.scp-instagram-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.scp-instagram-embed {
    max-width: 100%;
    margin: 0 auto;
}

/* Dokumenten-Liste */
.scp-documents-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.scp-document-item {
    display: flex;
    gap: 15px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid #003d82;
    transition: all 0.3s ease;
}

.scp-document-item:hover {
    background: #f0f0f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.scp-document-icon {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #003d82;
    color: white;
    border-radius: 4px;
    font-weight: bold;
}

.scp-file-type {
    font-size: 9px;
    text-transform: uppercase;
}

.scp-document-info {
    flex: 1;
}

.scp-document-title {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.scp-document-title a {
    color: #003d82;
    text-decoration: none;
    transition: color 0.3s ease;
}

.scp-document-title a:hover {
    color: #0066cc;
}

.scp-document-excerpt {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 14px;
}

.scp-document-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #999;
}

.scp-document-meta > span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.scp-document-restricted {
    margin: 10px 0 0 0;
    color: #d63638;
    font-size: 13px;
}

.scp-access-denied {
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    text-align: center;
}

.scp-access-denied p {
    margin: 10px 0;
}

/* Newsletter-Archiv */
.scp-newsletter-archive {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.scp-newsletter-item {
    padding: 25px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.scp-newsletter-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #003d82;
}

.scp-newsletter-title {
    margin: 0 0 10px 0;
    font-size: 22px;
}

.scp-newsletter-title a {
    color: #003d82;
    text-decoration: none;
    transition: color 0.3s ease;
}

.scp-newsletter-title a:hover {
    color: #0066cc;
}

.scp-newsletter-meta {
    margin-bottom: 15px;
    font-size: 14px;
    color: #999;
}

.scp-newsletter-date {
    display: inline-block;
    padding: 4px 10px;
    background: #e6f2ff;
    color: #003d82;
    border-radius: 4px;
    font-size: 13px;
}

.scp-newsletter-excerpt {
    margin-bottom: 15px;
    color: #666;
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .scp-instagram-feed {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .scp-document-item {
        flex-direction: column;
        text-align: center;
    }
    
    .scp-document-icon {
        margin: 0 auto;
    }
    
    .scp-document-meta {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .scp-instagram-feed {
        grid-template-columns: 1fr;
    }
    
    .scp-document-item {
        padding: 15px;
    }
    
    .scp-newsletter-item {
        padding: 20px;
    }
}

/* Admin Styles */
.scp-document-upload {
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.scp-document-preview {
    margin-top: 15px;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#scp_allowed_roles_container {
    margin-top: 10px;
    padding: 10px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.scp-newsletter-send {
    padding: 15px;
}

.scp-newsletter-stats table {
    margin-top: 10px;
}

.scp-newsletter-stats td {
    padding: 8px;
}

/* Loading States */
.scp-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #999;
}

.scp-loading::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #003d82;
    border-radius: 50%;
    animation: scp-spin 1s linear infinite;
}

@keyframes scp-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error States */
.scp-error {
    padding: 15px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
}

.scp-success {
    padding: 15px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    color: #155724;
}
