/*
  Coding Ireland proprietary interactive activity
  Copyright (c) 2017-2026 Coding Ireland. All rights reserved.
  Ref: CI-english-draft-table
*/

/* Every panel below is laid out with flex or grid, and a class selector beats the
   user agent's `[hidden] { display: none }`. Without this the picker, the preview
   warning and the second draft all show on top of a perfectly good first draft. */
.dt-activity [hidden] { display: none !important; }

.dt-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* ------------------------------------------------------------ preview warning */

.dt-preview-warning {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0.55rem 0.8rem;
    border-radius: 8px;
    background: #FFF4E5;
    border: 1px solid #F0C489;
    color: #8A5A17;
    font-weight: 600;
    font-size: 0.92rem;
}

/* --------------------------------------------------------------------- brief */

.dt-brief {
    border: 1px solid var(--activity-border, #DDD9D0);
    border-left: 4px solid var(--activity-accent, #2C5AA0);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    background: #FFFFFF;
}

.dt-brief-heading {
    margin: 0 0 0.4rem;
    font-size: 1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.dt-brief-body { font-size: 0.97rem; line-height: 1.55; }
.dt-brief-body p:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------- version tabs */

.dt-versions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.dt-version-tab {
    border: 1px solid var(--activity-border, #DDD9D0);
    background: #FFFFFF;
    border-radius: 999px;
    padding: 0.4rem 0.95rem;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    color: #4A5159;
}

.dt-version-tab:hover { background: #F4F2EC; }

.dt-version-tab.is-active {
    background: var(--activity-accent, #2C5AA0);
    border-color: var(--activity-accent, #2C5AA0);
    color: #FFFFFF;
}

.dt-tab-both { font-style: italic; }

.dt-carry-note {
    font-size: 0.88rem;
    color: #5A6169;
    font-style: italic;
}

.dt-saved {
    margin-left: auto;
    font-size: 0.86rem;
    color: #5A6169;
    font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------- stage */

.dt-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 19rem;
    gap: 1rem;
    align-items: start;
}

/* Both drafts at once is the point of the activity: the student sees what they
   changed rather than remembering it. */
.dt-both .dt-stage { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 19rem; }
.dt-both .dt-pane { display: flex !important; }

.dt-pane {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 0;
}

.dt-pane-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
}

.dt-pane-title { margin: 0; font-size: 1rem; font-weight: 800; }
.dt-count { font-size: 0.86rem; color: #5A6169; font-variant-numeric: tabular-nums; }

.dt-redraft-prompt {
    background: #EAF0F9;
    border-radius: 6px;
    padding: 0.5rem 0.7rem;
    font-size: 0.92rem;
    color: #24405F;
}

.dt-input {
    width: 100%;
    min-height: 16rem;
    resize: vertical;
    border: 1px solid var(--activity-border, #DDD9D0);
    border-radius: 8px;
    padding: 0.8rem 0.9rem;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.65;
    background: #FFFFFF;
}

.dt-input:focus {
    outline: 2px solid var(--activity-accent, #2C5AA0);
    outline-offset: 1px;
}

.dt-input[readonly] { background: #F7F6F2; }

/* ----------------------------------------------------------------- side panel */

.dt-side {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    border: 1px solid var(--activity-border, #DDD9D0);
    border-radius: 8px;
    padding: 0.85rem 0.95rem;
    background: #FBFAF7;
}

.dt-side-heading {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
}

.dt-sub-heading {
    margin: 0 0 0.25rem;
    font-size: 0.86rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #4A5159;
}

.dt-sub-note { margin: 0 0 0.45rem; font-size: 0.82rem; color: #5A6169; }
.dt-measure-empty { margin: 0; font-size: 0.9rem; color: #5A6169; }

.dt-measure-list { list-style: none; margin: 0; padding: 0; }

.dt-measure-list li {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.28rem 0;
    border-bottom: 1px solid #EDECE6;
    font-size: 0.9rem;
}

.dt-measure-list li:last-child { border-bottom: none; }
.dt-m-label { color: #4A5159; }
.dt-m-value { font-weight: 700; font-variant-numeric: tabular-nums; }

.dt-delta { font-weight: 700; font-size: 0.82rem; margin-left: 0.2rem; }
.dt-up { color: #3F6B4A; }
.dt-down { color: #8A5A17; }
.dt-same { color: #8A8F95; font-weight: 600; }

.dt-range {
    font-size: 0.76rem;
    font-weight: 700;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
}

.dt-in { background: #EAF1EB; color: #3F6B4A; }
.dt-out { background: #F8EDEB; color: #B03A2E; }

/* --------------------------------------------------------------- sentence bars */

.dt-bars { display: flex; flex-direction: column; gap: 3px; }

.dt-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 1.6rem;
    height: 1.05rem;
    border-radius: 3px;
    background: var(--activity-accent, #2C5AA0);
    padding-right: 0.28rem;
}

/* A very long sentence and a very short one are the two things worth seeing at a
   glance. Neither is a fault -- both are choices the writer may not know they made. */
.dt-bar-long { background: #B03A2E; }
.dt-bar-short { background: #3F6B4A; }

.dt-bar-n {
    color: #FFFFFF;
    font-size: 0.68rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.dt-repeat-list, .dt-opener-list, .dt-check-list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.88rem;
}

.dt-repeat-list li, .dt-opener-list li { padding: 0.18rem 0; }
.dt-check-list li {
    padding: 0.35rem 0 0.35rem 1rem;
    position: relative;
    line-height: 1.45;
}

.dt-check-list li::before {
    content: "\f0eb";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 0.38rem;
    color: #B8892C;
    font-size: 0.8rem;
}

/* --------------------------------------------------------------------- picker */

.dt-picker {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 40;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: min(28rem, 92vw);
    background: #FFFFFF;
    border: 1px solid var(--activity-border, #DDD9D0);
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 10px 30px rgba(27, 31, 35, 0.18);
}

.dt-picker-quote {
    margin: 0;
    font-style: italic;
    background: #F4F2EC;
    border-radius: 6px;
    padding: 0.5rem 0.65rem;
    font-size: 0.93rem;
}

.dt-picker-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.dt-tag {
    border: 1px solid var(--activity-border, #DDD9D0);
    background: #FFFFFF;
    border-radius: 999px;
    padding: 0.32rem 0.7rem;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
}

.dt-tag:hover { background: #F4F2EC; }

.dt-tag.is-chosen {
    background: var(--activity-accent, #2C5AA0);
    border-color: var(--activity-accent, #2C5AA0);
    color: #FFFFFF;
}

.dt-picker-actions { display: flex; gap: 0.4rem; }
.dt-primary {
    background: var(--activity-accent, #2C5AA0) !important;
    color: #FFFFFF !important;
    border-color: var(--activity-accent, #2C5AA0) !important;
}

/* ---------------------------------------------------------------------- marks */

.dt-marks-wrap {
    border: 1px solid var(--activity-border, #DDD9D0);
    border-radius: 8px;
    padding: 0.75rem 0.9rem;
    background: #FFFFFF;
}

.dt-marks { list-style: none; margin: 0.4rem 0 0; padding: 0; display: flex;
            flex-direction: column; gap: 0.35rem; }

.dt-mark {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    background: #F7F6F2;
    font-size: 0.9rem;
}

.dt-mark-tag {
    font-weight: 800;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #8A5A17;
    white-space: nowrap;
}

.dt-mark-quote {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-style: italic;
}

.dt-mark-drop {
    border: none;
    background: transparent;
    cursor: pointer;
    color: #8A8F95;
    padding: 0.1rem 0.25rem;
}

.dt-mark-drop:hover { color: #B03A2E; }

/* -------------------------------------------------------------- display mode */

body.display-mode .dt-preview-warning,
body.display-mode .dt-picker { display: none !important; }

body.display-mode .dt-input { background: #F7F6F2; }

/* ------------------------------------------------------------------ narrow */

@media (max-width: 62rem) {
    .dt-stage, .dt-both .dt-stage { grid-template-columns: minmax(0, 1fr); }
    .dt-side { order: 3; }
}
