/**
 * Inline Field Voting CSS
 * 
 * Styles for the inline field voting system
 */

/* Votable field cells */
.field-votable {
    cursor: pointer;
}

/* Vote states */
.user-voted {
    background-color: #e3f2fd !important;
    border-left: 3px solid #2196f3 !important;
}

.has-consensus {
    background-color: #e8f5e9 !important;
    border-left: 3px solid #4caf50 !important;
}

.is-contested {
    background-color: #fff3e0 !important;
    border-left: 3px solid #ff9800 !important;
}

.voting-in-progress {
    opacity: 0.6;
    pointer-events: none;
}

.voting-in-progress::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 1;
}

.voting-in-progress::after {
    content: '⏳';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    z-index: 2;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Consensus indicator */
.consensus-indicator {
    display: inline-block;
    width: 18px;
    height: 18px;
    background-color: #4caf50;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 18px;
    font-size: 12px;
    margin-left: 4px;
    vertical-align: middle;
}

.consensus-indicator:hover {
    transform: scale(1.2);
}

/* Vote modal */
.field-vote-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.field-vote-modal .modal-dialog {
    margin: 10% auto;
    max-width: 500px;
}

.field-vote-modal .modal-content {
    background-color: #1e293b;
    color: #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.field-vote-modal .modal-header {
    background-color: #0f172a;
    border-bottom: 1px solid #334155;
    padding: 1rem;
}

.field-vote-modal .modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.field-vote-modal .modal-body {
    padding: 1.5rem;
}

.field-vote-modal .modal-footer {
    background-color: #0f172a;
    border-top: 1px solid #334155;
    padding: 1rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.field-vote-modal .close {
    background: none;
    border: none;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: #e2e8f0;
    opacity: 0.7;
    cursor: pointer;
}

.field-vote-modal .close:hover {
    opacity: 1;
    color: #fff;
}

/* Dark theme form controls */
.field-vote-modal .form-control,
.field-vote-modal select,
.field-vote-modal textarea,
.field-vote-modal input[type="email"],
.field-vote-modal input[type="number"] {
    background-color: #334155;
    border: 1px solid #475569;
    color: #e2e8f0;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    width: 100%;
}

.field-vote-modal .form-control:focus,
.field-vote-modal select:focus,
.field-vote-modal textarea:focus,
.field-vote-modal input[type="email"]:focus,
.field-vote-modal input[type="number"]:focus {
    background-color: #475569;
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.field-vote-modal label {
    color: #cbd5e1;
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: block;
}

.field-vote-modal .form-group {
    margin-bottom: 1rem;
}

.field-vote-modal .mt-3 {
    margin-top: 1rem;
}

.field-vote-modal .alert-info {
    background-color: #1e3a5f;
    border: 1px solid #3b82f6;
    color: #93c5fd;
    padding: 0.75rem;
    border-radius: 4px;
}

/* Slider container */
.slider-container {
    padding: 1rem 0;
}

.slider-value-display {
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: #2196f3;
    margin-top: 1rem;
}

.field-vote-modal input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #475569;
    outline: none;
    -webkit-appearance: none;
}

.field-vote-modal input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    transition: background 0.2s;
}

.field-vote-modal input[type="range"]::-webkit-slider-thumb:hover {
    background: #2563eb;
}

.field-vote-modal input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

.field-vote-modal input[type="range"]::-moz-range-thumb:hover {
    background: #2563eb;
}

/* Notification */
.field-vote-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    min-width: 300px;
    padding: 1rem;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Field value display */
.field-value {
    font-weight: 500;
}

/* Vote difference indicator */
.vote-differs {
    color: #ff9800;
    font-weight: bold;
}

.vote-differs::before {
    content: '⚠ ';
}

/* Age bracket selector */
.age-bracket-selector {
    margin: 1rem 0;
    padding: 0.5rem;
    background-color: #f5f5f5;
    border-radius: 4px;
}

.age-bracket-selector label {
    font-weight: 600;
    margin-right: 1rem;
}

.age-bracket-selector select {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid #ced4da;
}

/* Responsive styles */
@media (max-width: 768px) {
    .field-vote-modal .modal-dialog {
        margin: 5% 1rem;
        max-width: 100%;
    }
    
    .field-vote-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
    }
    
    .field-votable::after {
        display: none;
    }
}

/* Table view specific */
.table-view .field-votable {
    padding: 8px;
    min-height: 40px;
}

/* Detail page specific */
.assessment-field-group {
    margin-bottom: 1.5rem;
}

.assessment-field-group label {
    font-weight: 600;
    display: block;
    margin-bottom: 0.5rem;
}

.assessment-field-value {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.assessment-field-value:hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Contested field warning */
.contested-warning {
    display: inline-block;
    margin-left: 0.5rem;
    color: #ff9800;
    font-size: 0.9em;
}

.contested-warning::before {
    content: '⚠️ ';
}

/* Vote count badge */
.vote-count-badge {
    display: inline-block;
    background-color: #6c757d;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75rem;
    margin-left: 4px;
    vertical-align: middle;
}

/* Confidence meter */
.confidence-meter {
    display: inline-block;
    width: 50px;
    height: 4px;
    background-color: #e0e0e0;
    border-radius: 2px;
    margin-left: 8px;
    vertical-align: middle;
    overflow: hidden;
}

.confidence-meter-fill {
    height: 100%;
    background-color: #4caf50;
    transition: width 0.3s ease;
}

.confidence-meter-fill.low {
    background-color: #ff5722;
}

.confidence-meter-fill.medium {
    background-color: #ff9800;
}

.confidence-meter-fill.high {
    background-color: #4caf50;
}
