/* ── DACE Submissions & Voting — Frontend Styles ──────────── */

.dace-sub-wrap,
.dace-voting-wrap {
    max-width: 900px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── Notices ───────────────────────────────────────────────── */
.dace-notice {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    border-left: 4px solid #0073aa;
    background: #f0f6fc;
    color: #1d2327;
}
.dace-notice--error   { background: #fef0f0; border-left-color: #dc3232; color: #8b0000; }
.dace-notice--warning { background: #fff8e1; border-left-color: #f0ad4e; color: #664d03; }
.dace-notice--success { background: #f0faf0; border-left-color: #46b450; color: #0a5c0a; }

/* ── Counter ──────────────────────────────────────────────── */
.dace-sub-counter {
    background: #f5f5f5;
    padding: 10px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

/* ── Entry cards (accordion style) ────────────────────────── */
.dace-entry-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 12px;
    background: #fff;
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.dace-entry-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.dace-entry-card--submitted { border-left: 4px solid #0073aa; }
.dace-entry-card--accepted  { border-left: 4px solid #46b450; }
.dace-entry-card--rejected  { border-left: 4px solid #dc3232; }

.dace-entry-card__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
}
.dace-entry-card__header:hover {
    background: #fafafa;
}
.dace-entry-card__thumb {
    flex: 0 0 60px;
}
.dace-entry-card__thumb img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}
.dace-entry-card__no-img {
    width: 60px;
    height: 60px;
    background: #f0f0f0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #999;
}
.dace-entry-card__info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.dace-entry-card__info h4 {
    margin: 0;
    font-size: 15px;
}
.dace-vote-count-small {
    font-size: 12px;
    color: #888;
}
.dace-entry-card__toggle {
    flex: 0 0 auto;
}
.dace-chevron {
    display: inline-block;
    transition: transform 0.2s;
    font-size: 12px;
    color: #999;
}
.dace-chevron--open {
    transform: rotate(180deg);
}
.dace-entry-card__body {
    padding: 0 16px 16px;
}

/* ── Upload zone (new entries) ────────────────────────────── */
.dace-upload-zone {
    position: relative;
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background: #fafafa;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
    margin-bottom: 16px;
}
.dace-upload-zone:hover,
.dace-upload-zone--drag {
    border-color: #0073aa;
    background: #f0f6fc;
}
.dace-upload-zone__icon {
    font-size: 48px;
    display: block;
    margin-bottom: 8px;
}
.dace-upload-zone__content p {
    margin: 4px 0;
    color: #555;
}
.dace-file-input--zone {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* ── Image preview ────────────────────────────────────────── */
.dace-image-preview {
    position: relative;
    margin-bottom: 16px;
    text-align: center;
}
.dace-image-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 6px;
    border: 1px solid #ddd;
    object-fit: contain;
}
.dace-change-image {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 12px;
    font-size: 12px;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    color: #333;
}
.dace-change-image:hover {
    background: #e0e0e0;
}

/* ── Entry image area for existing drafts ─────────────────── */
.dace-entry-image-area {
    margin-bottom: 16px;
}
.dace-entry-image-area .dace-file-input:not(.dace-file-input--zone) {
    margin-top: 8px;
}

/* ── Form fields ──────────────────────────────────────────── */
.dace-entry-fields {
    border-top: 1px solid #eee;
    padding-top: 16px;
}
.dace-fieldset {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 16px;
    margin: 16px 0;
}
.dace-fieldset legend {
    font-weight: 600;
    font-size: 15px;
    padding: 0 8px;
    color: #1d2327;
}
.dace-field {
    margin-bottom: 14px;
}
.dace-field label {
    display: block;
    font-weight: 500;
    margin-bottom: 4px;
    font-size: 13px;
    color: #1d2327;
}
.dace-field input[type="text"],
.dace-field input[type="number"],
.dace-field input[type="file"],
.dace-field select,
.dace-field textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}
.dace-field input:focus,
.dace-field select:focus,
.dace-field textarea:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.15);
}
.dace-field-row {
    display: flex;
    gap: 12px;
}
.dace-field-row .dace-field { flex: 1; }
.dace-hint { font-size: 12px; color: #666; margin: 4px 0 8px; }

/* Conditional fields */
.dace-conditional { display: none; }
.dace-conditional.dace-visible { display: flex; }
div.dace-conditional.dace-visible { display: block; }

/* ── Buttons ──────────────────────────────────────────────── */
.dace-btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s, opacity 0.2s;
}
.dace-btn:hover { opacity: 0.9; }
.dace-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.dace-btn--save   { background: #0073aa; color: #fff; }
.dace-btn--submit { background: #46b450; color: #fff; }
.dace-btn--danger { background: #dc3232; color: #fff; }
.dace-btn--small  { padding: 6px 12px; font-size: 12px; }

.dace-btn--add {
    display: block;
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    background: #f0f6fc;
    color: #0073aa;
    border: 2px dashed #0073aa;
    border-radius: 8px;
    text-align: center;
    margin-top: 8px;
    transition: background 0.2s;
}
.dace-btn--add:hover {
    background: #e0effa;
}

.dace-entry-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
    align-items: center;
}

/* ── Status badges ────────────────────────────────────────── */
.dace-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.dace-status--draft     { background: #f0f0f0; color: #666; }
.dace-status--submitted { background: #e8f4fd; color: #0073aa; }
.dace-status--accepted  { background: #eaf7ea; color: #2e7d32; }
.dace-status--rejected  { background: #fde8e8; color: #c62828; }

/* ── Read-only view ───────────────────────────────────────── */
.dace-entry-readonly { padding-top: 8px; }
.dace-readonly-image { margin-bottom: 12px; }
.dace-readonly-image img { max-width: 100%; max-height: 300px; border-radius: 6px; }
.dace-readonly-desc { color: #333; font-size: 14px; line-height: 1.5; margin-bottom: 12px; }
.dace-readonly-votes { margin-top: 12px; padding: 10px; background: #f9f9f9; border-radius: 4px; font-size: 14px; }

/* ── My Submissions grid ──────────────────────────────────── */
.dace-submissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.dace-sub-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.dace-sub-card__image img { width: 100%; height: 180px; object-fit: cover; display: block; }
.dace-sub-card__body { padding: 14px; }
.dace-sub-card__body h4 { margin: 0 0 6px; font-size: 15px; }
.dace-vote-count { margin-top: 6px; font-size: 12px; color: #666; }

/* ── Voting panel ─────────────────────────────────────────── */
.dace-voting-info {
    background: #f5f5f5;
    padding: 10px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}
.dace-voting-grid { display: grid; gap: 24px; }
.dace-vote-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    display: grid;
    grid-template-columns: 300px 1fr;
}
@media (max-width: 768px) {
    .dace-vote-card { grid-template-columns: 1fr; }
    .dace-field-row { flex-direction: column; gap: 0; }
}
.dace-vote-card__image img { width: 100%; height: 100%; min-height: 250px; object-fit: cover; display: block; }
.dace-vote-card__body { padding: 20px; }
.dace-vote-card__body h4 { margin: 0 0 4px; font-size: 18px; }
.dace-vote-card__artist { color: #666; font-size: 14px; margin: 0 0 12px; }
.dace-vote-card__desc { color: #333; margin: 0 0 12px; font-size: 14px; line-height: 1.5; }
.dace-details-list { list-style: none; padding: 0; margin: 0; font-size: 13px; columns: 2; column-gap: 20px; }
.dace-details-list li { padding: 2px 0; break-inside: avoid; }
.dace-vote-card__tally {
    display: flex; gap: 16px; align-items: center;
    padding: 10px 0; font-size: 14px;
    border-top: 1px solid #eee; margin-top: 12px;
}
.dace-tally-yes { color: #2e7d32; font-weight: 600; }
.dace-tally-no  { color: #c62828; font-weight: 600; }
.dace-tally-need { color: #888; font-size: 12px; }
.dace-vote-card__actions { display: flex; gap: 12px; margin-top: 12px; }
.dace-btn--vote-yes { background: #46b450; color: #fff; padding: 10px 28px; font-size: 15px; }
.dace-btn--vote-no  { background: #dc3232; color: #fff; padding: 10px 28px; font-size: 15px; }
.dace-vote-card__voted { margin-top: 12px; padding: 8px 12px; background: #f9f9f9; border-radius: 4px; font-size: 14px; }

/* ── Decided cards ────────────────────────────────────────── */
.dace-decided-grid { display: grid; gap: 8px; margin-top: 12px; }
.dace-decided-card { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid #eee; border-radius: 6px; background: #fafafa; }
.dace-decided-card--accepted { border-left: 4px solid #46b450; }
.dace-decided-card--rejected { border-left: 4px solid #dc3232; }
.dace-decided-card__thumb img { width: 50px; height: 50px; object-fit: cover; border-radius: 4px; }
.dace-decided-card__info { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dace-decided-card__info small { color: #888; }

/* ── Loading state ────────────────────────────────────────── */
.dace-loading { opacity: 0.5; pointer-events: none; }
