/* --------------------------------------------------
   POLAROID LAYOUT
-------------------------------------------------- */
.ps-row {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* --------------------------------------------------
   POLAROID FRAMES
-------------------------------------------------- */
.ps-polaroid {
    position: relative;
    width: 260px;
    padding: 12px 12px 18px;
    background: #fff;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border-radius: 6px;
    transform: rotate(-2deg);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: grab;

    /* Prevent stretching when dev panel grows */
    flex-shrink: 0;
    align-self: flex-start;
}

.ps-polaroid[data-slot="right"] {
    transform: rotate(2deg);
}

.ps-polaroid:active {
    cursor: grabbing;
}

/* --------------------------------------------------
   PHOTO FRAME + IMAGE
-------------------------------------------------- */
.ps-photo-frame {
    background: #f5f5f5;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    transition: transform 0.4s ease;
    transform-style: preserve-3d;
}

.ps-photo {
    display: block;
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: filter 0.2s ease, transform 0.2s ease;
    user-select: none;
    -webkit-user-drag: none;
}

.ps-caption {
    margin-top: 8px;
    text-align: center;
    font-size: 0.95rem;
    color: #333;
}

/* --------------------------------------------------
   PIN BUTTON
-------------------------------------------------- */
.ps-pin {
    position: absolute;
    top: 6px;
    right: 8px;
    border: none;
    background: transparent;
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.ps-pin:hover {
    opacity: 1;
    transform: scale(1.1);
}

.ps-pin.ps-pinned {
    color: #e63946;
}

/* --------------------------------------------------
   FLIP ANIMATION
-------------------------------------------------- */
.ps-polaroid.ps-flipped .ps-photo-frame {
    transform: rotateY(180deg);
}

/* --------------------------------------------------
   CONTROL PANEL (Glass UI)
-------------------------------------------------- */
.ps-control-panel {
    position: fixed;
    top: 120px;
    right: 20px;
    width: 260px;
    min-height: 560px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: #0f172a;
    z-index: 1000;
    overflow: hidden;
}

.ps-control-header {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.28);
    border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}

.ps-control-title {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ps-control-body {
    padding: 16px;
    font-size: 0.9rem;
}

.ps-control-group {
    margin-bottom: 18px;
}

.ps-control-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ps-label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

/* --------------------------------------------------
   MODE BUTTONS
-------------------------------------------------- */
.ps-mode-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ps-mode-btn {
    border: none;
    border-radius: 999px;
    padding: 8px 10px;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.6);
    color: #0f172a;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.ps-mode-btn.ps-mode-active {
    background: #0f172a;
    color: #f9fafb;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.4);
}

/* --------------------------------------------------
   SPEED SLIDER
-------------------------------------------------- */
#psSpeed {
    width: 100%;
}

.ps-speed-value {
    margin-top: 6px;
    font-size: 0.8rem;
    color: #475569;
}

/* --------------------------------------------------
   SECONDARY BUTTONS
-------------------------------------------------- */
.ps-btn-secondary {
    display: inline-block;
    border: 1px solid #0f172a;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.85rem;
    background: transparent;
    color: #0f172a;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.ps-btn-secondary:hover {
    background: #0f172a;
    color: #fff;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.35);
}

#psShuffle.ps-mode-active {
    background: #0f172a;
    color: #fff;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.4);
}

/* --------------------------------------------------
   EFFECTS GRID
-------------------------------------------------- */
.ps-effects {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
    font-size: 0.8rem;
}

.ps-effects label {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* --------------------------------------------------
   TOGGLE SWITCH
-------------------------------------------------- */
.ps-switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
}

.ps-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.ps-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5f5;
    transition: 0.2s;
    border-radius: 999px;
}

.ps-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.2s;
    border-radius: 50%;
}

.ps-switch input:checked + .ps-slider {
    background-color: #0f172a;
}

.ps-switch input:checked + .ps-slider:before {
    transform: translateX(16px);
}

/* --------------------------------------------------
   DEVELOPER PANEL
-------------------------------------------------- */
.ps-dev-panel {
    width: 600px;
    max-width: 90%;
    margin: 2rem auto;
    padding: 12px 16px;
    border-radius: 10px;
    background: #0f172a;
    color: #e5e7eb;
    font-size: 0.85rem;

    flex-shrink: 0;
}

.ps-dev-panel pre {
    margin: 0;
    white-space: pre-wrap;
}

/* --------------------------------------------------
   EFFECTS: VIGNETTE + CHAOS
-------------------------------------------------- */
.ps-effect-vignette .ps-photo-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background: radial-gradient(circle, transparent 45%, rgba(0,0,0,0.55) 100%);
}

.ps-chaos .ps-photo {
    animation: ps-chaos-jitter 0.25s infinite alternate;
}

@keyframes ps-chaos-jitter {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(2px, -2px) rotate(1deg); }
}

/* --------------------------------------------------
   RESPONSIVE: Move control panel at 1150px
-------------------------------------------------- */
@media (max-width: 1150px) {
    .ps-control-panel {
        position: static;
        width: 260px;
        min-height: auto;
        margin: 3rem auto 1rem;
        right: auto;
        top: auto;
    }

    .ps-row {
        flex-direction: column;
        align-items: center;
    }
}

/* --------------------------------------------------
   RESPONSIVE: Mobile layout
-------------------------------------------------- */
@media (max-width: 768px) {
    .ps-control-panel {
        position: static;
        width: 260px;
        min-height: auto;
        margin: 3rem auto 1rem;
    }

    .ps-row {
        flex-direction: column;
        align-items: center;
    }

    .ps-dev-panel {
        width: 100%;
        max-width: 100%;
        margin-top: 2rem;
    }
}

