/* ═══════════════════════════════════════════════════════════════════════
   DAIKOKU USA — Post composer styles
   Shared across feed.html (community feed composer) and profile.html
   (own-profile composer). Paired with js/lib/composer.js which renders
   the markup into a host container.

   Class names match the legacy feed.html composer so the existing
   .post-composer / .composer-avatar / .composer-body wrapper still works
   without modification.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Sign-in gate ("fake" input shown to signed-out feed visitors) ──── */
.composer-input-fake {
    width: 100%;
    padding: 0.7rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: border-color 0.2s;
    margin-bottom: 0.6rem;
}
.composer-input-fake:hover { border-color: rgba(0, 229, 255, 0.25); }

/* ── Real composer textarea ─────────────────────────────────────────── */
textarea.composer-input {
    width: 100%;
    min-height: 70px;
    max-height: 200px;
    padding: 0.7rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.85);
    resize: none;
    outline: none;
    overflow: hidden;
    transition: border-color 0.2s;
    margin-bottom: 0.6rem;
    display: block;
    font-family: inherit;
    box-sizing: border-box;
}
textarea.composer-input:focus { border-color: rgba(0, 229, 255, 0.25); }
textarea.composer-input::placeholder { color: rgba(255, 255, 255, 0.2); }

/* ── Upload progress bar (shows during media upload only) ───────────── */
.composer-progress {
    display: none;
    height: 3px;
    background: rgba(0, 229, 255, 0.1);
    border-radius: 2px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}
.composer-progress.active { display: block; }
.composer-progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--neon-pink, #ff00cc), var(--neon-purple, #9d00ff));
    transition: width 0.3s;
}

/* ── Media preview (thumbnail tiles + link preview card live here) ──── */
.composer-media-preview { margin-bottom: 0.4rem; }
.composer-media-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.composer-media-tile {
    position: relative;
    width: 96px;
    height: 96px;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: grab;
    user-select: none;
    touch-action: none;        /* disable scroll-pan during drag on touch */
    transition: border-color 0.15s, transform 0.18s ease-out, opacity 0.15s;
}
.composer-media-tile:hover { border-color: rgba(0, 229, 255, 0.35); }
.composer-media-tile.dragging {
    opacity: 0.55;
    cursor: grabbing;
    box-shadow: 0 0 18px rgba(0, 229, 255, 0.35);
    border-color: var(--neon-cyan, #00e5ff);
    z-index: 2;
}
.composer-media-tile-img,
.composer-media-tile-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;       /* drag should target the tile, not the media */
}
.composer-media-tile-vbadge {
    position: absolute;
    bottom: 4px;
    left: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: rgba(255, 255, 255, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    pointer-events: none;
}
.composer-media-tile-cover {
    position: absolute;
    top: 4px;
    left: 4px;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    background: rgba(0, 229, 255, 0.18);
    border: 1px solid rgba(0, 229, 255, 0.45);
    color: var(--neon-cyan, #00e5ff);
    font-size: 0.5rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 800;
    pointer-events: none;
}
.composer-media-tile-rm {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 0.95rem;
    line-height: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    z-index: 3;
}
.composer-media-tile-rm:hover { background: #ff4466; }
.composer-media-tile-cover-btn {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid rgba(0, 229, 255, 0.45);
    background: rgba(0, 0, 0, 0.6);
    color: var(--neon-cyan, #00e5ff);
    font-size: 0.7rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    z-index: 3;
}
.composer-media-tile-cover-btn:hover {
    background: rgba(0, 229, 255, 0.18);
    color: #fff;
}
@media (max-width: 600px) {
    .composer-media-tile { width: 80px; height: 80px; }
}
.composer-link-loading {
    font-size: 0.62rem;
    color: rgba(255, 255, 255, 0.3);
    padding: 0.3rem 0;
    letter-spacing: 1px;
}
.composer-link-preview {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(0, 229, 255, 0.18);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    overflow: hidden;
    position: relative;
}
.composer-link-preview img {
    width: 100%;
    aspect-ratio: 1200 / 630;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
}
.composer-link-preview-body {
    padding: 0.6rem 0.75rem 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.composer-link-preview-site {
    font-size: 0.58rem;
    letter-spacing: 1.5px;
    color: var(--neon-cyan, #00e5ff);
    text-transform: uppercase;
}
.composer-link-preview-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
}
.composer-link-preview-desc {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.45);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}
.composer-link-preview-rm {
    position: absolute;
    top: 0.4rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.15rem 0.35rem;
    border-radius: 3px;
}

/* ── Tagged-event strip ─────────────────────────────────────────────── */
.composer-tagged-event {
    display: none;
    margin-bottom: 0.4rem;
    padding: 0.45rem 0.65rem;
    background: rgba(0, 229, 255, 0.06);
    border: 1px solid rgba(0, 229, 255, 0.25);
    border-radius: 4px;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: #fff;
}
.composer-tagged-event.active { display: flex; }
.composer-tagged-event-icon { color: var(--neon-cyan, #00e5ff); }
.composer-tagged-event-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.composer-tagged-event-clear {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0 0.3rem;
}

/* ── Tagged-track chip (same shape as event but tinted differently
      so the user sees track vs event vs vendor at a glance). ───────── */
.composer-tagged-track {
    display: none;
    margin-bottom: 0.4rem;
    padding: 0.45rem 0.65rem;
    background: rgba(157, 0, 255, 0.06);
    border: 1px solid rgba(157, 0, 255, 0.32);
    border-radius: 4px;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: #fff;
}
.composer-tagged-track.active { display: flex; }
.composer-tagged-track-icon { color: #c080ff; }
.composer-tagged-track-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.composer-tagged-track-clear {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0 0.3rem;
}

/* ── Tagged-vendor chips strip (up to 3) ────────────────────────────── */
.composer-tagged-vendors {
    display: none;
    margin: 0 0 0.6rem;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.composer-tagged-vendors.active { display: flex; }
.composer-vendor-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    background: rgba(255, 200, 0, 0.07);
    border: 1px solid rgba(255, 200, 0, 0.3);
    color: #ffd84a;
    font-size: 0.72rem;
    border-radius: 4px;
}
.composer-vendor-chip-name {
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.composer-vendor-chip-rm {
    background: transparent;
    border: none;
    color: rgba(255, 200, 0, 0.7);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0 0.15rem;
}

/* ── Action button row ──────────────────────────────────────────────── */
.composer-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.composer-action-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.28);
    padding: 0.3rem 0.5rem;
    border-radius: 3px;
    cursor: pointer;
    background: none;
    border: none;
    transition: color 0.2s;
    font-family: inherit;
}
.composer-action-btn:hover { color: var(--neon-cyan, #00e5ff); }

/* Tag-menu trigger — replaces the prior #Tag/Event/Vendor cluster.
   Active state (`has-tags`) means at least one event or vendor is tagged;
   the count chip surfaces how many. Detail still lives in the chip strips
   above the action row. */
.dk-c-btn-tagmenu {
    gap: 0.3rem;
    padding-right: 0.6rem;
}
.dk-c-tagmenu-icon { font-size: 0.85rem; line-height: 1; }
.dk-c-tagmenu-label { letter-spacing: 1px; }
.dk-c-tagmenu-caret {
    font-size: 0.55rem;
    opacity: 0.6;
    margin-left: -0.1rem;
}
.dk-c-tagmenu-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 10px;
    background: rgba(0, 229, 255, 0.18);
    color: var(--neon-cyan, #00e5ff);
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0;
}
/* `display: inline-flex` above wins over the UA [hidden] rule due to
   cascade order. feed/garage/event-detail/post-detail mask this with a
   page-level [hidden] !important rule; profile doesn't, so we honor
   `hidden` explicitly here so the chip stays self-contained. */
.dk-c-tagmenu-count[hidden] { display: none; }
.dk-c-btn-tagmenu.has-tags { color: var(--neon-cyan, #00e5ff); }

/* Popover anchored below (or above) the Tag-menu button. Closes on
   outside-click or Escape (handled in composer.js). */
.composer-tag-menu {
    z-index: 10005;
    min-width: 220px;
    max-width: 92vw;
    background: linear-gradient(160deg, #0a0815 0%, #060414 100%);
    border: 1px solid rgba(0, 229, 255, 0.22);
    border-radius: 8px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6);
    padding: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    animation: dk-tag-menu-in 0.12s ease-out;
}
@keyframes dk-tag-menu-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.composer-tag-menu-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.7rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 5px;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: background 0.12s, border-color 0.12s;
}
.composer-tag-menu-item:hover:not(:disabled) {
    background: rgba(0, 229, 255, 0.06);
    border-color: rgba(0, 229, 255, 0.3);
}
.composer-tag-menu-item:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.composer-tag-menu-icon {
    font-size: 1.05rem;
    line-height: 1;
    flex-shrink: 0;
}
.composer-tag-menu-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.composer-tag-menu-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: #fff;
}
.composer-tag-menu-sub {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Category select is a native <select> for free keyboard/screen-reader
   support; the wrap exists only to anchor a custom caret matching the
   Tag button's affordance. */
.composer-category-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.composer-category-select {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 3px;
    font-family: inherit;
    cursor: pointer;
    padding-right: 1.1rem; /* leave room for the caret */
}
.composer-category-caret {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.55rem;
    opacity: 0.6;
    pointer-events: none;
    color: inherit;
}
.composer-post-btn {
    margin-left: auto;
    padding: 0.5rem 1.5rem;
    background: linear-gradient(135deg, #ff00cc, #00e5ff);
    border: none;
    border-radius: 4px;
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: opacity 0.2s;
    font-family: inherit;
}
.composer-post-btn:disabled { opacity: 0.6; cursor: wait; }

/* ── Mobile tweaks ──────────────────────────────────────────────────── */
@media (max-width: 600px) {
    textarea.composer-input { font-size: 0.88rem; min-height: 60px; padding: 0.65rem 0.85rem; }
    .composer-actions { gap: 0.5rem; flex-wrap: wrap; }
    .composer-action-btn { font-size: 0.6rem; padding: 0.45rem 0.7rem; }
}
