:root {
    --fkl-primary:      #65bc7b;
    --fkl-primary-dark: #54a568;
    --fkl-text:         #444444;
    --fkl-bg-light:     #f9f9f9;
    --fkl-border:       #e2e2e2;
    --fkl-error:        #e74c3c;
    --fkl-radius:       8px;
    --fkl-shadow:       0 4px 12px rgba(0,0,0,0.05);
    /* FIX #7: Dynamische Galerie-Variablen (werden per wp_add_inline_style gesetzt) */
    --fkl-col-count:    3;
    --fkl-gap:          20px;
}

body {
    color: var(--fkl-text);
}

/* --- Visibility Logic --- */
.fkl-restrict-content { display: none !important; }
.fkl-hidden           { display: none !important; }

/* --- Container --- */
.fkl-wrapper { max-width: 100%; margin: 0 auto; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   FKL TOAST NOTIFICATIONS
   ========================================================================== */

.fkl-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.fkl-toast {
    background: #fff;
    color: var(--fkl-text);
    padding: 15px 20px;
    border-radius: var(--fkl-radius);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    min-width: 250px;
    max-width: 400px;
    font-size: 0.95rem;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.fkl-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.fkl-toast.error {
    border-left: 4px solid var(--fkl-error);
}

.fkl-toast-title {
    font-weight: bold;
    display: block;
    margin-bottom: 4px;
}

/* ==========================================================================
   FKL CUSTOM MODAL
   ========================================================================== */

.fkl-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}

.fkl-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.fkl-modal {
    background: #fff;
    width: 90%;
    max-width: 500px;
    padding: 30px;
    border-radius: var(--fkl-radius);
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
}

.fkl-modal-overlay.open .fkl-modal {
    transform: scale(1);
}

.fkl-modal h3 {
    color: #333 !important;
    margin-top: 0;
    margin-bottom: 15px;
}

.fkl-modal-actions {
    margin-top: 25px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.fkl-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
    font-size: 1rem;
}

.fkl-btn-primary {
    background: var(--fkl-primary);
    color: #fff;
}
.fkl-btn-primary:hover {
    background: var(--fkl-primary-dark);
}

.fkl-btn-secondary {
    background: #eee;
    color: #555;
}
.fkl-btn-secondary:hover {
    background: #ddd;
}

/* ==========================================================================
   AKTIVE BUTTONS
   ========================================================================== */

.fkl-action-btn {
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.fkl-action-btn.active {
    background-color: #2271b1 !important;
    border-color: #2271b1 !important;
    box-shadow: 0 4px 8px rgba(34, 113, 177, 0.4) !important;
    transform: scale(1.1);
}

.fkl-action-btn.active .dashicons {
    color: #fff !important;
}

.fkl-action-btn:hover {
    transform: scale(1.1);
}

/* ==========================================================================
   AVADA LIGHTBOX ANPASSUNG
   ========================================================================== */

.ilightbox-thumbnails { display: none !important; }

.ilightbox-holder .ilightbox-container {
    margin-right: 0 !important;
    width: 100% !important;
}

.ilightbox-holder .ilightbox-wrapper { text-align: center; }

/* ==========================================================================
   DIGIT INPUT (Login Form)
   ========================================================================== */

.fkl-digit-input:focus {
    border-color: var(--fkl-primary) !important;
    outline: none;
}
.fkl-digit-container input[type=text] {
    padding-left:3px;
    padding-right:3px;
}

.fkl-login-wrap h2, .fkl-login-wrap p, .fkl-login-wrap .fusion-alert {
    color:#fff;
}
/* ==========================================================================
   FIX #7: GALERIE STYLES (vorher Inline-<style> in shortcodes.php)
   ========================================================================== */

/* --- Galerie Items --- */
.fkl-item {
    position: relative;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.fkl-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.fkl-img-wrap img {
    display: block;
    width: 100%;
    transition: opacity 0.3s;
}

/* --- Grid Layout --- */
.fkl-layout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--fkl-gap);
}

.fkl-layout-grid .fkl-img-wrap img {
    height: 250px;
    object-fit: cover;
}

/* --- Masonry Layout --- */
.fkl-layout-masonry {
    column-count: var(--fkl-col-count);
    column-gap: var(--fkl-gap);
}

.fkl-layout-masonry .fkl-item {
    display: inline-block;
    width: 100%;
    margin-bottom: var(--fkl-gap);
    break-inside: avoid;
}

.fkl-layout-masonry .fkl-img-wrap img {
    height: auto !important;
}

@media (max-width: 1024px) { .fkl-layout-masonry { column-count: 2; } }
@media (max-width: 600px)  { .fkl-layout-masonry { column-count: 1; } }

/* --- Action Buttons (Overlay) --- */
.fkl-actions {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.fkl-action-btn {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.2s;
    border: none;
    color: #555;
}

.fkl-action-btn:hover     { background: #fff; transform: scale(1.1); }
.fkl-action-btn.active    { background: #e91e63; color: #fff; }
.fkl-action-btn.has-note  { background: #2196f3; color: #fff; }

.fkl-action-btn .dashicons {
    font-family: "dashicons" !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 20px;
    line-height: 1;
    margin: 0;
    padding: 0;
}

/* --- Counter Box (fixiert, oben rechts) --- */
.fkl-counter-box {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    background: #000;
    padding: 10px 15px;
    border-radius: 30px;
    border: 3px solid #454545;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    font-weight: bold;
    color: #fff;
}

/* --- Ablaufdatum-Badge --- */
.fkl-expiry-badge {
    display: inline-block;
    background: #d63638;
    color: #fff;
    padding: 8px 15px;
    border-radius: 4px;
    font-weight: bold;
    font-family: sans-serif;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* --- Vermerk-Badge (auf Bildkachel) --- */
.fkl-note-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #2271b1;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
}

/* --- Leere-Auswahl-Hinweis --- */
.fkl-empty-selection {
    text-align: center;
    padding: 40px;
    background: #fff;
}
