/* Modal Close Button Fixes */

/* Ensure modal header has proper padding for close button */
.modal-header {
    padding-right: 60px !important; /* Make room for close button */
    min-height: 60px;
}

/* Fix close button positioning to avoid title overlap */
.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #6c757d;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    z-index: 10; /* Ensure it's above title */
    flex-shrink: 0;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(0, 0, 0, 0.2);
    color: #000;
    transform: scale(1.05);
}

/* Dark mode adjustments */
.dark-modal .modal-close {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

.dark-modal .modal-close:hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Ensure modal title doesn't overlap with close button */
.modal-content h2 {
    padding-right: 50px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: calc(100% - 60px);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .modal-header {
        padding-right: 50px !important;
    }
    
    .modal-close {
        width: 32px;
        height: 32px;
        font-size: 18px;
        top: 12px;
        right: 12px;
    }
    
    .modal-content h2 {
        font-size: 1.25rem;
        padding-right: 40px;
    }
}

/* Voting button loading states */
.vote-btn.voting {
    position: relative;
    overflow: hidden;
}

.vote-btn.voting::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: voting-shimmer 1s infinite;
}

@keyframes voting-shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Prevent vote button flicker during state changes */
.vote-btn {
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
}

.vote-btn:not(.voting):active {
    transform: scale(0.95);
}

/* Fix author display for model attribution */
.meta-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.meta-item.model-author {
    font-style: italic;
    color: var(--primary-color);
}

.meta-item.model-author::before {
    content: '🤖 ';
    font-style: normal;
}