/* Voting Widget Styles */

/* Base voting widget */
.vote-widget {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 40px;
}

.vote-widget-claim {
    min-width: 50px;
}

.vote-widget-evidence {
    min-width: 35px;
}

.vote-widget-comment {
    min-width: 30px;
}

/* Vote buttons */
.vote-btn {
    background: none;
    border: none;
    color: #828282;
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.2s ease;
}

.vote-btn:hover {
    color: #ff6600;
}

.vote-btn.voted {
    color: #ff6600;
    font-weight: bold;
}

.vote-btn.vote-up.voted {
    color: #ff6600;
}

.vote-btn.vote-down.voted {
    color: #0066cc;
}

/* Small vote buttons (for evidence) */
.vote-btn-small {
    background: none;
    border: none;
    color: #828282;
    cursor: pointer;
    font-size: 12px;
    padding: 0 3px;
    line-height: 1;
}

.vote-btn-small:hover {
    color: #ff6600;
}

.vote-btn-small.voted {
    color: #ff6600;
}

/* Tiny vote buttons (for comments) */
.vote-btn-tiny {
    background: none;
    border: none;
    color: #828282;
    cursor: pointer;
    font-size: 12px;
    padding: 0 2px;
    line-height: 1;
}

.vote-btn-tiny:hover {
    color: #ff6600;
}

.vote-btn-tiny.voted {
    color: #ff6600;
}

/* Inline vote buttons (for tags) */
.vote-btn-inline {
    background: none;
    border: none;
    color: #828282;
    cursor: pointer;
    font-size: 9px;
    padding: 0 2px;
    vertical-align: middle;
}

.vote-btn-inline:hover {
    color: #ff6600;
}

.vote-btn-inline.voted {
    color: #ff6600;
}

/* Vote scores */
.vote-score {
    color: #000000;
    font-size: 11px;
    font-weight: normal;
    min-width: 20px;
    text-align: center;
}

.vote-score-large {
    font-size: 14px;
    font-weight: bold;
    min-width: 30px;
}

.vote-score-small {
    font-size: 10px;
    min-width: 20px;
}

.vote-score-tiny {
    font-size: 9px;
    min-width: 15px;
}

.vote-score-inline {
    font-size: 9px;
    color: #828282;
    margin: 0 2px;
}

/* Score colors based on value */
.vote-score[data-score^="-"] {
    color: #828282;
}

.vote-score-large[data-score^="-"] {
    color: #505050;
}

/* Voting animations */
@keyframes voteFlash {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.vote-widget.htmx-swapping {
    opacity: 0.6;
}

.vote-widget.htmx-added {
    animation: voteFlash 0.3s ease;
}

/* Inline voting for tags */
.vote-inline {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: 4px;
}

/* Vote hover tooltips */
.vote-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
}

/* Controversy indicator */
.controversy-badge {
    display: inline-block;
    background: #ffa500;
    color: #fff;
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 2px;
    margin-left: 4px;
    font-weight: bold;
}

/* Vote breakdown (for detailed views) */
.vote-breakdown {
    font-size: 10px;
    color: #828282;
    margin-top: 2px;
}

.vote-breakdown .upvotes {
    color: #059862;
}

.vote-breakdown .downvotes {
    color: #d93025;
}

/* Disabled voting state */
.vote-widget.disabled .vote-btn {
    cursor: not-allowed;
    opacity: 0.5;
}

.vote-widget.disabled .vote-btn:hover {
    color: #828282;
}

/* Loading state */
.vote-loading {
    display: inline-block;
    width: 10px;
    height: 10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #ff6600;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    /* Keep voting widgets consistent */
    .vote-widget {
        min-width: 50px;  /* Ensure consistent width */
    }
    
    .vote-widget-claim {
        min-width: 60px;
    }
    
    .vote-widget-evidence {
        min-width: 45px;
    }
    
    .vote-widget-comment {
        min-width: 40px;
    }
    
    /* Make buttons larger for touch targets (44px minimum recommended) */
    .vote-btn {
        padding: 8px 10px;
        font-size: 20px;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Adjust score display */
    .vote-score {
        font-size: 13px;
        padding: 4px 0;
    }
    
    .vote-score-large {
        font-size: 18px;
        padding: 6px 0;
    }
}

.vote-btn-upvoted {
    background-color: #e8f5e8;
    color: #059862;
}

.vote-btn-upvoted:hover {
    background-color: #d4edd4;
}

.vote-btn-downvoted {
    background-color: #fce8e8;
    color: #d93025;
}

.vote-btn-downvoted:hover {
    background-color: #f9d4d4;
}

/* Disabled vote buttons */
.vote-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.vote-btn.disabled:hover {
    color: #828282; /* Don't change color on hover */
}

/* Text-based voting widget */
.vote-widget-text {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
}

.vote-link {
    color: #828282;
    text-decoration: none;
    cursor: pointer;
}

.vote-link:hover {
    text-decoration: underline;
    color: #000;
}

.vote-link.voted {
    color: #ff6600;
    font-weight: bold;
}

.vote-link-disabled {
    color: #ccc;
    cursor: default;
}

.vote-score-text {
    color: #000;
    font-weight: normal;
    margin: 0 2px;
}

/* Ensure proper spacing in claim items */
.claim-vote .vote-widget-text {
    padding-top: 2px;
}

/* Tag voting styles */
.tag-vote-wrapper {
    display: inline-block;
    margin-right: 10px;
    margin-bottom: 5px;
}

.tag-with-voting {
    display: inline-flex;
    align-items: center;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    padding: 0;
}

.tag-with-voting.tag-field {
    background-color: #e8f4f8;
}

.tag-with-voting.tag-quality {
    background-color: #fef8e8;
}

.tag-with-voting .tag.tag-field,
.tag-with-voting .tag.tag-quality {
    background-color: transparent;
}

.tag-with-voting .tag {
    border: none;
    background: none;
    margin: 0;
    padding: 4px 8px;
    border-radius: 3px 0 0 3px;
    text-decoration: none;
    color: #333;
    display: inline-flex;
    align-items: center;
}

.tag-with-voting .tag:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.tag.tag-field {
    background-color: #e8f4f8;
}

.tag.tag-quality {
    background-color: #fef8e8;
}

.tag-vote-count {
    margin-left: 4px;
    color: #666;
    font-weight: normal;
}

.tag-vote-buttons {
    display: inline-flex;
    align-items: center;
    border-left: 1px solid #e0e0e0;
    padding: 0 6px;
    font-size: 10px;
    color: #ccc; 
}

.tag-vote-link {
    background: none;
    border: none;
    color: #828282;
    cursor: pointer;
    font-size: 10px;
    padding: 4px 2px;
    line-height: 1;
    text-decoration: none;
    transition: color 0.2s ease;
}

.tag-vote-link:hover {
    text-decoration: underline;
    color: #000;
}

.tag-vote-link.voted {
    color: #ff6600;
    font-weight: bold;
}

.tag-vote-btn {
    background: none;
    border: none;
    color: #828282;
    cursor: pointer;
    font-size: 10px;
    padding: 4px 6px;
    line-height: 1;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
}

.tag-vote-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.tag-vote-btn.upvote {
    border-right: 1px solid #e0e0e0;
}

.tag-vote-btn.upvote.active {
    color: #ff6600;
    background-color: rgba(255, 102, 0, 0.1);
}

.tag-vote-btn.downvote.active {
    color: #ff6600;
    background-color: rgba(255, 102, 0, 0.1);
}

/* Tag remove button adjustment */
.tag-with-voting .tag-remove-btn {
    background: none;
    border: none;
    border-left: 1px solid #e0e0e0;
    color: #828282;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 4px 8px;
    margin: 0;
    transition: all 0.2s ease;
    font-weight: bold;
    border-radius: 0 3px 3px 0;
}

.tag-with-voting .tag-remove-btn:hover {
    color: #d00;
    background-color: rgba(221, 0, 0, 0.1);
}

/* HTMX loading state for tags */
.tag-vote-wrapper.htmx-request {
    opacity: 0.6;
}

/* Ensure tags wrap properly */
.tags-with-votes {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    align-items: center;
}