/* Promotion Calendar Pro - gemeinsames CSS fuer Designer (Backend) und Kalenderanzeige (Frontend) */

.pcp-canvas-wrapper {
    max-width: 100%;
    overflow: auto;
}

.pcp-canvas {
    position: relative;
    width: 100%;
    max-width: 1000px;
    background-size: cover;
    background-position: center;
    background-color: #f2f2f2;
    border: 1px solid #ddd;
}

.pcp-canvas.pcp-grid-visible::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(0, 123, 255, 0.35) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 123, 255, 0.35) 1px, transparent 1px);
    background-size: 2% 2%, 2% 2%;
}

.pcp-toolbar-divider {
    display: inline-block;
    width: 1px;
    height: 24px;
    background: #ddd;
    margin: 0 4px;
}

#pcp-toggle-grid.active {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
}

.pcp-door {
    position: absolute;
    box-sizing: border-box;
    border: 2px dashed rgba(0, 123, 255, 0.7);
    background: rgba(0, 123, 255, 0.12);
    cursor: move;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.pcp-shape-circle {
    border-radius: 50%;
}

.pcp-door-number {
    font-weight: bold;
    color: #003a75;
    pointer-events: none;
}

.pcp-door-resize-handle {
    position: absolute;
    right: -6px;
    bottom: -6px;
    width: 12px;
    height: 12px;
    background: #007bff;
    border-radius: 50%;
    cursor: nwse-resize;
}

.pcp-door-actions {
    position: absolute;
    top: -12px;
    right: -8px;
    display: flex;
    gap: 2px;
}

.pcp-door-actions a {
    display: inline-block;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.4);
    text-decoration: none;
    font-size: 12px;
}

.pcp-door-delete {
    color: #c00;
}

/* Frontend Kalender */
.pcp-frontend-canvas {
    position: relative;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    background-size: cover;
    background-position: center;
}

.pcp-frontend-door {
    position: absolute;
    box-sizing: border-box;
    cursor: pointer;
    background-color: transparent;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: none;
    padding: 0;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    font: inherit;
    /* Browser-Standardstil von <button> zuruecksetzen, sonst ueberdeckt
       ein undurchsichtiger UA-Hintergrund das Kalenderbild komplett. */
    -webkit-tap-highlight-color: transparent;
}

.pcp-frontend-door:hover,
.pcp-frontend-door:focus-visible {
    box-shadow: inset 0 0 0 3px var(--pcp-hover-color, rgba(255, 255, 255, 0.85));
}

.pcp-frontend-door .pcp-door-number {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(255, 255, 255, 0.88);
    color: #222;
    font-weight: bold;
    font-size: 0.85rem;
    line-height: 1;
    padding: 4px 9px;
    border-radius: 999px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    pointer-events: none;
}

.pcp-frontend-door.is-locked {
    cursor: not-allowed;
    filter: grayscale(1) brightness(0.8);
}

.pcp-frontend-door.is-opened {
    outline: 3px solid var(--pcp-opened-color, gold);
}

/* --- Oeffnungs-Animationen --- */

@keyframes pcp-door-flip {
    0%   { transform: perspective(700px) rotateY(0deg); }
    100% { transform: perspective(700px) rotateY(-100deg); }
}

.pcp-frontend-door.pcp-anim-door_flip {
    animation: pcp-door-flip 0.5s ease-in forwards;
    transform-origin: left center;
}

@keyframes pcp-zoom-bounce {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.28); }
    65%  { transform: scale(0.92); }
    100% { transform: scale(1); }
}

.pcp-frontend-door.pcp-anim-zoom_bounce {
    animation: pcp-zoom-bounce 0.5s ease-out;
}

@keyframes pcp-confetti-fall {
    0%   { transform: translate(0, 0) rotate(0deg); opacity: 1; }
    100% { transform: translate(var(--pcp-dx), var(--pcp-dy)) rotate(var(--pcp-rot)); opacity: 0; }
}

.pcp-confetti-piece {
    position: fixed;
    top: 0;
    left: 0;
    width: 8px;
    height: 14px;
    pointer-events: none;
    z-index: 10000;
    animation: pcp-confetti-fall 1.1s ease-out forwards;
}

@keyframes pcp-sparkle-float {
    0%   { transform: translate(0, 0) scale(0.3); opacity: 0; }
    25%  { opacity: 1; }
    100% { transform: translate(var(--pcp-dx), var(--pcp-dy)) scale(1); opacity: 0; }
}

.pcp-sparkle-piece {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 10000;
    color: #fff;
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.9), 0 0 8px rgba(173, 216, 255, 0.6);
    animation: pcp-sparkle-float 1s ease-out forwards;
}

.pcp-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.pcp-modal-box {
    background: #fff;
    padding: 1.5rem;
    max-width: 480px;
    width: 90%;
    border-radius: 8px;
    position: relative;
}

.pcp-modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    cursor: pointer;
    font-size: 1.4rem;
    background: none;
    border: none;
}

/* Neue Inhaltstypen (Phase 1b) */
.pcp-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}

.pcp-gallery-item {
    margin: 0;
}

.pcp-gallery-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.pcp-gallery-item figcaption {
    font-size: 0.75rem;
    color: #666;
    text-align: center;
    margin-top: 2px;
}

.pcp-content-article h4 {
    margin-top: 0;
}

.pcp-content-html {
    max-width: 100%;
    overflow-x: auto;
}

