/* app/static/css/dropup-menu.css
   Layer-4 dropup menu for the 360 viewer info bar.
   Anchored to bottom of trigger, opens upward, glass-card aesthetic.
*/

.pv-dropup-trigger {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #f5f5f5;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease;
}
.pv-dropup-trigger:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
}
.pv-dropup-trigger[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
}

.pv-dropup-panel {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    min-width: 280px;
    max-height: 60vh;
    overflow-y: auto;
    background: rgba(20, 20, 20, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    backdrop-filter: blur(16px);
    padding: 8px;
    box-sizing: border-box;
    transform: translateY(8px);
    opacity: 0;
    pointer-events: none;
    transition: transform 150ms ease, opacity 150ms ease;
    z-index: 100;
}
.pv-dropup-panel[data-state="open"] {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.pv-dropup-panel hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin: 8px 0;
}

.pv-dropup-panel section {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pv-dropup-panel button,
.pv-dropup-panel a[data-action] {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    background: transparent;
    border: none;
    color: #f5f5f5;
    padding: 10px 12px;
    border-radius: 6px;
    font: inherit;
    text-align: left;
    cursor: pointer;
    text-decoration: none;
    transition: background 100ms ease;
}
.pv-dropup-panel button:hover,
.pv-dropup-panel a[data-action]:hover {
    background: rgba(255, 255, 255, 0.06);
}
.pv-dropup-panel i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.pv-dropup-panel button[data-action="hero-toggle"][data-state="in-hero"] i {
    color: #e13e13; /* brand */
}

.pv-dropup-panel details.dropup-model-details {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    padding: 8px 12px;
}
.pv-dropup-panel details.dropup-model-details summary {
    cursor: pointer;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
}
.pv-dropup-panel details.dropup-model-details[open] summary {
    margin-bottom: 8px;
}

.pv-dropup-panel .views-count {
    color: rgba(255, 255, 255, 0.6);
    padding: 4px 12px;
    font-size: 13px;
}

/* Danger modifier — owner-only "Delete image" item.
   Uses brand red (#e13e13) instead of a glow/shadow per project rules. */
.pv-dropup-panel button.dropup-action--danger,
.pv-dropup-panel a.dropup-action--danger {
    color: #e13e13;
}
.pv-dropup-panel button.dropup-action--danger:hover,
.pv-dropup-panel a.dropup-action--danger:hover {
    background: rgba(225, 62, 19, 0.12);
}
.pv-dropup-panel button.dropup-action--danger i,
.pv-dropup-panel a.dropup-action--danger i {
    color: #e13e13;
}

/* Hide elements moved into the dropup. Layer 4 toggles these classes
   on the existing vendor-rendered nodes after init. */
.pv-info-bar .pv-info-fullsettings,
.pv-info-bar .pv-info-fullsettings-body,
.pv-info-bar .pv-info-details,
.pv-info-bar .pv-info-model,
.pv-info-bar .pv-info-config,
.pv-info-bar .gallery-infobar-btn--share,
.pv-info-bar .gallery-infobar-btn--views,
.pv-info-bar .gallery-infobar-btn--download,
.pv-info-bar .gallery-infobar-btn--copy {
    /* Default: keep visible. Layer 4 adds .moved-to-dropup to hide. */
}
.pv-info-bar .moved-to-dropup {
    display: none !important;
}

/* ---------------------------------------------------------------------------
   Tag combobox (Phase 6 Task 6.1)
   --------------------------------------------------------------------------- */
.pv-tag-combobox {
    position: relative;
    width: 100%;
}
.pv-tag-pillbox {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding: 6px 8px;
    min-height: 36px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
}
.pv-tag-pillbox:focus-within {
    border-color: rgba(225, 62, 19, 0.6);
}
.pv-tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(225, 62, 19, 0.15);
    border: 1px solid rgba(225, 62, 19, 0.4);
    color: #fff;
    border-radius: 999px;
    padding: 2px 4px 2px 10px;
    font-size: 12px;
    line-height: 1.5;
}
.pv-tag-pill-label {
    color: inherit;
}
.pv-tag-pill-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font: inherit;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}
.pv-tag-pill-remove:hover {
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
}
.pv-tag-input {
    flex: 1 1 80px;
    min-width: 80px;
    background: transparent;
    border: none;
    color: #f5f5f5;
    font: inherit;
    padding: 4px 6px;
    outline: none;
}
.pv-tag-input:disabled {
    opacity: 0.5;
}
.pv-tag-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    max-height: 240px;
    overflow-y: auto;
    background: rgba(20, 20, 20, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    backdrop-filter: blur(16px);
    padding: 4px;
    z-index: 110;
}
.pv-tag-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: transparent;
    border: none;
    color: #f5f5f5;
    padding: 8px 10px;
    border-radius: 4px;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.pv-tag-option:hover,
.pv-tag-option--active {
    background: rgba(255, 255, 255, 0.08);
}
.pv-tag-option-name {
    flex: 1 1 auto;
}
.pv-tag-option-count {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}
.pv-tag-option--create {
    color: #e13e13;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 2px;
}
.pv-tag-option--create i {
    font-size: 14px;
}

/* ---------------------------------------------------------------------------
   Info-bar edit popovers (Phase 6 Task 6.2)
   Anchored above the info-bar, glass-card aesthetic matching dropup.
   --------------------------------------------------------------------------- */
.gallery-edit-popover {
    position: fixed;
    bottom: calc(var(--pv-info-bar-height, 56px) + 8px);
    right: 16px;
    width: 360px;
    max-width: calc(100vw - 32px);
    background: rgba(20, 20, 20, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    backdrop-filter: blur(16px);
    padding: 14px;
    z-index: 105;
    color: #f5f5f5;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-sizing: border-box;
}
.gallery-edit-popover h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}
.gallery-edit-popover textarea,
.gallery-edit-popover input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    color: #f5f5f5;
    padding: 8px 10px;
    font: inherit;
    outline: none;
}
.gallery-edit-popover textarea:focus,
.gallery-edit-popover input[type="text"]:focus {
    border-color: rgba(225, 62, 19, 0.6);
}
.gallery-edit-popover textarea {
    min-height: 96px;
    resize: vertical;
}
.gallery-edit-popover-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.gallery-edit-popover-btn {
    padding: 7px 14px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: transparent;
    color: #f5f5f5;
    font: inherit;
    cursor: pointer;
}
.gallery-edit-popover-btn--primary {
    background: #e13e13;
    border-color: #e13e13;
    color: #fff;
}
.gallery-edit-popover-btn--primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.gallery-edit-popover-btn--danger {
    background: #e13e13;
    border-color: #e13e13;
    color: #fff;
}
.gallery-edit-popover-error {
    color: #f87171;
    font-size: 12px;
    min-height: 16px;
}

/* Inline title editing — promotes the info-bar title to an input. */
.gallery-title-edit-input {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(225, 62, 19, 0.5);
    border-radius: 4px;
    color: #f5f5f5;
    padding: 2px 6px;
    font: inherit;
    width: 320px;
    max-width: 60vw;
    outline: none;
}

/* Confirm dialog backdrop for delete confirmation. */
.gallery-confirm-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gallery-confirm-dialog {
    background: rgba(20, 20, 20, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 18px;
    color: #f5f5f5;
    width: 360px;
    max-width: calc(100vw - 32px);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.gallery-confirm-dialog h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}
.gallery-confirm-dialog p {
    margin: 0;
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    line-height: 1.5;
}

/* ---------------------------------------------------------------------------
   Tag pills inside dropup panel (relocated from info bar)
   --------------------------------------------------------------------------- */
.dropup-tags {
    padding: 0;
    margin: 0;
}
.dropup-tags .dropup-section-heading {
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}
.gallery-tag-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.gallery-tag-strip-pill {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.85);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    line-height: 1.4;
    text-decoration: none;
    white-space: nowrap;
    transition: background 100ms ease, border-color 100ms ease, color 100ms ease;
}
.gallery-tag-strip-pill:hover {
    background: rgba(225, 62, 19, 0.12);
    border-color: rgba(225, 62, 19, 0.4);
    color: #fff;
}

/* Tag pills are now <a> links to /tags/<name> — keep pill look, no underline. */
a.gallery-dropup__tag {
    text-decoration: none;
    cursor: pointer;
}
a.gallery-dropup__tag:hover {
    filter: brightness(1.15);
}
