/* Events — create (Figma "Events" 22316:176194, create columns) — js/screens/events-create.js. Prefix evc-.
   Layout reuses .screen.an / .an-top / .an-head / .an-steps / .an-body / .an-form / .an-intro / .an-foot (announce.css). */

.evc-form { gap: 24px; }
.evc-fields { display: flex; flex-direction: column; gap: 24px; }
.evc-fields.is-p { gap: 16px; }

/* Text inputs (MDS text input, 56px) */
.evc .an-field.evc-field, .evc-cap .an-field.evc-field { flex-direction: row; align-items: center; gap: 8px; min-height: 56px; padding: 8px 16px; }
.evc-field:not(.is-filled) { padding: 16px; }
.evc-field > img { flex: none; }
.evc-field-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.evc-select { padding: 16px; }
.evc-select span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Start / End date box */
.evc-dates { display: flex; flex-direction: column; gap: 16px; padding: 16px; border: 1px solid var(--beerus); border-radius: var(--radius-i-sm); }
.evc-div { height: 1px; background: var(--beerus); }
.evc-date-row { position: relative; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.evc-date-row > span:first-child { flex: 1; font: 400 16px/24px var(--font); color: rgba(0, 0, 0, 0.25); }
.evc-date-chip { flex: none; padding: 4px 8px; border-radius: 4px; background: var(--heles); font: 400 16px/24px var(--font); color: var(--piccolo); }
.evc-date-row:hover .evc-date-chip { background: var(--jiren); }
.evc-date-input { position: absolute; right: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* Textareas (Remarks 56px, descriptions 88px) */
.evc-ta textarea { min-height: 54px; padding: 15px; font-size: 16px; }
.evc-ta.is-tall textarea { min-height: 86px; }
.evc-stack8 { display: flex; flex-direction: column; gap: 8px; }
.evc-hint { font: 400 12px/16px var(--font); color: var(--trunks); }
.evc-help { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.evc-help .evc-count { flex: none; }
.evc-count { text-align: right; }
.evc-count.is-max { color: var(--dodoria); }

/* Switch row */
.evc-switch { display: flex; align-items: center; gap: 10px; padding: 16px; border: 1px solid var(--beerus); border-radius: var(--radius-i-sm); }
.evc-switch > span { flex: 1; min-width: 0; font: 400 16px/24px var(--font); color: var(--trunks); }

/* Participation: Students / Others groups */
.evc-group { display: flex; flex-direction: column; gap: 12px; }
.evc-group-title { font: 400 16px/24px var(--font); color: var(--bulma); }
.evc-fields.is-p .evc-group + .evc-group { margin-top: 16px; }
.evc-staff-row {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 56px; padding: 16px; text-align: left;
  border: 1px solid var(--beerus); border-radius: var(--radius-i-sm); background: var(--gohan);
}
.evc-staff-row:hover { border-color: #CFCFCF; }
.evc-staff-row > img { flex: none; }
.evc-staff-text { flex: 1; min-width: 0; display: flex; flex-direction: column; font: 400 16px/24px var(--font); color: var(--trunks); }
.evc-staff-text small { font: 400 12px/16px var(--font); color: var(--bulma); }

/* Participation cards (Participating Classes / Teachers In-Charge / Accompanying Staff) */
.evc-pcard { border: 1px solid var(--beerus); border-radius: 8px; overflow: hidden; background: linear-gradient(var(--heles), var(--heles)), var(--gohan); }
.evc-pcard-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; font: 400 16px/24px var(--font); color: var(--bulma); }
.evc-pcard-head img { flex: none; }
.evc-pcard-body { display: flex; flex-direction: column; gap: 8px; padding: 8px 16px 12px; }
.evc-pcard-body .evc-select { background: var(--gohan); }
.evc-chips { display: flex; gap: 8px; }
.evc-chip { height: 32px; padding: 4px 8px; border-radius: 4px; background: var(--gohan); font: 400 14px/24px var(--font); color: var(--bulma); white-space: nowrap; }
.evc-chip.is-on { background: var(--piccolo); color: var(--gohan); }
.evc-chip:not(.is-on):hover { background: var(--jiren); }
.evc-picked { font: 400 12px/16px var(--font); color: var(--trunks); }

/* Upload box (Upload Thumbnail / Photo Upload) */
.evc-upload { display: flex; flex-direction: column; align-items: flex-end; gap: 16px; padding: 16px; border: 1px solid var(--beerus); border-radius: var(--radius-i-sm); }
.evc-upload-title { align-self: stretch; font: 400 16px/24px var(--font); color: var(--trunks); }
.evc-drop { border: 0; background: var(--goku); }
.evc-files { align-self: stretch; display: flex; flex-direction: column; border: 1px solid var(--beerus); border-radius: 8px; }
.evc-file { display: flex; flex-direction: column; gap: 12px; padding: 12px 16px 16px; }
.evc-file + .evc-file { border-top: 1px solid var(--beerus); }
.evc-file-row { display: flex; align-items: center; gap: 12px; height: 32px; }
.evc-thumb { flex: none; border: 0.5px solid rgba(0, 0, 0, 0.25); border-radius: 4px; object-fit: cover; }
.evc-caption { flex: 1; min-width: 0; text-align: left; font: 400 14px/24px var(--font); color: var(--trunks); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evc-caption.is-set { color: var(--bulma); }
.evc-icon { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 6px; }
.evc-icon:hover { background: var(--heles); }
.evc-file-meta { font: 400 12px/16px var(--font); color: var(--trunks); }
.evc-add { display: flex; align-items: center; gap: 8px; padding: 8px 16px 8px 8px; border-radius: 8px; background: var(--piccolo); font: 700 14px/24px var(--font); color: var(--goten); }
.evc-add:hover { filter: brightness(1.08); }

/* Event Summary */
.evc-sum { display: flex; flex-direction: column; gap: 16px; padding: 16px; border-radius: 8px; background: var(--goku); }
.evc-sum-head { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; font: 700 18px/28px var(--font); color: var(--bulma); }
.evc-sum-head span { flex: 1; }
.evc-sum-head img { transition: transform .15s; }
.evc-sum:not(.is-open) .evc-sum-head img { transform: rotate(180deg); }
.evc-sum-card { display: flex; flex-direction: column; gap: 12px; padding: 12px 16px; border-radius: 8px; background: var(--gohan); }
.evc-sum-row { display: flex; gap: 2px; font: 400 12px/16px var(--font); }
.evc-sum-row span { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
.evc-sum-row span:first-child { font-weight: 500; color: var(--bulma); }
.evc-sum-row span:last-child { color: var(--trunks); }

/* Select Event Type sheet (22316:178103) */
.sheet.evc-type-sheet { gap: 16px; padding-bottom: 16px; }
.evc-types { display: flex; flex-direction: column; }
.evc-type { display: flex; align-items: center; gap: 12px; width: 100%; padding: 16px 0; border-bottom: 1px solid var(--beerus); text-align: left; }
.evc-type:last-child { border-bottom: 0; }
.evc-type:hover { background: var(--heles); }
.evc-type-ico { flex: none; width: 32px; height: 32px; display: grid; place-items: center; }
.evc-type-name { flex: 1; min-width: 0; font: 700 16px/24px var(--font); color: var(--bulma); }

/* Event Master: Event Group segmented control */
.evc-seg-card { display: flex; flex-direction: column; gap: 16px; padding: 16px; border: 1px solid var(--beerus); border-radius: var(--radius-i-sm); }
.evc-seg-card > p { font: 400 16px/24px var(--font); color: var(--trunks); }
.evc-seg { display: flex; gap: 4px; padding: 4px; border-radius: 8px; background: var(--goku); }
.evc-seg-btn { flex: 1 1 0; height: 40px; border-radius: 6px; font: 700 14px/24px var(--font); color: var(--bulma); }
.evc-seg-btn.is-on { background: var(--piccolo); color: var(--gohan); }
.evc-seg-btn:not(.is-on):hover { background: var(--heles); }

/* Multi-select sheet + caption sheet */
.evc-multi { display: flex; flex-direction: column; max-height: 50vh; overflow-y: auto; }
.evc-multi-row { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--beerus); font: 400 16px/24px var(--font); color: var(--bulma); cursor: pointer; }
.evc-multi-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.evc-check { flex: none; position: relative; width: 24px; height: 24px; }
.evc-check::before { content: ''; position: absolute; inset: 4px; border: 1.5px solid var(--trunks); border-radius: 4px; }
.evc-multi-row input:checked + .evc-check::before { border-color: var(--piccolo); background: var(--piccolo); }
.evc-multi-row input:checked + .evc-check::after { content: ''; position: absolute; left: 9px; top: 6px; width: 5px; height: 9px; border: solid var(--gohan); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.evc-multi-row input:focus-visible + .evc-check::before { box-shadow: 0 0 0 4px rgba(78, 70, 180, 0.2); }
.evc-multi-btns { margin-top: 4px; }
.evc-cap { display: flex; flex-direction: column; gap: 16px; }

/* Fixes after comparing with Figma */
.evc .an-step { width: auto; }
.evc .an-steps { gap: 8px; }
.evc-seg-btn { display: flex; align-items: center; justify-content: center; text-align: center; }

/* ---------- Crop Photo (Class Photo uploads) — full screen over the phone ---------- */
.evc-crop { position: absolute; inset: 0; z-index: 60; display: flex; flex-direction: column; background: #000; color: #fff; touch-action: none; user-select: none; -webkit-user-select: none; }
.evc-crop-head { flex: none; display: flex; align-items: center; gap: 8px; padding: calc(var(--sb-dash) + 4px) 12px 12px; }
.evc-crop-x { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; }
.evc-crop-x img { filter: invert(1); }
.evc-crop-sp { flex: none; width: 40px; }
.evc-crop-title { flex: 1; display: flex; flex-direction: column; align-items: center; font: 700 18px/24px var(--font); }
.evc-crop-title span { font: 400 12px/16px var(--font); color: rgba(255, 255, 255, 0.7); }
.evc-crop-stage { position: relative; flex: 1; min-height: 0; margin: 8px 16px; overflow: hidden; }
.evc-crop-img { position: absolute; display: block; pointer-events: none; -webkit-user-drag: none; }
/* The box's huge shadow dims everything outside the crop area */
.evc-crop-box { position: absolute; border: 1.5px solid #fff; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6); cursor: move; touch-action: none; }
.evc-crop-grid { position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to right, transparent calc(33.33% - 0.5px), rgba(255, 255, 255, 0.45) calc(33.33% - 0.5px), rgba(255, 255, 255, 0.45) calc(33.33% + 0.5px), transparent calc(33.33% + 0.5px), transparent calc(66.66% - 0.5px), rgba(255, 255, 255, 0.45) calc(66.66% - 0.5px), rgba(255, 255, 255, 0.45) calc(66.66% + 0.5px), transparent calc(66.66% + 0.5px)),
    linear-gradient(to bottom, transparent calc(33.33% - 0.5px), rgba(255, 255, 255, 0.45) calc(33.33% - 0.5px), rgba(255, 255, 255, 0.45) calc(33.33% + 0.5px), transparent calc(33.33% + 0.5px), transparent calc(66.66% - 0.5px), rgba(255, 255, 255, 0.45) calc(66.66% - 0.5px), rgba(255, 255, 255, 0.45) calc(66.66% + 0.5px), transparent calc(66.66% + 0.5px)); }
/* Corner handles: thick L-shaped brackets with a 40px touch area */
.evc-crop-h { position: absolute; width: 40px; height: 40px; touch-action: none; }
.evc-crop-h::before { content: ''; position: absolute; width: 20px; height: 20px; border: 0 solid #fff; pointer-events: none; }
.evc-crop-h.is-nw { left: -20px; top: -20px; cursor: nwse-resize; } .evc-crop-h.is-nw::before { left: 17px; top: 17px; border-left-width: 4px; border-top-width: 4px; }
.evc-crop-h.is-ne { right: -20px; top: -20px; cursor: nesw-resize; } .evc-crop-h.is-ne::before { right: 17px; top: 17px; border-right-width: 4px; border-top-width: 4px; }
.evc-crop-h.is-sw { left: -20px; bottom: -20px; cursor: nesw-resize; } .evc-crop-h.is-sw::before { left: 17px; bottom: 17px; border-left-width: 4px; border-bottom-width: 4px; }
.evc-crop-h.is-se { right: -20px; bottom: -20px; cursor: nwse-resize; } .evc-crop-h.is-se::before { right: 17px; bottom: 17px; border-right-width: 4px; border-bottom-width: 4px; }
.evc-crop-foot { flex: none; display: flex; flex-direction: column; gap: 16px; padding: 12px 20px 34px; }
.evc-crop-ratios { display: flex; justify-content: center; gap: 8px; }
.evc-crop-ratio { height: 32px; padding: 0 14px; border-radius: 100px; font: 500 14px/20px var(--font); color: #fff; background: rgba(255, 255, 255, 0.14); }
.evc-crop-ratio.is-on { background: #fff; color: #000; }
.evc-crop-btns { display: flex; gap: 12px; }
.evc-crop-btns .btn { flex: 1; }
.evc-crop-btns .btn-secondary { background: rgba(255, 255, 255, 0.14); color: #fff; border-color: transparent; }
