/* gate7.css - gate7, STEPS, PROMPTS tabs, task-record */

/* ========================================
   FOUC FIX - OKAMŽITÉ SKRYTIE Gate7 v target tabs
   ======================================== */
body.hash-analytics .gate7-tab-content,
body.hash-analytics .gate7-steps-content,
body.hash-settings .gate7-tab-content,
body.hash-settings .gate7-steps-content,
body.hash-archive .gate7-tab-content,
body.hash-archive .gate7-steps-content,
body.hash-modules .gate7-tab-content,
body.hash-modules .gate7-steps-content {
    display: none !important;
    visibility: hidden !important;
}

/* Permanently hide right-side contextual module buttons (Session, Usage, Verify, Memory, Phases) */
#gate7-contextual-modules,
.gate7-contextual-modules,
.gate7-contextual-btn {
    display: none !important;
}

/* Tabs replaced by module indicator; hide if any remain */
.gate7-tabs,
.gate7-tab {
    display: none !important;
}

#gate7TaskRecordBar.contextual-hidden {
    display: none !important;
}

#gate7TaskRecordBar.contextual-transition {
    transition: opacity 0.3s ease, transform 0.2s ease;
}

.view-container.contextual-transition {
    transition: opacity 0.3s ease;
}

.gate7-contextual-modules {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 1;
    min-width: 0;
    margin-left: auto;
    max-width: 50%;
}

.gate7-contextual-modules.contextual-transition {
    transition: opacity 0.3s ease;
}

.gate7-contextual-btn,
.gate7-verification-indicator {
    padding: 5px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.gate7-contextual-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #1a1a1a;
    border: 1px solid #333;
    color: #b0b0b0;
    cursor: pointer;
}

.gate7-contextual-btn:hover {
    background: #252525;
    border-color: #4CAF50;
    color: #e0e0e0;
    box-shadow: 0 0 12px rgba(76, 175, 80, 0.2);
}

.gate7-contextual-btn-icon {
    font-size: 0.9em;
    line-height: 1;
}

.gate7-contextual-btn-label {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gate7-verification-indicator {
    background: rgba(76, 175, 80, 0.15);
    border: 1px solid rgba(76, 175, 80, 0.4);
    color: #81c784;
    pointer-events: none;
}

@media (max-width: 900px) {
    .gate7-contextual-modules {
        max-width: 40%;
    }
}

@media (max-width: 600px) {
    .gate7-contextual-modules {
        max-width: 100%;
        margin-left: 0;
    }
}

.gate7-contextual-btn.contextual-transition {
    animation: gate7-btn-fade-in 0.25s ease;
}

@keyframes gate7-btn-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.gate7-contextual-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.gate7-contextual-overlay.is-open {
    display: flex !important;
    pointer-events: auto;
}

.gate7-contextual-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.gate7-contextual-overlay.is-visible .gate7-contextual-overlay-backdrop {
    opacity: 1;
}

.gate7-contextual-overlay-panel {
    position: relative;
    min-width: 280px;
    max-width: 90vw;
    max-height: 70vh;
    background: #1a1a1a;
    border: 1px solid rgba(76, 175, 80, 0.35);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(76, 175, 80, 0.15);
    overflow: hidden;
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.gate7-contextual-overlay.is-visible .gate7-contextual-overlay-panel {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.gate7-contextual-overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #333;
}

.gate7-contextual-overlay-title {
    margin: 0;
    font-size: 15px;
    color: #4CAF50;
}

.gate7-contextual-overlay-close {
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    color: #888;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
}

.gate7-contextual-overlay-close:hover {
    background: #333;
    color: #e0e0e0;
}

.gate7-contextual-overlay-body {
    padding: 16px;
    overflow-y: auto;
    max-height: 60vh;
    font-size: 13px;
    color: #b0b0b0;
}

.gate7-contextual-overlay-hint {
    font-size: 11px;
    color: #666;
    margin-top: 8px;
}

/* GATE 7: TaskRecord-driven navigation */
#gate7ModuleIndicator {
    width: 240px;
    min-width: 240px;
    max-width: 240px;
    flex-shrink: 0;
}

.gate7-taskrecord-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    background: #0a0a0a;
    border-bottom: 1px solid #222;
    flex-shrink: 0;
    font-size: 0.8rem;
}

.gate7-steps {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.gate7-step {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid #2a2a2a;
    background: #121212;
    color: #888;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.gate7-step.active {
    background: #4CAF50;
    border-color: #4CAF50;
    color: #fff;
}

.gate7-step.completed {
    background: #1a1a1a;
    color: #5cb85c;
    border-color: #2a2a2a;
}

.gate7-step.disabled {
    cursor: default;
    opacity: 0.5;
}

.gate7-step:not(.disabled):hover {
    background: #1a1a1a;
    border-color: #4CAF50;
}

.gate7-next-action-card {
    flex-shrink: 0;
    min-width: 200px;
    padding: 6px 10px;
    background: #121212;
    border: 1px solid #2a2a2a;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gate7-next-action-card .label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    flex-shrink: 0;
}

.gate7-next-action-card .action-btn {
    padding: 3px 8px;
    background: #4CAF50;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 400;
    cursor: pointer;
}

.gate7-next-action-card .action-btn:disabled {
    background: #2a2a2a;
    color: #555;
    cursor: default;
}

.gate7-next-action-card .no-actions,
.gate7-next-action-card #gate7NextActionContent:not(.no-actions) {
    font-size: 0.75rem;
    font-weight: 400;
    color: #ccc;
    flex: 1;
    min-width: 0;
    line-height: 1.1;
    white-space: normal;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gate7-next-action-card .no-actions {
    color: #555;
}

.gate7-next-action-card.next-action-blink {
    animation: next-action-blink 0.6s ease-out;
}

@keyframes next-action-blink {
    0%, 100% { box-shadow: 0 0 0 0 transparent; }
    50% { box-shadow: 0 0 12px 2px rgba(76, 175, 80, 0.5); }
}

/* Gate 7: Tabs [STEPS] | [PROMPTS] */
.gate7-tabs {
    display: flex;
    gap: 0;
    flex-shrink: 0;
}

.gate7-tab {
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    background: #121212;
    border: 1px solid #2a2a2a;
    color: #888;
    cursor: pointer;
    border-radius: 4px 4px 0 0;
    margin-right: 2px;
    transition: all 0.2s;
    vertical-align: middle;
}

.gate7-tab:hover {
    background: #1a1a1a;
    color: #e0e0e0;
}

.gate7-tab.active {
    background: #0a0a0a;
    color: #4CAF50;
    border-bottom-color: transparent;
}

/* Default: hidden – zobrazí len JS pri aktívnom view (truthEngine, promptMode) */
.gate7-tab-content {
    display: none;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    padding: 0;
}

.gate7-steps-content {
    display: none;
    flex-wrap: nowrap;
    align-items: center;
}

.gate7-phase-detail {
    flex: 1;
    flex-grow: 1;
    min-width: 180px;
    font-size: 0.75rem;
    line-height: 1.25;
    color: #ccc;
    padding: 6px 10px;
    background: #121212;
    border: 1px solid #2a2a2a;
    border-radius: 4px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 80px;
    white-space: normal;
    word-break: break-word;
    display: block;
}

.gate7-phase-detail::-webkit-scrollbar {
    width: 4px;
}

.gate7-phase-detail::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 2px;
}

.gate7-phase-detail::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 2px;
}

.gate7-prompts-content {
    flex-wrap: nowrap;
}

.gate7-prompt-dropdown {
    min-width: 140px;
    max-width: 220px;
    padding: 6px 8px;
    font-size: 11px;
    background: #1a1a1a;
    border: 1px solid #333;
    color: #e0e0e0;
    border-radius: 4px;
}

.gate7-prompt-icon-btn {
    padding: 6px 8px;
    font-size: 12px;
    background: #252525;
    border: 1px solid #333;
    color: #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.gate7-prompt-icon-btn:hover {
    background: #333;
    border-color: #2196F3;
}

.gate7-prompt-run-btn {
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    background: #4CAF50;
    border: 1px solid #4CAF50;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.gate7-prompt-run-btn:hover {
    background: #45a049;
}

.gate7-prompt-new-btn {
    padding: 6px 10px;
    font-size: 10px;
    background: #252525;
    border: 1px solid #333;
    color: #888;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.gate7-prompt-new-btn:hover {
    background: #333;
    color: #e0e0e0;
}

.gate7-prompt-backup-btn {
    padding: 6px 10px;
    font-size: 10px;
    background: #252525;
    border: 1px solid #333;
    color: #888;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.gate7-prompt-backup-btn:hover {
    background: #333;
    border-color: #2196F3;
    color: #e0e0e0;
}

.gate7-prompt-chip {
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 4px;
    border: 1px solid #333;
    background: #1a1a1a;
    color: #888;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.gate7-prompt-chip:hover {
    background: #252525;
    border-color: #4CAF50;
    color: #e0e0e0;
}

.gate7-prompt-chip.active {
    background: #2196F3;
    border-color: #2196F3;
    color: #fff;
}

.gate7-prompt-chip.enabled {
    border-left: 3px solid #28a745;
}

/* Prompt Editor Modal */
.gate7-prompt-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gate7-prompt-modal {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    min-width: 400px;
    max-width: 90vw;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.gate7-prompt-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #333;
}

.gate7-prompt-modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: #4CAF50;
}

.gate7-prompt-modal-close {
    width: 32px;
    height: 32px;
    font-size: 24px;
    line-height: 1;
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    border-radius: 4px;
}

.gate7-prompt-modal-close:hover {
    background: #333;
    color: #fff;
}

.gate7-prompt-modal-body {
    padding: 16px;
    overflow-y: auto;
}

.gate7-prompt-modal-input {
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 12px;
    font-size: 13px;
    background: #252525;
    border: 1px solid #333;
    color: #e0e0e0;
    border-radius: 4px;
    box-sizing: border-box;
}

.gate7-prompt-modal-textarea {
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 12px;
    font-size: 13px;
    background: #252525;
    border: 1px solid #333;
    color: #e0e0e0;
    border-radius: 4px;
    resize: vertical;
    min-height: 120px;
    box-sizing: border-box;
}

.gate7-prompt-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gate7-prompt-modal-btn {
    padding: 8px 16px;
    font-size: 12px;
    background: #252525;
    border: 1px solid #333;
    color: #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.gate7-prompt-modal-btn:hover {
    background: #333;
}

.gate7-prompt-modal-run {
    background: #4CAF50;
    border-color: #4CAF50;
    color: #fff;
}

/* Gate7 Truth toolbar: select dropdown */
#gate7TruthSelect {
    background: #0d0d1a;
    color: rgb(136, 136, 136);
    border: 1px solid #333;
    border-radius: 4px;
    padding: 0.2rem 0.4rem;
    font-size: 0.75rem;
}

/* Gate7 Truth toolbar: all buttons in #gate7TruthToolbar */
.gate7-truth-btn {
    background: #0d0d1a;
    color: rgb(136, 136, 136);
    border: 1px solid #333;
    border-radius: 4px;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.gate7-truth-btn:hover {
    color: rgb(76, 175, 80);
    background: rgb(10, 26, 10);
    border: 1px solid rgb(76, 175, 80);
}

/* Gate7 Truth toolbar: same highlight for any active tab button (Verify, Agent Verify, Activate when applied) */
.gate7-truth-btn.gate7-active {
    background: rgba(76, 175, 80, 0.2) !important;
    border-color: #4CAF50 !important;
    color: #4CAF50 !important;
    box-shadow: 0 0 12px rgba(76, 175, 80, 0.25);
}

/* Activate button: green flash on click */
#gate7TruthActivate.activate-flash {
    animation: gate7-activate-flash 0.2s ease-out;
}

@keyframes gate7-activate-flash {
    0% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.8); }
    50% { box-shadow: 0 0 20px 4px rgba(76, 175, 80, 0.6); }
    100% { box-shadow: 0 0 0 0 transparent; }
}

/* Gate7 header: "A" badge when strategy activated */
.gate7-active-badge {
    display: inline-block;
    padding: 0.1rem 0.35rem;
    font-size: 0.65rem;
    font-weight: 700;
    background: #4CAF50;
    color: #000;
    border-radius: 4px;
}
