/* ================================================
   Artist Media Uploader — Widget Styles
   Clean, modern, optimized for Mac + iPad
   ================================================ */

/* ── Custom properties (overridable via accent) ── */
.amu-wrap {
    --amu-accent: #e85d4a;
    --amu-radius: 16px;
    --amu-radius-sm: 8px;
    --amu-font: -apple-system, 'Helvetica Neue', sans-serif;
    --amu-text: #1a1a1a;
    --amu-muted: #6b7280;
    --amu-border: #e5e7eb;
    --amu-surface: #f9f9f7;
    --amu-white: #ffffff;

    font-family: var(--amu-font);
    color: var(--amu-text);
    max-width: 860px;
    margin: 0 auto;
    padding: 0;
}

/* ── Header ── */
.amu-header {
    margin-bottom: 28px;
}
.amu-title {
    font-size: clamp(22px, 4vw, 32px);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0 0 6px;
    color: var(--amu-text);
}
.amu-subtitle {
    font-size: 14px;
    color: var(--amu-muted);
    margin: 0;
    letter-spacing: 0.01em;
}

/* ── Drop zone ── */
.amu-dropzone {
    border: 2px dashed var(--amu-border);
    border-radius: var(--amu-radius);
    background: var(--amu-surface);
    padding: 52px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
    position: relative;
    outline: none;
}
.amu-dropzone:hover,
.amu-dropzone:focus-visible {
    border-color: var(--amu-accent);
    background: #fff;
}
.amu-dropzone.amu-drag-over {
    border-color: var(--amu-accent);
    background: #fff;
    transform: scale(1.01);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--amu-accent) 15%, transparent);
}
.amu-dropzone__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.amu-dropzone__icon {
    width: 52px;
    height: 52px;
    color: var(--amu-accent);
    margin-bottom: 4px;
}
.amu-dropzone__icon svg {
    width: 100%;
    height: 100%;
}
.amu-dropzone__label {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: var(--amu-text);
}
.amu-dropzone__sub {
    font-size: 13px;
    color: var(--amu-muted);
    margin: 0;
}

/* ── Buttons ── */
.amu-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity 0.15s, transform 0.1s;
    text-decoration: none;
    line-height: 1;
}
.amu-btn:active { transform: scale(0.97); }
.amu-btn--primary {
    background: var(--amu-accent);
    color: #fff;
}
.amu-btn--primary:hover { opacity: 0.88; }

/* ── Filter pills ── */
.amu-filters {
    display: flex;
    gap: 8px;
    margin: 24px 0 20px;
    flex-wrap: wrap;
}
.amu-pill {
    padding: 7px 16px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    border: 1.5px solid var(--amu-border);
    background: transparent;
    color: var(--amu-muted);
    cursor: pointer;
    transition: all 0.15s;
}
.amu-pill:hover {
    border-color: var(--amu-accent);
    color: var(--amu-accent);
}
.amu-pill--active {
    background: var(--amu-accent);
    border-color: var(--amu-accent);
    color: #fff;
}

/* ── Upload queue (progress items) ── */
.amu-queue {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 16px 0;
}
.amu-progress-item {
    background: var(--amu-white);
    border: 1px solid var(--amu-border);
    border-radius: var(--amu-radius-sm);
    padding: 14px 16px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 12px;
    align-items: center;
}
.amu-progress-item__name {
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--amu-text);
}
.amu-progress-item__status {
    font-size: 12px;
    color: var(--amu-muted);
    text-align: right;
}
.amu-progress-item__bar-wrap {
    grid-column: 1 / -1;
    height: 4px;
    background: var(--amu-border);
    border-radius: 99px;
    overflow: hidden;
}
.amu-progress-item__bar {
    height: 100%;
    width: 0%;
    background: var(--amu-accent);
    border-radius: 99px;
    transition: width 0.25s ease;
}
.amu-progress-item--done .amu-progress-item__bar { width: 100%; }
.amu-progress-item--error .amu-progress-item__bar { background: #e53e3e; }

/* ── Gallery grid ── */
.amu-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 8px;
}

/* ── Gallery item ── */
.amu-item {
    background: var(--amu-white);
    border: 1px solid var(--amu-border);
    border-radius: var(--amu-radius-sm);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.15s;
    display: flex;
    flex-direction: column;
}
.amu-item:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.10);
    transform: translateY(-2px);
}
.amu-item.amu-hidden { display: none; }

/* Thumbnail */
.amu-item__thumb {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    position: relative;
    background: var(--amu-surface);
    text-decoration: none;
}
.amu-item__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}
.amu-item:hover .amu-item__thumb img { transform: scale(1.04); }

/* Hover overlay */
.amu-item__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.38);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0;
    transition: opacity 0.2s;
}
.amu-item:hover .amu-item__overlay { opacity: 1; }

/* Video thumb */
.amu-item__thumb--video {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
}
.amu-item__thumb--video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Audio thumb */
.amu-item__thumb--audio {
    padding: 20px 16px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 130px;
}
.amu-audio-icon {
    width: 52px;
    height: 52px;
    color: var(--amu-accent);
}
.amu-audio-icon svg { width: 100%; height: 100%; }
.amu-item__thumb--audio audio {
    width: 100%;
    height: 32px;
}

/* Type badge */
.amu-item__type-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 100px;
}

/* Meta row */
.amu-item__meta {
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-top: 1px solid var(--amu-border);
}
.amu-item__title {
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    color: var(--amu-text);
}
.amu-item__link {
    color: var(--amu-muted);
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
    transition: color 0.15s;
}
.amu-item__link:hover { color: var(--amu-accent); }

/* ── Empty gallery ── */
.amu-gallery:empty::before {
    content: "No uploads yet — add your first file above.";
    display: block;
    color: var(--amu-muted);
    font-size: 14px;
    text-align: center;
    padding: 32px;
    grid-column: 1 / -1;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .amu-dropzone { padding: 36px 16px; }
    .amu-gallery  { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .amu-title    { font-size: 22px; }
}

/* ── Dark mode ── */
@media (prefers-color-scheme: dark) {
    .amu-wrap {
        --amu-text: #f3f4f6;
        --amu-muted: #9ca3af;
        --amu-border: #374151;
        --amu-surface: #1f2937;
        --amu-white: #111827;
    }
}
