/*
  Dynamic Agility Website
  JavaScript interaction layer
*/

/* Sidebar interaction polish */

.da-sidebar-brand-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
}

.da-sidebar-toggle {
    display: none;
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.76);
    color: var(--da-ink);
    padding: 0.48rem 0.72rem;
    font: inherit;
    font-size: 0.76rem;
    font-weight: 760;
    cursor: pointer;
}

.da-workshop-search {
    margin: 0 0 0.75rem;
    border: 1px solid rgba(37, 99, 235, 0.14);
    border-radius: 1.15rem;
    background: rgba(255, 255, 255, 0.68);
    padding: 0.75rem;
    box-shadow: var(--da-shadow-sm);
}

.da-workshop-search label {
    display: block;
    color: var(--da-muted);
    font-size: 0.72rem;
    font-weight: 780;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.da-workshop-search input {
    width: 100%;
    margin-top: 0.45rem;
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.82);
    color: var(--da-ink);
    padding: 0.62rem 0.72rem;
    font: inherit;
    font-size: 0.86rem;
    outline: none;
}

.da-workshop-search input:focus {
    border-color: rgba(37, 99, 235, 0.42);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.da-workshop-search p {
    margin: 0.45rem 0 0;
    color: var(--da-muted-light);
    font-size: 0.75rem;
    line-height: 1.35;
}

.da-nav-static-link.is-active,
.da-nav-overview.is-active,
.da-nav-subitem.is-active,
.da-nav-overview.is-search-match,
.da-nav-subitem.is-search-match {
    color: var(--da-ink);
    background: rgba(186, 230, 253, 0.58);
}

.da-nav-static-link.is-active {
    border-color: rgba(37, 99, 235, 0.35);
}

.is-filtered-out {
    display: none !important;
}

/* Progress card */

.da-workshop-progress {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(10rem, 18rem) auto;
    gap: 1rem;
    align-items: center;
    max-width: 54rem;
    margin-top: 2rem;
    border: 1px solid rgba(37, 99, 235, 0.15);
    border-radius: 1.35rem;
    background:
            linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(224, 242, 254, 0.62));
    padding: 1rem;
    box-shadow: var(--da-shadow-sm);
}

.da-progress-copy {
    display: grid;
    gap: 0.25rem;
}

.da-progress-copy span {
    color: var(--da-muted-light);
    font-size: 0.72rem;
    font-weight: 820;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.da-progress-copy strong {
    color: var(--da-ink);
    font-size: 0.92rem;
    line-height: 1.25;
}

.da-progress-meter {
    overflow: hidden;
    height: 0.62rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.12);
}

.da-progress-meter span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2563eb, #38bdf8);
    transition: width 240ms ease;
}

.da-workshop-progress button,
.da-focus-action,
.da-mini-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--da-ink);
    padding: 0.58rem 0.82rem;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 760;
    text-decoration: none;
    cursor: pointer;
    transition:
            transform 160ms ease,
            border-color 160ms ease,
            background-color 160ms ease,
            color 160ms ease;
}

.da-workshop-progress button,
.da-mini-action.is-primary {
    border-color: transparent;
    background: linear-gradient(135deg, #2563eb, #0284c7);
    color: white;
}

.da-workshop-progress button:hover,
.da-focus-action:hover,
.da-mini-action:hover {
    transform: translateY(-1px);
    border-color: rgba(37, 99, 235, 0.36);
}

.da-mini-action:disabled {
    cursor: not-allowed;
    opacity: 0.46;
    transform: none;
}

.da-mini-action.is-success {
    border-color: rgba(22, 163, 74, 0.28);
    background: rgba(220, 252, 231, 0.94);
    color: #166534;
}

.da-item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 1rem;
}

.da-exercise-item.is-visited .da-item-label span {
    box-shadow:
            0 0 0 3px rgba(56, 189, 248, 0.18),
            0 0 0 7px rgba(37, 99, 235, 0.08);
}

.da-exercise-item.is-in-agenda {
    border-color: rgba(37, 99, 235, 0.38);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(224, 242, 254, 0.58));
}

.da-focus-action {
    margin-left: auto;
}

.da-focus-action.is-active {
    border-color: transparent;
    background: var(--da-dark);
    color: white;
}

.da-exercise-page.is-focusing .da-source-decks-section,
.da-exercise-page.is-focusing .da-principle-strip,
.da-exercise-page.is-focusing .da-exercise-section:not(.is-focused) {
    display: none;
}

.da-exercise-page.is-focusing .da-exercise-section.is-focused {
    outline: 3px solid rgba(37, 99, 235, 0.14);
    outline-offset: 0.4rem;
}

/* Source deck review */

.da-deck-review {
    margin-top: 1rem;
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.74);
    color: var(--da-ink);
    padding: 0.58rem 0.82rem;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 760;
    cursor: pointer;
}

.da-source-deck-card.is-reviewed {
    border-color: rgba(22, 163, 74, 0.34);
    background:
            linear-gradient(180deg, rgba(240, 253, 244, 0.9), rgba(239, 248, 255, 0.76));
}

.da-source-deck-card.is-reviewed .da-deck-review {
    border-color: rgba(22, 163, 74, 0.24);
    background: rgba(220, 252, 231, 0.92);
    color: #166534;
}

/* Agenda builder */

.da-agenda-panel {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 90;
    width: min(24rem, calc(100vw - 2rem));
    overflow: hidden;
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 1.35rem;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--da-shadow-md);
    backdrop-filter: blur(18px);
}

.da-agenda-header button {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    border: 0;
    background: linear-gradient(135deg, rgba(219, 234, 254, 0.95), rgba(224, 242, 254, 0.78));
    color: var(--da-ink);
    padding: 0.88rem 1rem;
    font: inherit;
    cursor: pointer;
}

.da-agenda-header span {
    font-size: 0.86rem;
    font-weight: 820;
}

.da-agenda-header strong {
    display: inline-flex;
    min-width: 1.7rem;
    height: 1.7rem;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #2563eb;
    color: white;
    font-size: 0.78rem;
}

.da-agenda-panel:not(.is-open) .da-agenda-body {
    display: none;
}

.da-agenda-body {
    max-height: 52vh;
    overflow: auto;
    padding: 0.85rem;
}

.da-agenda-empty {
    margin: 0;
    color: var(--da-muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.da-agenda-list {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.da-agenda-list li {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.55rem;
    align-items: center;
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: 0.95rem;
    background: rgba(255, 255, 255, 0.76);
    padding: 0.55rem;
}

.da-agenda-list span {
    color: #2563eb;
    font-size: 0.72rem;
    font-weight: 820;
}

.da-agenda-list strong {
    color: var(--da-ink);
    font-size: 0.82rem;
    line-height: 1.25;
}

.da-agenda-list button {
    display: inline-flex;
    width: 1.7rem;
    height: 1.7rem;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--da-ink);
    cursor: pointer;
}

.da-agenda-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

/* Next section helper */

.da-next-bar {
    position: fixed;
    left: calc(22rem + 1rem);
    bottom: 1rem;
    z-index: 85;
    display: flex;
    gap: 0.65rem;
    align-items: center;
    max-width: min(34rem, calc(100vw - 29rem));
    border: 1px solid rgba(37, 99, 235, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.55rem;
    box-shadow: var(--da-shadow-sm);
    backdrop-filter: blur(18px);
}

.da-next-bar span {
    overflow: hidden;
    color: var(--da-muted);
    padding-left: 0.55rem;
    font-size: 0.82rem;
    font-weight: 720;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.da-next-bar a,
.da-next-bar button {
    flex: 0 0 auto;
    border: 0;
    border-radius: 999px;
    background: var(--da-dark);
    color: white;
    padding: 0.62rem 0.85rem;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 760;
    text-decoration: none;
    cursor: pointer;
}

/* Contact panel */

.da-contact-panel[hidden] {
    display: none !important;
}

.da-contact-panel {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    background: rgba(7, 20, 38, 0.48);
    padding: 1rem;
    backdrop-filter: blur(10px);
}

.da-contact-card {
    width: min(36rem, 100%);
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 1.6rem;
    background:
            radial-gradient(circle at 10% 0%, rgba(56, 189, 248, 0.18), transparent 20rem),
            linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 248, 255, 0.96));
    color: var(--da-ink);
    padding: 1.4rem;
    box-shadow: var(--da-shadow-lg);
}

.da-contact-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.da-contact-header span {
    color: var(--da-muted-light);
    font-size: 0.74rem;
    font-weight: 820;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.da-contact-header button {
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--da-ink);
    font-size: 1.2rem;
    cursor: pointer;
}

.da-contact-card h2 {
    margin: 0.9rem 0 0;
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 0.95;
    letter-spacing: -0.055em;
}

.da-contact-card p {
    margin: 0.8rem 0 0;
    color: var(--da-muted);
    line-height: 1.55;
}

.da-contact-options {
    display: grid;
    gap: 0.55rem;
    margin-top: 1rem;
}

.da-contact-options label,
.da-contact-note {
    color: var(--da-ink);
    font-size: 0.9rem;
    font-weight: 650;
}

.da-contact-options label {
    display: flex;
    gap: 0.55rem;
    align-items: center;
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: 0.95rem;
    background: rgba(255, 255, 255, 0.68);
    padding: 0.7rem 0.78rem;
}

.da-contact-note {
    display: grid;
    gap: 0.5rem;
    margin-top: 1rem;
}

.da-contact-note textarea {
    width: 100%;
    resize: vertical;
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.82);
    color: var(--da-ink);
    padding: 0.8rem;
    font: inherit;
}

.da-contact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

@media (max-width: 1100px) {
    .da-sidebar-toggle {
        display: inline-flex;
    }

    .da-exercise-sidebar:not(.is-open) .da-sidebar-scroll,
    .da-exercise-sidebar:not(.is-open) .da-sidebar-footer {
        display: none;
    }

    .da-next-bar {
        left: 1rem;
        max-width: calc(100vw - 28rem);
    }
}

@media (max-width: 760px) {
    .da-workshop-progress {
        grid-template-columns: 1fr;
    }

    .da-agenda-panel {
        right: 0.75rem;
        bottom: 0.75rem;
        width: calc(100vw - 1.5rem);
    }

    .da-next-bar {
        display: none;
    }

    .da-contact-card {
        padding: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .da-progress-meter span {
        transition: none;
    }
}
