.download-options-modal__background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(8, 9, 12, 0.72);
    backdrop-filter: blur(3px);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.download-options-modal {
    position: relative;
    background-color: var(--dark-style-block-bg);
    border: 1px solid var(--line);
    padding: 24px;
    border-radius: 14px;
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
    height: 90%;
    width: 70%;
    overflow: auto;

    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Signature accent bar, echoed on the tracker box and inspector panels */
.download-options-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 24px;
    right: 24px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: linear-gradient(90deg, var(--accent-color), transparent 70%);
}

.download-options-modal__titlebar {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.download-options-modal__title {
    font-size: 1.3em;
    font-weight: 700;
    padding-right: 20px;
    position: relative;
    padding-top: 16px;
}

.download-options-modal__title::before {
    content: 'Clip Inspector';
    position: absolute;
    top: -2px;
    left: 0;
    font-family: var(--mono);
    font-size: 0.64rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.download-options-modal__close-button {
    background-color: transparent;
    color: var(--icon-colour);
    border: 1px solid var(--line);
    border-radius: 6px;
    width: 30px;
    height: 30px;
    font-size: 1.1em;
    line-height: 1;
    padding: 0;
    margin: 0;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.download-options-modal__close-button:hover {
    color: var(--icon-colour-hover);
    border-color: var(--accent-color);
}

.download-options-modal__body {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 10px;
}

.download-options-modal__info {
    font-size: 1.2em;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 14px;
    text-align: center;
}

.download-options-modal__body > * {
    margin-bottom: 14px;
}

.download-options-modal__thumbnail {
    width: 55%;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--line);
    box-shadow: var(--block-box-shadow);
}

.download-options-modal__footer {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    border-top: 1px solid var(--line);
    padding-top: 16px;
}

.download-options-modal__footer > * {
    margin-bottom: 0;
}

.download-options-modal__footer > button {
    background-color: var(--accent-color);
    color: white;
    font-weight: 600;
    border: none;
    padding: 11px 22px;
    border-radius: 7px;
    cursor: pointer;
    transition: box-shadow 0.25s, transform 0.15s;
}

.download-options-modal__footer > button:hover {
    box-shadow: 0 0 0 1px var(--accent-color), 0 0 18px var(--accent-color-dim);
    transform: translateY(-1px);
}

.download-options-modal__footer > button:active {
    transform: translateY(0);
}

.download-options-modal__footer > button:disabled {
    background-color: var(--accent-color-disabled);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}


/* Choose path control */

.download-options-modal__download-path-input-container {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    border: 1px solid var(--line);
    border-radius: 7px;
    overflow: hidden;
    width: 100%;
    transition: border-color 0.2s;
}

.download-options-modal__download-path-input-container:focus-within {
    border-color: var(--accent-color);
}

.download-options-modal__download-path-input {
    flex-grow: 2;
    font-family: var(--mono);
    font-size: 0.85em;
    background-color: var(--dark-style-highlight-hover);
    height: 100%;
    padding: 11px 12px;
    color: var(--text);
}

.download-options-modal__download-path-input:focus {
    outline: none;
}

.download-options-modal__download-path-input::placeholder {
    color: var(--text-dim);
}

.download-options-modal__download-path-button {
    background-color: var(--dark-style-highlight);
    color: var(--text);
    font-weight: 600;
    border: none;
    border-left: 1px solid var(--line);
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.download-options-modal__download-path-button:hover {
    background-color: var(--accent-color);
    color: white;
}

.download-options-modal__download-path-input-container--invalid {
    border-color: var(--accent-color);
    animation: shake 0.3s;
}

@keyframes shake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-3px); }
    40%, 60% { transform: translateX(3px); }
}


/* Format toggle — takes the place of the local save-path control from the
   desktop build; a browser can't choose a filesystem path, only a format. */

.download-options-modal__format-toggle {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    border: 1px solid var(--line);
    border-radius: 7px;
    overflow: hidden;
    width: 100%;
}

.download-options-modal__format-option {
    flex: 1;
    background-color: var(--dark-style-highlight-hover);
    color: var(--text-dim);
    font-family: var(--mono);
    font-size: 0.85em;
    font-weight: 600;
    letter-spacing: 0.04em;
    border: none;
    padding: 11px 12px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.download-options-modal__format-option + .download-options-modal__format-option {
    border-left: 1px solid var(--line);
}

.download-options-modal__format-option:hover {
    color: var(--text);
}

.download-options-modal__format-option--selected {
    background-color: var(--accent-color);
    color: white;
}

.download-options-modal__format-option--selected:hover {
    color: white;
}

.download-options-modal__error {
    color: var(--accent-color);
    font-size: 0.85em;
    text-align: center;
}