/* KaScada Cloud — панель отправки проекта. Подключается и в редакторе, и на странице загрузки. */

.kc-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    padding: 16px;
}

.kc-modal {
    background: #2a2a2a;
    color: #e0e0e0;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
    width: 100%;
    max-width: 460px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14px;
    box-sizing: border-box;
}

.kc-title {
    color: #edb33b;
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 14px;
}

.kc-file {
    background: #1c1c1c;
    border: 1px solid #3a3a3a;
    border-radius: 4px;
    padding: 8px 10px;
    margin-bottom: 14px;
    word-break: break-all;
}

.kc-file b { color: #edb33b; font-weight: 600; }
.kc-file span { color: #909090; }

.kc-row { margin-bottom: 12px; }
.kc-row label { display: block; margin-bottom: 5px; color: #b8b8b8; font-size: 12px; }

.kc-row select,
.kc-row input[type="text"] {
    width: 100%;
    background: #1c1c1c;
    border: 1px solid #3a3a3a;
    border-radius: 4px;
    color: #e0e0e0;
    padding: 7px 9px;
    font-size: 14px;
    box-sizing: border-box;
    font-family: inherit;
}

.kc-row select:focus,
.kc-row input[type="text"]:focus { outline: none; border-color: #edb33b; }

.kc-hint { color: #808080; font-size: 12px; margin-top: 5px; }
.kc-hint a { color: #edb33b; }

.kc-warn {
    background: #3a3020;
    border: 1px solid #6b5420;
    border-radius: 4px;
    color: #edb33b;
    padding: 8px 10px;
    margin-bottom: 12px;
    font-size: 13px;
}

.kc-error {
    background: #3a2020;
    border: 1px solid #6b2020;
    border-radius: 4px;
    color: #ff8a80;
    padding: 8px 10px;
    margin-bottom: 12px;
    font-size: 13px;
    white-space: pre-line;
}

.kc-buttons { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

.kc-btn {
    background: #3a3a3a;
    border: 1px solid #4a4a4a;
    border-radius: 4px;
    color: #e0e0e0;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
}

.kc-btn:hover { background: #454545; }
.kc-btn:disabled { opacity: 0.5; cursor: default; }

.kc-btn-primary {
    background: #edb33b;
    border-color: #edb33b;
    color: #1c1c1c;
    font-weight: 600;
}

.kc-btn-primary:hover { background: #f5c860; }

.kc-progress-wrap {
    width: 100%;
    height: 12px;
    background: #1c1c1c;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.kc-progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #edb33b 0%, #f5c860 100%);
    transition: width 0.15s ease-out;
}

.kc-progress-text { color: #a0a0a0; font-size: 12px; text-align: center; }

.kc-result-url {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
}

.kc-result-url input {
    flex: 1;
    background: #1c1c1c;
    border: 1px solid #3a3a3a;
    border-radius: 4px;
    color: #edb33b;
    padding: 7px 9px;
    font-size: 13px;
    box-sizing: border-box;
    min-width: 0;
}

.kc-qr {
    display: flex;
    justify-content: center;
    background: #fff;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 6px;
}

.kc-qr img, .kc-qr canvas { display: block; }

.kc-ok { color: #8bc34a; margin-bottom: 12px; }

/* Кнопка, которую модуль добавляет в тулбар редактора */
.kc-toolbar-btn { cursor: pointer; }

.kc-floating-btn {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 99998;
    background: #edb33b;
    color: #1c1c1c;
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* Всплывающее предложение после сохранения файла */
.kc-toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 99999;
    background: #2a2a2a;
    border: 1px solid #edb33b;
    border-radius: 6px;
    padding: 12px 14px;
    color: #e0e0e0;
    font-size: 13px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    max-width: 320px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.kc-toast b { color: #edb33b; }
.kc-toast .kc-buttons { margin-top: 10px; }

/* Зона перетаскивания на странице загрузки */
.kc-dropzone {
    border: 2px dashed #b0b0b0;
    border-radius: 8px;
    padding: 34px 20px;
    text-align: center;
    color: #666;
    cursor: pointer;
    background: #fafafa;
    transition: border-color 0.15s, background 0.15s;
}

.kc-dropzone:hover, .kc-dropzone.kc-dragover {
    border-color: #edb33b;
    background: #fff8e8;
}

.kc-dropzone-title { font-size: 16px; color: #333; margin-bottom: 6px; }
.kc-dropzone-hint { font-size: 13px; }

/* Ссылка на обновление редактора в статусбаре (видна только администраторам) */
.kc-admin-link {
    color: #7a6a45;
    font-size: 11px;
    text-decoration: none;
    white-space: nowrap;
    margin-left: 14px;
}

.kc-admin-link:hover { color: #edb33b; text-decoration: underline; }

.kc-admin-link-floating {
    position: fixed;
    right: 12px;
    bottom: 8px;
    z-index: 99997;
}
