/**
 * Yaruo Voting System - CSS
 * 
 * @package Yaruo_Voting_System
 */

/* オートコンプリートドロップダウン */
.autocomplete-wrapper {
    position: relative;
    flex: 1;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.autocomplete-dropdown.show {
    display: block;
}

.autocomplete-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: #f8f9fa;
}

.autocomplete-item.no-results {
    color: #999;
    cursor: default;
}

.autocomplete-item.no-results:hover {
    background: white;
}

.autocomplete-item .work-title {
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.autocomplete-item .work-meta {
    font-size: 12px;
    color: #666;
}

/* 投票メッセージ */
#voteMessage {
    padding: 15px 20px;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 16px;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

#voteMessage.success {
    background: #d1fae5;
    border: 1px solid #10b981;
    color: #065f46;
}

#voteMessage.error {
    background: #fee2e2;
    border: 1px solid #ef4444;
    color: #991b1b;
}

#voteMessage p {
    margin: 0;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 投票ボタン */
.submit-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 作品追加ボタン */
.add-work-btn {
    padding: 10px 20px;
    background: white;
    color: #667eea;
    border: 2px dashed #667eea;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 20px;
    width: 100%;
}

.add-work-btn:hover {
    background: #f0f7ff;
    border-color: #5568d3;
    transform: translateY(-1px);
}

/* 作品削除ボタン */
.remove-work-btn {
    padding: 6px 12px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.remove-work-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .work-options {
        flex-direction: column;
        gap: 8px !important;
    }
    
    .work-select {
        width: 100% !important;
    }
    
    .autocomplete-dropdown {
        max-height: 200px;
    }
    
    .submit-btn {
        width: 100%;
    }
}

/* ローディングアニメーション */
.submit-btn:disabled::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 投票済み表示 */
.voted-notice {
    background: #f0f7ff;
    border: 2px solid #667eea;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    color: #667eea;
    font-weight: 500;
}

.voted-notice::before {
    content: '✓';
    display: block;
    font-size: 48px;
    margin-bottom: 10px;
}
