/**
 * ITERATION 290: Consensus Gate Dark Theme
 * Beautiful dark styling for consensus gates that matches Cognitive Studio's aesthetic
 * ADD THIS to your main CSS file (agent-studio-styles.css or similar)
 */

/* ===================================
   CONSENSUS GATE CONTAINER
   =================================== */

.consensus-gate-full-container {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #2d3e5f;
    border-radius: 12px;
    padding: 20px;
    margin: 12px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ===================================
   CONSENSUS HEADER
   =================================== */

.consensus-header {
    background: linear-gradient(90deg, #0f3460 0%, #1a4d7a 100%);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    border-left: 4px solid #4ecca3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.consensus-header-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.consensus-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: #4ecca3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.consensus-icon {
    font-size: 24px;
    filter: drop-shadow(0 0 8px rgba(78, 204, 163, 0.5));
}

.consensus-settings {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    padding-top: 8px;
    border-top: 1px solid rgba(78, 204, 163, 0.2);
}

.consensus-method {
    background: rgba(78, 204, 163, 0.2);
    padding: 6px 12px;
    border-radius: 6px;
    color: #4ecca3;
    font-weight: 600;
    border: 1px solid rgba(78, 204, 163, 0.3);
}

.consensus-threshold {
    background: rgba(255, 204, 0, 0.2);
    padding: 6px 12px;
    border-radius: 6px;
    color: #ffd700;
    font-weight: 600;
    border: 1px solid rgba(255, 204, 0, 0.3);
}

.consensus-errors {
    background: rgba(230, 57, 70, 0.2);
    padding: 6px 12px;
    border-radius: 6px;
    color: #ff6b81;
    font-weight: 600;
    border: 1px solid rgba(230, 57, 70, 0.3);
}

/* ===================================
   VOTERS CONTAINER
   =================================== */

.consensus-voters-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ===================================
   INDIVIDUAL VOTER SECTION
   =================================== */

.consensus-voter-section {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.8) 0%, rgba(22, 33, 62, 0.6) 100%);
    border: 1px solid rgba(78, 204, 163, 0.3);
    border-radius: 10px;
    padding: 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Subtle glow effect on hover */
.consensus-voter-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(78, 204, 163, 0.5) 50%, 
        transparent 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

.consensus-voter-section:hover {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.9) 0%, rgba(22, 33, 62, 0.8) 100%);
    border-color: rgba(78, 204, 163, 0.5);
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(78, 204, 163, 0.2);
}

.consensus-voter-section:hover::before {
    opacity: 1;
}

/* ===================================
   VOTER HEADER
   =================================== */

.consensus-voter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(78, 204, 163, 0.2);
}

.voter-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: #4ecca3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.voter-icon {
    font-size: 20px;
    filter: drop-shadow(0 0 6px rgba(78, 204, 163, 0.4));
}

.voter-number {
    font-size: 14px;
    color: #93b5c6;
}

.voter-remove-btn {
    background: rgba(230, 57, 70, 0.2);
    border: 1px solid rgba(230, 57, 70, 0.4);
    color: #ff6b81;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.voter-remove-btn:hover {
    background: rgba(230, 57, 70, 0.4);
    border-color: rgba(230, 57, 70, 0.6);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(230, 57, 70, 0.3);
}

/* ===================================
   VOTER CONTENT
   =================================== */

.consensus-voter-content {
    padding: 12px 0;
}

.consensus-voter-gate {
    background: rgba(78, 204, 163, 0.08);
    border-left: 3px solid #4ecca3;
    border-radius: 6px;
    padding: 8px;
}

/* ===================================
   EMPTY VOTER SOCKET
   =================================== */

.consensus-empty-voter {
    background: linear-gradient(135deg, 
        rgba(78, 204, 163, 0.05) 0%, 
        rgba(78, 204, 163, 0.08) 100%
    );
    border: 2px dashed rgba(78, 204, 163, 0.3);
    border-radius: 10px;
    padding: 24px;
    transition: all 0.3s ease;
    text-align: center;
}

.consensus-empty-voter:hover {
    background: linear-gradient(135deg, 
        rgba(78, 204, 163, 0.1) 0%, 
        rgba(78, 204, 163, 0.15) 100%
    );
    border-color: rgba(78, 204, 163, 0.5);
    border-style: solid;
    box-shadow: 0 0 20px rgba(78, 204, 163, 0.2);
}

/* ===================================
   SOCKET PLACEHOLDER
   =================================== */

.consensus-voter-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 8px;
}

.voter-plug {
    font-size: 40px;
    color: #4ecca3;
    margin-bottom: 8px;
    animation: pulse-voter 2s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(78, 204, 163, 0.4));
}

@keyframes pulse-voter {
    0%, 100% { 
        opacity: 0.6; 
        transform: scale(1);
    }
    50% { 
        opacity: 1; 
        transform: scale(1.1);
    }
}

.voter-hint {
    font-size: 16px;
    font-weight: 600;
    color: #4ecca3;
    margin-bottom: 4px;
}

.socket-type-hint {
    font-size: 13px;
    color: #93b5c6;
    font-style: italic;
}

/* ===================================
   DRAG OVER STATES
   =================================== */

.socket-zone--consensus-voter.drag-over {
    background: rgba(78, 204, 163, 0.25);
    border-color: #4ecca3;
    border-style: solid;
    box-shadow: 0 0 24px rgba(78, 204, 163, 0.5);
}

.socket-zone--consensus-voter.compatible-drop-target {
    border-color: #4ecca3;
    box-shadow: 0 0 12px rgba(78, 204, 163, 0.3);
}

.socket-zone--consensus-voter.socket-zone--ready {
    border-color: #4ecca3;
    animation: ready-pulse 1.5s ease-in-out infinite;
}

@keyframes ready-pulse {
    0%, 100% {
        box-shadow: 0 0 8px rgba(78, 204, 163, 0.3);
    }
    50% {
        box-shadow: 0 0 16px rgba(78, 204, 163, 0.5);
    }
}

/* ===================================
   MAX VOTERS MESSAGE
   =================================== */

.consensus-max-voters-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    background: rgba(78, 204, 163, 0.1);
    border: 1px solid rgba(78, 204, 163, 0.3);
    border-radius: 8px;
    color: #4ecca3;
    font-size: 14px;
    font-weight: 600;
}

.max-voters-icon {
    font-size: 22px;
}

/* ===================================
   RESULTS SECTION (EXECUTION)
   =================================== */

.consensus-results-section {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, 
        rgba(78, 204, 163, 0.08) 0%, 
        rgba(15, 52, 96, 0.8) 100%
    );
    border: 1px solid rgba(78, 204, 163, 0.3);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.consensus-results-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    font-weight: 700;
    color: #4ecca3;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(78, 204, 163, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.results-icon {
    font-size: 20px;
}

.consensus-results-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.consensus-decision,
.consensus-confidence,
.consensus-explanation,
.consensus-breakdown {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    background: rgba(26, 26, 46, 0.5);
    border-radius: 6px;
}

.decision-label,
.confidence-label,
.explanation-label,
.breakdown-label {
    font-size: 12px;
    color: #93b5c6;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

.decision-value {
    font-size: 20px;
    font-weight: 700;
}

.decision-value.decision-true {
    color: #4ade80;
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
}

.decision-value.decision-false {
    color: #ff6b81;
    text-shadow: 0 0 10px rgba(255, 107, 129, 0.5);
}

.confidence-value {
    font-size: 18px;
    font-weight: 700;
}

.confidence-value.confidence-high {
    color: #4ade80;
}

.confidence-value.confidence-medium {
    color: #ffd700;
}

.confidence-value.confidence-low {
    color: #ff6b81;
}

.explanation-value {
    color: #e0e0e0;
    font-size: 14px;
    line-height: 1.6;
}

.vote-tally {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    padding: 12px;
    background: rgba(15, 52, 96, 0.5);
    border-radius: 6px;
    border: 1px solid rgba(78, 204, 163, 0.2);
}

.tally-yes {
    color: #4ade80;
    font-weight: 700;
    font-size: 16px;
}

.tally-no {
    color: #ff6b81;
    font-weight: 700;
    font-size: 16px;
}

.tally-total {
    color: #93b5c6;
    font-weight: 700;
    font-size: 16px;
}

.tally-method {
    color: #7b8fa3;
    font-style: italic;
    font-size: 13px;
}

/* ===================================
   RESPONSIVE ADJUSTMENTS
   =================================== */

@media (max-width: 768px) {
    .consensus-settings {
        flex-direction: column;
        gap: 8px;
    }
    
    .consensus-voter-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .vote-tally {
        flex-direction: column;
        gap: 8px;
    }
}